wnodex 0.1.0 → 0.2.2
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/.turbo/turbo-build.log +7 -0
- package/LICENSE +1 -1
- package/README.md +73 -67
- package/dist/{schemas/wnodex-config.d.ts → config.d.ts} +14 -9
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +22 -0
- package/dist/index.d.ts +68 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -41
- package/dist/setup-config.d.ts +3 -0
- package/dist/setup-config.d.ts.map +1 -0
- package/dist/setup-config.js +9 -0
- package/dist/setup-middlewares.d.ts +4 -0
- package/dist/setup-middlewares.d.ts.map +1 -0
- package/dist/setup-middlewares.js +32 -0
- package/package.json +51 -15
- package/rolldown.config.ts +20 -0
- package/src/config.ts +27 -0
- package/src/index.ts +149 -38
- package/src/setup-config.ts +17 -0
- package/src/setup-middlewares.ts +49 -0
- package/tests/body-parser.schema.test.ts +57 -0
- package/tests/compression.schema.test.ts +27 -0
- package/tests/cookie-parser.schema.test.ts +56 -0
- package/tests/cors.schema.test.ts +35 -0
- package/tests/helmet.schema.test.ts +33 -0
- package/tests/hpp.schema.test.ts +31 -0
- package/tests/index.test.ts +105 -0
- package/tests/passport.schema.test.ts +33 -0
- package/tests/rate-limit.schema.test.ts +56 -0
- package/tests/session.schema.test.ts +80 -0
- package/tsconfig.json +8 -8
- package/vitest.config.ts +13 -0
- package/dist/consts/cors.d.ts +0 -15
- package/dist/consts/cors.d.ts.map +0 -1
- package/dist/consts/cors.js +0 -29
- package/dist/consts/error-codes.d.ts +0 -10
- package/dist/consts/error-codes.d.ts.map +0 -1
- package/dist/consts/error-codes.js +0 -12
- package/dist/consts/index.d.ts +0 -8
- package/dist/consts/index.d.ts.map +0 -1
- package/dist/consts/index.js +0 -10
- package/dist/consts/log-levels.d.ts +0 -8
- package/dist/consts/log-levels.d.ts.map +0 -1
- package/dist/consts/log-levels.js +0 -10
- package/dist/consts/node-env.d.ts +0 -7
- package/dist/consts/node-env.d.ts.map +0 -1
- package/dist/consts/node-env.js +0 -9
- package/dist/consts/port.d.ts +0 -6
- package/dist/consts/port.d.ts.map +0 -1
- package/dist/consts/port.js +0 -26
- package/dist/consts/rate-limit.d.ts +0 -9
- package/dist/consts/rate-limit.d.ts.map +0 -1
- package/dist/consts/rate-limit.js +0 -11
- package/dist/consts/session.d.ts +0 -6
- package/dist/consts/session.d.ts.map +0 -1
- package/dist/consts/session.js +0 -8
- package/dist/errors/base-error.d.ts +0 -57
- package/dist/errors/base-error.d.ts.map +0 -1
- package/dist/errors/base-error.js +0 -93
- package/dist/errors/config-error.d.ts +0 -20
- package/dist/errors/config-error.d.ts.map +0 -1
- package/dist/errors/config-error.js +0 -30
- package/dist/errors/http-error.d.ts +0 -17
- package/dist/errors/http-error.d.ts.map +0 -1
- package/dist/errors/http-error.js +0 -24
- package/dist/errors/index.d.ts +0 -5
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -7
- package/dist/errors/validation-error.d.ts +0 -19
- package/dist/errors/validation-error.d.ts.map +0 -1
- package/dist/errors/validation-error.js +0 -29
- package/dist/helpers/get-node-env.d.ts +0 -13
- package/dist/helpers/get-node-env.d.ts.map +0 -1
- package/dist/helpers/get-node-env.js +0 -27
- package/dist/helpers/index.d.ts +0 -5
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/index.js +0 -7
- package/dist/helpers/is-development.d.ts +0 -9
- package/dist/helpers/is-development.d.ts.map +0 -1
- package/dist/helpers/is-development.js +0 -16
- package/dist/helpers/setup-config.d.ts +0 -12
- package/dist/helpers/setup-config.d.ts.map +0 -1
- package/dist/helpers/setup-config.js +0 -21
- package/dist/helpers/setup-middlewares.d.ts +0 -12
- package/dist/helpers/setup-middlewares.d.ts.map +0 -1
- package/dist/helpers/setup-middlewares.js +0 -45
- package/dist/logger.d.ts +0 -3
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -21
- package/dist/middlewares/compression.d.ts +0 -18
- package/dist/middlewares/compression.d.ts.map +0 -1
- package/dist/middlewares/compression.js +0 -26
- package/dist/middlewares/cookie-parser.ts.d.ts +0 -20
- package/dist/middlewares/cookie-parser.ts.d.ts.map +0 -1
- package/dist/middlewares/cookie-parser.ts.js +0 -33
- package/dist/middlewares/cors.d.ts +0 -22
- package/dist/middlewares/cors.d.ts.map +0 -1
- package/dist/middlewares/cors.js +0 -34
- package/dist/middlewares/error-handler.d.ts +0 -21
- package/dist/middlewares/error-handler.d.ts.map +0 -1
- package/dist/middlewares/error-handler.js +0 -43
- package/dist/middlewares/helmet.d.ts +0 -16
- package/dist/middlewares/helmet.d.ts.map +0 -1
- package/dist/middlewares/helmet.js +0 -28
- package/dist/middlewares/hpp.d.ts +0 -18
- package/dist/middlewares/hpp.d.ts.map +0 -1
- package/dist/middlewares/hpp.js +0 -30
- package/dist/middlewares/index.d.ts +0 -10
- package/dist/middlewares/index.d.ts.map +0 -1
- package/dist/middlewares/index.js +0 -12
- package/dist/middlewares/passport.d.ts +0 -16
- package/dist/middlewares/passport.d.ts.map +0 -1
- package/dist/middlewares/passport.js +0 -27
- package/dist/middlewares/rate-limit.d.ts +0 -23
- package/dist/middlewares/rate-limit.d.ts.map +0 -1
- package/dist/middlewares/rate-limit.js +0 -35
- package/dist/middlewares/session.d.ts +0 -16
- package/dist/middlewares/session.d.ts.map +0 -1
- package/dist/middlewares/session.js +0 -23
- package/dist/schemas/compression.d.ts +0 -5
- package/dist/schemas/compression.d.ts.map +0 -1
- package/dist/schemas/compression.js +0 -5
- package/dist/schemas/cookie-parser.d.ts +0 -9
- package/dist/schemas/cookie-parser.d.ts.map +0 -1
- package/dist/schemas/cookie-parser.js +0 -14
- package/dist/schemas/cors.d.ts +0 -6
- package/dist/schemas/cors.d.ts.map +0 -1
- package/dist/schemas/cors.js +0 -9
- package/dist/schemas/error-metadata.d.ts +0 -18
- package/dist/schemas/error-metadata.d.ts.map +0 -1
- package/dist/schemas/error-metadata.js +0 -12
- package/dist/schemas/helmet.d.ts +0 -6
- package/dist/schemas/helmet.d.ts.map +0 -1
- package/dist/schemas/helmet.js +0 -8
- package/dist/schemas/hpp.d.ts +0 -5
- package/dist/schemas/hpp.d.ts.map +0 -1
- package/dist/schemas/hpp.js +0 -8
- package/dist/schemas/index.d.ts +0 -13
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -15
- package/dist/schemas/node-env.d.ts +0 -16
- package/dist/schemas/node-env.d.ts.map +0 -1
- package/dist/schemas/node-env.js +0 -8
- package/dist/schemas/passport.d.ts +0 -6
- package/dist/schemas/passport.d.ts.map +0 -1
- package/dist/schemas/passport.js +0 -8
- package/dist/schemas/port.d.ts +0 -4
- package/dist/schemas/port.d.ts.map +0 -1
- package/dist/schemas/port.js +0 -16
- package/dist/schemas/rate-limit.d.ts +0 -9
- package/dist/schemas/rate-limit.d.ts.map +0 -1
- package/dist/schemas/rate-limit.js +0 -26
- package/dist/schemas/session.d.ts +0 -18
- package/dist/schemas/session.d.ts.map +0 -1
- package/dist/schemas/session.js +0 -32
- package/dist/schemas/wnodex-config.d.ts.map +0 -1
- package/dist/schemas/wnodex-config.js +0 -24
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/wnodex.d.ts +0 -69
- package/dist/wnodex.d.ts.map +0 -1
- package/dist/wnodex.js +0 -131
- package/src/consts/cors.ts +0 -27
- package/src/consts/error-codes.ts +0 -9
- package/src/consts/index.ts +0 -7
- package/src/consts/log-levels.ts +0 -7
- package/src/consts/node-env.ts +0 -6
- package/src/consts/port.ts +0 -23
- package/src/consts/rate-limit.ts +0 -9
- package/src/consts/session.ts +0 -6
- package/src/errors/base-error.ts +0 -111
- package/src/errors/config-error.ts +0 -31
- package/src/errors/http-error.ts +0 -21
- package/src/errors/index.ts +0 -4
- package/src/errors/validation-error.ts +0 -30
- package/src/helpers/get-node-env.ts +0 -27
- package/src/helpers/index.ts +0 -4
- package/src/helpers/is-development.ts +0 -15
- package/src/helpers/setup-config.ts +0 -25
- package/src/helpers/setup-middlewares.ts +0 -56
- package/src/logger.ts +0 -22
- package/src/middlewares/compression.ts +0 -32
- package/src/middlewares/cookie-parser.ts.ts +0 -37
- package/src/middlewares/cors.ts +0 -35
- package/src/middlewares/error-handler.ts +0 -54
- package/src/middlewares/helmet.ts +0 -29
- package/src/middlewares/hpp.ts +0 -31
- package/src/middlewares/index.ts +0 -9
- package/src/middlewares/passport.ts +0 -30
- package/src/middlewares/rate-limit.ts +0 -39
- package/src/middlewares/session.ts +0 -25
- package/src/schemas/compression.ts +0 -8
- package/src/schemas/cookie-parser.ts +0 -21
- package/src/schemas/cors.ts +0 -13
- package/src/schemas/error-metadata.ts +0 -15
- package/src/schemas/helmet.ts +0 -11
- package/src/schemas/hpp.ts +0 -9
- package/src/schemas/index.ts +0 -12
- package/src/schemas/node-env.ts +0 -11
- package/src/schemas/passport.ts +0 -11
- package/src/schemas/port.ts +0 -22
- package/src/schemas/rate-limit.ts +0 -33
- package/src/schemas/session.ts +0 -40
- package/src/schemas/wnodex-config.ts +0 -26
- package/src/wnodex.ts +0 -152
- package/tsconfig.lib.json +0 -13
- package/tsconfig.tsbuildinfo +0 -1
package/dist/middlewares/cors.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureCors = configureCors;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cors_1 = tslib_1.__importDefault(require("cors"));
|
|
6
|
-
/**
|
|
7
|
-
* Configures the CORS middleware for an Express application.
|
|
8
|
-
* Reads the `cors` option from the provided config.
|
|
9
|
-
* If the option is a boolean:
|
|
10
|
-
* - `false` disables CORS middleware.
|
|
11
|
-
* - `true` enables CORS middleware with default settings.
|
|
12
|
-
* If the option is an object, it is spread into the CORS middleware options.
|
|
13
|
-
* @param app The Express Application instance to attach middleware to.
|
|
14
|
-
* @param config Typed configuration input that includes the CORS option.
|
|
15
|
-
*
|
|
16
|
-
* @returns The Express Application instance with CORS middleware applied,
|
|
17
|
-
* or undefined if CORS is disabled.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* private setupMiddlewares() {
|
|
21
|
-
* configureCors(this.app, this.config);
|
|
22
|
-
* }
|
|
23
|
-
*/
|
|
24
|
-
function configureCors(app, config) {
|
|
25
|
-
const { cors: options } = config;
|
|
26
|
-
if (typeof options === 'boolean') {
|
|
27
|
-
if (options === false || !options)
|
|
28
|
-
return;
|
|
29
|
-
return app.use((0, cors_1.default)());
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return app.use((0, cors_1.default)({ ...options }));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { NextFunction, Request, Response } from 'express';
|
|
2
|
-
import type { HttpError } from '../errors/http-error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Middleware for centralized error handling.
|
|
5
|
-
* Catches all errors thrown in the application and responds with a structured JSON.
|
|
6
|
-
* Logs the error for debugging purposes.
|
|
7
|
-
* @param err The thrown error object or value.
|
|
8
|
-
* @param _req The current Express request object.
|
|
9
|
-
* @param res The current Express response object.
|
|
10
|
-
* @param _next Next middleware function in chain.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* private setupMiddlewares() {
|
|
14
|
-
* // other middlewares
|
|
15
|
-
* // ...
|
|
16
|
-
* // Configure errorHandler as the last one middleware.
|
|
17
|
-
* app.use(errorHandler);
|
|
18
|
-
* }
|
|
19
|
-
*/
|
|
20
|
-
export declare function errorHandler(err: HttpError | Error, _req: Request, res: Response, _next: NextFunction): void;
|
|
21
|
-
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,YAAY,GAClB,IAAI,CA0BN"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.errorHandler = errorHandler;
|
|
4
|
-
const is_development_js_1 = require("../helpers/is-development.js");
|
|
5
|
-
/**
|
|
6
|
-
* Middleware for centralized error handling.
|
|
7
|
-
* Catches all errors thrown in the application and responds with a structured JSON.
|
|
8
|
-
* Logs the error for debugging purposes.
|
|
9
|
-
* @param err The thrown error object or value.
|
|
10
|
-
* @param _req The current Express request object.
|
|
11
|
-
* @param res The current Express response object.
|
|
12
|
-
* @param _next Next middleware function in chain.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* private setupMiddlewares() {
|
|
16
|
-
* // other middlewares
|
|
17
|
-
* // ...
|
|
18
|
-
* // Configure errorHandler as the last one middleware.
|
|
19
|
-
* app.use(errorHandler);
|
|
20
|
-
* }
|
|
21
|
-
*/
|
|
22
|
-
function errorHandler(err, _req, res, _next) {
|
|
23
|
-
// Log the error for server debugging
|
|
24
|
-
console.error(err);
|
|
25
|
-
// Determine HTTP status code; default to 500 if unavailable
|
|
26
|
-
const statusCode = typeof err === 'object' && err !== null && 'statusCode' in err
|
|
27
|
-
? err.statusCode
|
|
28
|
-
: 500;
|
|
29
|
-
// Get message or default to 'Internal Server Error'
|
|
30
|
-
const message = typeof err === 'object' && err !== null && 'message' in err
|
|
31
|
-
? err.message
|
|
32
|
-
: 'Internal Server Error';
|
|
33
|
-
// Send JSON response
|
|
34
|
-
res.status(statusCode).json({
|
|
35
|
-
error: {
|
|
36
|
-
message,
|
|
37
|
-
// Show stack trace only in development environment
|
|
38
|
-
...((0, is_development_js_1.isDevelopment)() && {
|
|
39
|
-
stack: err.stack,
|
|
40
|
-
}),
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Application } from 'express';
|
|
2
|
-
import type { WnodexConfigOutput } from '../schemas/wnodex-config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the Helmet middleware in an Express app.
|
|
5
|
-
* @param app The Express Application instance on which to apply Helmet.
|
|
6
|
-
* @param config Typed project configuration from which the Helmet option is read.
|
|
7
|
-
*
|
|
8
|
-
* @returns The Express Application instance (`app`) if Helmet is enable.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* private setupMiddlewares() {
|
|
12
|
-
* configureHelmet(this.app, this.config);
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare function configureHelmet(app: Application, config: WnodexConfigOutput): Application | undefined;
|
|
16
|
-
//# sourceMappingURL=helmet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helmet.d.ts","sourceRoot":"","sources":["../../src/middlewares/helmet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,2BAU3E"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureHelmet = configureHelmet;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const helmet_1 = tslib_1.__importDefault(require("helmet"));
|
|
6
|
-
/**
|
|
7
|
-
* Configures the Helmet middleware in an Express app.
|
|
8
|
-
* @param app The Express Application instance on which to apply Helmet.
|
|
9
|
-
* @param config Typed project configuration from which the Helmet option is read.
|
|
10
|
-
*
|
|
11
|
-
* @returns The Express Application instance (`app`) if Helmet is enable.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* private setupMiddlewares() {
|
|
15
|
-
* configureHelmet(this.app, this.config);
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
function configureHelmet(app, config) {
|
|
19
|
-
const { helmet: options } = config;
|
|
20
|
-
if (typeof options === 'boolean') {
|
|
21
|
-
if (options === false || !options)
|
|
22
|
-
return;
|
|
23
|
-
return app.use((0, helmet_1.default)());
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return app.use((0, helmet_1.default)({ ...options }));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Application } from 'express';
|
|
2
|
-
import type { WnodexConfigOutput } from '../schemas/wnodex-config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the hpp middleware protection against HTTP Parameter Pollution.
|
|
5
|
-
*
|
|
6
|
-
* Applies the hpp middleware to the Express application instance based on the
|
|
7
|
-
* provided configuration. If configuration is a boolean and true, applies with default.
|
|
8
|
-
* If configuration is an array, uses it as a whitelist of allowed duplicate parameters.
|
|
9
|
-
* @param app The Express application instance.
|
|
10
|
-
* @param config The normalized middleware configuration, specifying hpp options.
|
|
11
|
-
* @returns Void.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* configureHpp(app, { hpp: true });
|
|
15
|
-
* configureHpp(app, { hpp: ['param1', 'param2'] });
|
|
16
|
-
*/
|
|
17
|
-
export declare function configureHpp(app: Application, config: WnodexConfigOutput): Application | undefined;
|
|
18
|
-
//# sourceMappingURL=hpp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hpp.d.ts","sourceRoot":"","sources":["../../src/middlewares/hpp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,2BAUxE"}
|
package/dist/middlewares/hpp.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureHpp = configureHpp;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const hpp_1 = tslib_1.__importDefault(require("hpp"));
|
|
6
|
-
/**
|
|
7
|
-
* Configures the hpp middleware protection against HTTP Parameter Pollution.
|
|
8
|
-
*
|
|
9
|
-
* Applies the hpp middleware to the Express application instance based on the
|
|
10
|
-
* provided configuration. If configuration is a boolean and true, applies with default.
|
|
11
|
-
* If configuration is an array, uses it as a whitelist of allowed duplicate parameters.
|
|
12
|
-
* @param app The Express application instance.
|
|
13
|
-
* @param config The normalized middleware configuration, specifying hpp options.
|
|
14
|
-
* @returns Void.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* configureHpp(app, { hpp: true });
|
|
18
|
-
* configureHpp(app, { hpp: ['param1', 'param2'] });
|
|
19
|
-
*/
|
|
20
|
-
function configureHpp(app, config) {
|
|
21
|
-
const { hpp: options } = config;
|
|
22
|
-
if (typeof options === 'boolean') {
|
|
23
|
-
if (options === false || !options)
|
|
24
|
-
return;
|
|
25
|
-
return app.use((0, hpp_1.default)());
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return app.use((0, hpp_1.default)({ whitelist: [...options] }));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './compression.js';
|
|
2
|
-
export * from './cookie-parser.ts.js';
|
|
3
|
-
export * from './cors.js';
|
|
4
|
-
export * from './error-handler.js';
|
|
5
|
-
export * from './helmet.js';
|
|
6
|
-
export * from './hpp.js';
|
|
7
|
-
export * from './passport.js';
|
|
8
|
-
export * from './rate-limit.js';
|
|
9
|
-
export * from './session.js';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./compression.js"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./cookie-parser.ts.js"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./cors.js"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./error-handler.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./helmet.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./hpp.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./passport.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./rate-limit.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./session.js"), exports);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Application } from 'express';
|
|
2
|
-
import type { WnodexConfigInput } from '../schemas/wnodex-config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the passport instance.
|
|
5
|
-
* @param app The express application instance.
|
|
6
|
-
* @param config The Wnodex raw config.
|
|
7
|
-
* @returns The passport instance.
|
|
8
|
-
* @example
|
|
9
|
-
* construction(config: WnodexConfigInput) {
|
|
10
|
-
* this.app = express();
|
|
11
|
-
* this.config = configureConfig(config);
|
|
12
|
-
* this.passport = configurePassport(this.app, this.config)
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare function configurePassport(app: Application, config: WnodexConfigInput): import("passport").PassportStatic | undefined;
|
|
16
|
-
//# sourceMappingURL=passport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"passport.d.ts","sourceRoot":"","sources":["../../src/middlewares/passport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,iDAa5E"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configurePassport = configurePassport;
|
|
4
|
-
/**
|
|
5
|
-
* Configures the passport instance.
|
|
6
|
-
* @param app The express application instance.
|
|
7
|
-
* @param config The Wnodex raw config.
|
|
8
|
-
* @returns The passport instance.
|
|
9
|
-
* @example
|
|
10
|
-
* construction(config: WnodexConfigInput) {
|
|
11
|
-
* this.app = express();
|
|
12
|
-
* this.config = configureConfig(config);
|
|
13
|
-
* this.passport = configurePassport(this.app, this.config)
|
|
14
|
-
* }
|
|
15
|
-
*/
|
|
16
|
-
function configurePassport(app, config) {
|
|
17
|
-
const { passport } = config;
|
|
18
|
-
/**
|
|
19
|
-
* If config.passport is either undefined, true (invalid config), or false, passport won't be instantiated.
|
|
20
|
-
*/
|
|
21
|
-
if (!passport || typeof passport === 'boolean')
|
|
22
|
-
return;
|
|
23
|
-
app.set('passport', passport);
|
|
24
|
-
app.use(passport.initialize());
|
|
25
|
-
app.use(passport.session());
|
|
26
|
-
return passport;
|
|
27
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Application } from 'express';
|
|
2
|
-
import type { WnodexConfigOutput } from '../schemas/wnodex-config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the rate limiting middleware to protect the application
|
|
5
|
-
* from excessive requests, mitigating abuse and denial of service attacks.
|
|
6
|
-
*
|
|
7
|
-
* It reads the `rateLimit` option from the provided config.
|
|
8
|
-
* If it's a boolean:
|
|
9
|
-
* - `false` disables rate limiting.
|
|
10
|
-
* - `true` enables rate limiting with default settings.
|
|
11
|
-
* If it's an object, it spreads the properties into the rateLimit options.
|
|
12
|
-
* @param app Express Application instance to apply the rate limiter to.
|
|
13
|
-
* @param config Typed application configuration object containing rateLimit option.
|
|
14
|
-
*
|
|
15
|
-
* @returns The result of `app.use(rateLimit())` if rate limiting is enabled, otherwise `undefined`.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* private setupMiddlewares() {
|
|
19
|
-
* configureHelmet(this.app, this.config);
|
|
20
|
-
* }
|
|
21
|
-
*/
|
|
22
|
-
export declare function configureRateLimit(app: Application, config: WnodexConfigOutput): Application | undefined;
|
|
23
|
-
//# sourceMappingURL=rate-limit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../src/middlewares/rate-limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,kBAAkB,2BAW3B"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureRateLimit = configureRateLimit;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const express_rate_limit_1 = tslib_1.__importDefault(require("express-rate-limit"));
|
|
6
|
-
/**
|
|
7
|
-
* Configures the rate limiting middleware to protect the application
|
|
8
|
-
* from excessive requests, mitigating abuse and denial of service attacks.
|
|
9
|
-
*
|
|
10
|
-
* It reads the `rateLimit` option from the provided config.
|
|
11
|
-
* If it's a boolean:
|
|
12
|
-
* - `false` disables rate limiting.
|
|
13
|
-
* - `true` enables rate limiting with default settings.
|
|
14
|
-
* If it's an object, it spreads the properties into the rateLimit options.
|
|
15
|
-
* @param app Express Application instance to apply the rate limiter to.
|
|
16
|
-
* @param config Typed application configuration object containing rateLimit option.
|
|
17
|
-
*
|
|
18
|
-
* @returns The result of `app.use(rateLimit())` if rate limiting is enabled, otherwise `undefined`.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* private setupMiddlewares() {
|
|
22
|
-
* configureHelmet(this.app, this.config);
|
|
23
|
-
* }
|
|
24
|
-
*/
|
|
25
|
-
function configureRateLimit(app, config) {
|
|
26
|
-
const { rateLimit: options } = config;
|
|
27
|
-
if (typeof options === 'boolean') {
|
|
28
|
-
if (options === false || !options)
|
|
29
|
-
return;
|
|
30
|
-
return app.use((0, express_rate_limit_1.default)());
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return app.use((0, express_rate_limit_1.default)({ ...options }));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Application } from 'express';
|
|
2
|
-
import type { WnodexConfigOutput } from '../schemas/wnodex-config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configures the Express session middleware with the provided options.
|
|
5
|
-
* Applies session management to the Express application, enabling
|
|
6
|
-
* stateful sessions with cookies.
|
|
7
|
-
* @param app The Express application instance.
|
|
8
|
-
* @param config The validated configuration object containing session options.
|
|
9
|
-
* @returns The Express Application instance with Session middleware applied,
|
|
10
|
-
* or undefined if ession is disabled.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* configureSession(app, { session: { secret: 'your-secret', resave: false, saveUninitialized: false } });
|
|
14
|
-
*/
|
|
15
|
-
export declare function configureSession(app: Application, config: WnodexConfigOutput): Application | undefined;
|
|
16
|
-
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/middlewares/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,2BAM5E"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureSession = configureSession;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const express_session_1 = tslib_1.__importDefault(require("express-session"));
|
|
6
|
-
/**
|
|
7
|
-
* Configures the Express session middleware with the provided options.
|
|
8
|
-
* Applies session management to the Express application, enabling
|
|
9
|
-
* stateful sessions with cookies.
|
|
10
|
-
* @param app The Express application instance.
|
|
11
|
-
* @param config The validated configuration object containing session options.
|
|
12
|
-
* @returns The Express Application instance with Session middleware applied,
|
|
13
|
-
* or undefined if ession is disabled.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* configureSession(app, { session: { secret: 'your-secret', resave: false, saveUninitialized: false } });
|
|
17
|
-
*/
|
|
18
|
-
function configureSession(app, config) {
|
|
19
|
-
const { session: options } = config;
|
|
20
|
-
if (!options)
|
|
21
|
-
return;
|
|
22
|
-
return app.use((0, express_session_1.default)({ ...options }));
|
|
23
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const CompressionOptionsSchema: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
3
|
-
export type CompressionOptionsInput = z.input<typeof CompressionOptionsSchema>;
|
|
4
|
-
export type CompressionOptionsOutput = z.output<typeof CompressionOptionsSchema>;
|
|
5
|
-
//# sourceMappingURL=compression.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../src/schemas/compression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,wBAAwB,2CAAuC,CAAC;AAE7E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,wBAAwB,CAChC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CookieParseOptions } from 'cookie-parser';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export declare const CookieParserOptionsSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
4
|
-
secret: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
5
|
-
options: z.ZodOptional<z.ZodCustom<CookieParseOptions, CookieParseOptions>>;
|
|
6
|
-
}, z.core.$strip>]>>>;
|
|
7
|
-
export type CookieParserOptionsInput = z.input<typeof CookieParserOptionsSchema>;
|
|
8
|
-
export type CookieParserOptionsOutput = z.output<typeof CookieParserOptionsSchema>;
|
|
9
|
-
//# sourceMappingURL=cookie-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-parser.d.ts","sourceRoot":"","sources":["../../src/schemas/cookie-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;;;qBAStB,CAAC;AAEjB,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,yBAAyB,CACjC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC9C,OAAO,yBAAyB,CACjC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CookieParserOptionsSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.CookieParserOptionsSchema = zod_1.z
|
|
6
|
-
.union([
|
|
7
|
-
zod_1.z.boolean(),
|
|
8
|
-
zod_1.z.object({
|
|
9
|
-
secret: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]),
|
|
10
|
-
options: zod_1.z.custom().optional(),
|
|
11
|
-
}),
|
|
12
|
-
])
|
|
13
|
-
.optional()
|
|
14
|
-
.default(true);
|
package/dist/schemas/cors.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CorsOptions } from 'cors';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export declare const CorsOptionsSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<CorsOptions, CorsOptions>]>>>;
|
|
4
|
-
export type CorsOptionsInput = z.input<typeof CorsOptionsSchema>;
|
|
5
|
-
export type CorsOptionsOutput = z.output<typeof CorsOptionsSchema>;
|
|
6
|
-
//# sourceMappingURL=cors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/schemas/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB,yGAGE,CAAC;AAEjC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/schemas/cors.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CorsOptionsSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const cors_js_1 = require("../consts/cors.js");
|
|
6
|
-
exports.CorsOptionsSchema = zod_1.z
|
|
7
|
-
.union([zod_1.z.boolean(), zod_1.z.custom()])
|
|
8
|
-
.optional()
|
|
9
|
-
.default(cors_js_1.DEFAULT_CORS_OPTIONS);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const ErrorMetadataSchema: z.ZodObject<{
|
|
3
|
-
code: z.ZodEnum<{
|
|
4
|
-
VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
5
|
-
CONFIG_ERROR: "CONFIG_ERROR";
|
|
6
|
-
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
7
|
-
NOT_FOUND: "NOT_FOUND";
|
|
8
|
-
UNAUTHORIZED: "UNAUTHORIZED";
|
|
9
|
-
FORBIDDEN: "FORBIDDEN";
|
|
10
|
-
BAD_REQUEST: "BAD_REQUEST";
|
|
11
|
-
}>;
|
|
12
|
-
cause: z.ZodOptional<z.ZodUnknown>;
|
|
13
|
-
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
|
-
}, z.core.$strict>;
|
|
15
|
-
export type ErrorMetadata = z.infer<typeof ErrorMetadataSchema>;
|
|
16
|
-
export type ErrorMetadataInput = z.input<typeof ErrorMetadataSchema>;
|
|
17
|
-
export type ErrorMetadataOutput = z.output<typeof ErrorMetadataSchema>;
|
|
18
|
-
//# sourceMappingURL=error-metadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-metadata.d.ts","sourceRoot":"","sources":["../../src/schemas/error-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;kBAMrB,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMetadataSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const error_codes_js_1 = require("../consts/error-codes.js");
|
|
6
|
-
exports.ErrorMetadataSchema = zod_1.z
|
|
7
|
-
.object({
|
|
8
|
-
code: zod_1.z.enum(Object.values(error_codes_js_1.ERROR_CODES)),
|
|
9
|
-
cause: zod_1.z.unknown().optional(),
|
|
10
|
-
context: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
11
|
-
})
|
|
12
|
-
.strict();
|
package/dist/schemas/helmet.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { HelmetOptions } from 'helmet';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export declare const HelmetOptionsSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<HelmetOptions, HelmetOptions>]>>>;
|
|
4
|
-
export type HelmetOptionsInput = z.input<typeof HelmetOptionsSchema>;
|
|
5
|
-
export type HelmetOptionsOutput = z.output<typeof HelmetOptionsSchema>;
|
|
6
|
-
//# sourceMappingURL=helmet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helmet.d.ts","sourceRoot":"","sources":["../../src/schemas/helmet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,6GAGf,CAAC;AAElB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/schemas/helmet.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HelmetOptionsSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.HelmetOptionsSchema = zod_1.z
|
|
6
|
-
.union([zod_1.z.boolean(), zod_1.z.custom()])
|
|
7
|
-
.optional()
|
|
8
|
-
.default(false);
|
package/dist/schemas/hpp.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const HppOptionsSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
|
|
3
|
-
export type HppOptionsInput = z.input<typeof HppOptionsSchema>;
|
|
4
|
-
export type HppOptionsoutput = z.output<typeof HppOptionsSchema>;
|
|
5
|
-
//# sourceMappingURL=hpp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hpp.d.ts","sourceRoot":"","sources":["../../src/schemas/hpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,2FAGb,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/schemas/hpp.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HppOptionsSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.HppOptionsSchema = zod_1.z
|
|
6
|
-
.union([zod_1.z.boolean(), zod_1.z.array(zod_1.z.string())])
|
|
7
|
-
.optional()
|
|
8
|
-
.default(true);
|
package/dist/schemas/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './compression.js';
|
|
2
|
-
export * from './cookie-parser.js';
|
|
3
|
-
export * from './cors.js';
|
|
4
|
-
export * from './error-metadata.js';
|
|
5
|
-
export * from './helmet.js';
|
|
6
|
-
export * from './hpp.js';
|
|
7
|
-
export * from './node-env.js';
|
|
8
|
-
export * from './passport.js';
|
|
9
|
-
export * from './port.js';
|
|
10
|
-
export * from './rate-limit.js';
|
|
11
|
-
export * from './session.js';
|
|
12
|
-
export * from './wnodex-config.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
package/dist/schemas/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./compression.js"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./cookie-parser.js"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./cors.js"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./error-metadata.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./helmet.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./hpp.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./node-env.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./passport.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./port.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./rate-limit.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./session.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./wnodex-config.js"), exports);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const NODE_ENVS: ("production" | "development" | "test" | "staging")[];
|
|
3
|
-
export declare const NodeEnvSchema: z.ZodEnum<{
|
|
4
|
-
production: "production";
|
|
5
|
-
development: "development";
|
|
6
|
-
test: "test";
|
|
7
|
-
staging: "staging";
|
|
8
|
-
}>;
|
|
9
|
-
export declare const NodeEnvEnum: {
|
|
10
|
-
production: "production";
|
|
11
|
-
development: "development";
|
|
12
|
-
test: "test";
|
|
13
|
-
staging: "staging";
|
|
14
|
-
};
|
|
15
|
-
export type NodeEnv = z.infer<typeof NodeEnvSchema>;
|
|
16
|
-
//# sourceMappingURL=node-env.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-env.d.ts","sourceRoot":"","sources":["../../src/schemas/node-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,SAAS,uDAAiC,CAAC;AAExD,eAAO,MAAM,aAAa;;;;;EAAyB,CAAC;AAEpD,eAAO,MAAM,WAAW;;;;;CAAqB,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas/node-env.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeEnvEnum = exports.NodeEnvSchema = exports.NODE_ENVS = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const node_env_js_1 = require("../consts/node-env.js");
|
|
6
|
-
exports.NODE_ENVS = Object.values(node_env_js_1.NODE_ENV_VALUES);
|
|
7
|
-
exports.NodeEnvSchema = zod_1.z.enum([...exports.NODE_ENVS]);
|
|
8
|
-
exports.NodeEnvEnum = exports.NodeEnvSchema.enum;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import passport from 'passport';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export declare const PassportSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodCustom<passport.PassportStatic, passport.PassportStatic>]>>>;
|
|
4
|
-
export type PassportInput = z.input<typeof PassportSchema>;
|
|
5
|
-
export type PassportOutput = z.output<typeof PassportSchema>;
|
|
6
|
-
//# sourceMappingURL=passport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"passport.d.ts","sourceRoot":"","sources":["../../src/schemas/passport.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,wIAGV,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC"}
|