@maysun/common 3.0.18 → 3.0.20
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/build/index.d.ts
CHANGED
|
@@ -6,3 +6,7 @@ export * from "./errors/not-found-error";
|
|
|
6
6
|
export * from "./errors/request-validation-error";
|
|
7
7
|
export * from "./errors/graphql/graphql-error-handler";
|
|
8
8
|
export * from "./errors/graphql/validationError";
|
|
9
|
+
export * from "./middleware/error-handler";
|
|
10
|
+
export * from "./middleware/xssSanitize";
|
|
11
|
+
export * from "./middleware/rateLimit";
|
|
12
|
+
export * from "./middleware/current-user";
|
package/build/index.js
CHANGED
|
@@ -22,3 +22,7 @@ __exportStar(require("./errors/not-found-error"), exports);
|
|
|
22
22
|
__exportStar(require("./errors/request-validation-error"), exports);
|
|
23
23
|
__exportStar(require("./errors/graphql/graphql-error-handler"), exports);
|
|
24
24
|
__exportStar(require("./errors/graphql/validationError"), exports);
|
|
25
|
+
__exportStar(require("./middleware/error-handler"), exports);
|
|
26
|
+
__exportStar(require("./middleware/xssSanitize"), exports);
|
|
27
|
+
__exportStar(require("./middleware/rateLimit"), exports);
|
|
28
|
+
__exportStar(require("./middleware/current-user"), exports);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default _default;
|
|
1
|
+
export declare const rateLimit: import("express-rate-limit").RateLimitRequestHandler;
|
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.rateLimit = void 0;
|
|
6
7
|
const public_config_1 = require("../config/public.config");
|
|
7
8
|
const express_rate_limit_1 = __importDefault(require("express-rate-limit"));
|
|
8
|
-
exports.
|
|
9
|
+
exports.rateLimit = (0, express_rate_limit_1.default)({
|
|
9
10
|
max: public_config_1.RATE_LIMIT,
|
|
10
11
|
windowMs: public_config_1.WINDOW_MS * 60 * 1000,
|
|
11
12
|
message: `Too many request per ip, in ${public_config_1.WINDOW_MS} minutes!`,
|