exisjs 0.7.5 → 0.7.7
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/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +12 -0
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +5 -0
- package/dist/cli/commands/clean.d.ts.map +1 -0
- package/dist/cli/commands/clean.js +30 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +171 -86
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +6 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +57 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +54 -16
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +26 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/manifest.d.ts +1 -0
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +264 -33
- package/dist/cli/manifest.js.map +1 -1
- package/dist/cli/resolve-aliases.d.ts +1 -1
- package/dist/cli/resolve-aliases.d.ts.map +1 -1
- package/dist/cli/resolve-aliases.js +30 -13
- package/dist/cli/resolve-aliases.js.map +1 -1
- package/dist/config/config.d.ts +3 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +9 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +6 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/cron/expressions.d.ts +45 -0
- package/dist/cron/expressions.d.ts.map +1 -0
- package/dist/cron/expressions.js +87 -0
- package/dist/cron/expressions.js.map +1 -0
- package/dist/cron/index.d.ts +6 -0
- package/dist/cron/index.d.ts.map +1 -0
- package/dist/cron/index.js +22 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/job.d.ts +50 -0
- package/dist/cron/job.d.ts.map +1 -0
- package/dist/cron/job.js +247 -0
- package/dist/cron/job.js.map +1 -0
- package/dist/cron/manager.d.ts +105 -0
- package/dist/cron/manager.d.ts.map +1 -0
- package/dist/cron/manager.js +245 -0
- package/dist/cron/manager.js.map +1 -0
- package/dist/cron/parser.d.ts +22 -0
- package/dist/cron/parser.d.ts.map +1 -0
- package/dist/cron/parser.js +269 -0
- package/dist/cron/parser.js.map +1 -0
- package/dist/cron/types.d.ts +76 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +3 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/decorators/constants.d.ts +2 -0
- package/dist/decorators/constants.d.ts.map +1 -1
- package/dist/decorators/constants.js +3 -1
- package/dist/decorators/constants.js.map +1 -1
- package/dist/decorators/core.d.ts +29 -11
- package/dist/decorators/core.d.ts.map +1 -1
- package/dist/decorators/core.js +49 -11
- package/dist/decorators/core.js.map +1 -1
- package/dist/decorators/cron.d.ts +57 -0
- package/dist/decorators/cron.d.ts.map +1 -0
- package/dist/decorators/cron.js +143 -0
- package/dist/decorators/cron.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +2 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/middleware.d.ts +65 -2
- package/dist/decorators/middleware.d.ts.map +1 -1
- package/dist/decorators/middleware.js +148 -62
- package/dist/decorators/middleware.js.map +1 -1
- package/dist/decorators/params.d.ts +102 -2
- package/dist/decorators/params.d.ts.map +1 -1
- package/dist/decorators/params.js +105 -3
- package/dist/decorators/params.js.map +1 -1
- package/dist/decorators/response.d.ts.map +1 -1
- package/dist/decorators/response.js +32 -22
- package/dist/decorators/response.js.map +1 -1
- package/dist/decorators/routing.d.ts +81 -16
- package/dist/decorators/routing.d.ts.map +1 -1
- package/dist/decorators/routing.js +81 -16
- package/dist/decorators/routing.js.map +1 -1
- package/dist/di/container.d.ts.map +1 -1
- package/dist/di/container.js +6 -1
- package/dist/di/container.js.map +1 -1
- package/dist/docs/content/cli/commands.mdx +1 -1
- package/dist/docs/content/controllers.mdx +127 -10
- package/dist/docs/content/cron.mdx +196 -0
- package/dist/docs/content/decorators.mdx +22 -4
- package/dist/docs/content/errors.mdx +58 -9
- package/dist/docs/content/introduction.mdx +7 -7
- package/dist/docs/content/middleware.mdx +269 -6
- package/dist/docs/content/requests.mdx +180 -6
- package/dist/docs/content/responses.mdx +283 -32
- package/dist/docs/content/routing.mdx +46 -0
- package/dist/docs/content/swagger.mdx +228 -0
- package/dist/docs/content/validation.mdx +190 -11
- package/dist/docs/reference/context.mdx +11 -0
- package/dist/docs/reference/cron.mdx +300 -0
- package/dist/docs/reference/decorators.mdx +22 -4
- package/dist/docs/reference/error.mdx +88 -0
- package/dist/docs/reference/logger.mdx +175 -43
- package/dist/docs/reference/middleware.mdx +31 -0
- package/dist/docs/reference/router.mdx +22 -0
- package/dist/docs/reference/swagger.mdx +143 -0
- package/dist/docs/reference/validator.mdx +83 -23
- package/dist/error/errors.d.ts.map +1 -1
- package/dist/error/errors.js +95 -43
- package/dist/error/errors.js.map +1 -1
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.d.ts.map +1 -1
- package/dist/error/index.js +11 -1
- package/dist/error/index.js.map +1 -1
- package/dist/error/overlay.d.ts +42 -0
- package/dist/error/overlay.d.ts.map +1 -0
- package/dist/error/overlay.js +306 -0
- package/dist/error/overlay.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/start-server.js +33 -7
- package/dist/lib/start-server.js.map +1 -1
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +9 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/middleware/guard.d.ts +2 -2
- package/dist/middleware/guard.d.ts.map +1 -1
- package/dist/middleware/guard.js.map +1 -1
- package/dist/middleware/ip-filter.d.ts +1 -0
- package/dist/middleware/ip-filter.d.ts.map +1 -1
- package/dist/middleware/ip-filter.js +2 -0
- package/dist/middleware/ip-filter.js.map +1 -1
- package/dist/middleware/middleware.d.ts +2 -2
- package/dist/middleware/middleware.d.ts.map +1 -1
- package/dist/middleware/middleware.js +20 -2
- package/dist/middleware/middleware.js.map +1 -1
- package/dist/middleware/security.d.ts +43 -1
- package/dist/middleware/security.d.ts.map +1 -1
- package/dist/middleware/security.js +101 -0
- package/dist/middleware/security.js.map +1 -1
- package/dist/response/index.d.ts +229 -6
- package/dist/response/index.d.ts.map +1 -1
- package/dist/response/index.js +272 -2
- package/dist/response/index.js.map +1 -1
- package/dist/router/boundary.d.ts +41 -11
- package/dist/router/boundary.d.ts.map +1 -1
- package/dist/router/boundary.js +24 -2
- package/dist/router/boundary.js.map +1 -1
- package/dist/router/controller-registrar.d.ts.map +1 -1
- package/dist/router/controller-registrar.js +108 -4
- package/dist/router/controller-registrar.js.map +1 -1
- package/dist/router/index.d.ts +2 -2
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +2 -1
- package/dist/router/index.js.map +1 -1
- package/dist/router/route-builder.d.ts +262 -65
- package/dist/router/route-builder.d.ts.map +1 -1
- package/dist/router/route-builder.js +181 -23
- package/dist/router/route-builder.js.map +1 -1
- package/dist/router/route-scanner.d.ts +6 -0
- package/dist/router/route-scanner.d.ts.map +1 -1
- package/dist/router/route-scanner.js +71 -792
- package/dist/router/route-scanner.js.map +1 -1
- package/dist/router/router.d.ts.map +1 -1
- package/dist/router/router.js +62 -17
- package/dist/router/router.js.map +1 -1
- package/dist/router/scanner/boundary-loader.d.ts +18 -0
- package/dist/router/scanner/boundary-loader.d.ts.map +1 -0
- package/dist/router/scanner/boundary-loader.js +539 -0
- package/dist/router/scanner/boundary-loader.js.map +1 -0
- package/dist/router/scanner/cron-mounter.d.ts +15 -0
- package/dist/router/scanner/cron-mounter.d.ts.map +1 -0
- package/dist/router/scanner/cron-mounter.js +216 -0
- package/dist/router/scanner/cron-mounter.js.map +1 -0
- package/dist/router/scanner/error-mounter.d.ts +14 -0
- package/dist/router/scanner/error-mounter.d.ts.map +1 -0
- package/dist/router/scanner/error-mounter.js +200 -0
- package/dist/router/scanner/error-mounter.js.map +1 -0
- package/dist/router/scanner/fs-scanner.d.ts +25 -0
- package/dist/router/scanner/fs-scanner.d.ts.map +1 -0
- package/dist/router/scanner/fs-scanner.js +115 -0
- package/dist/router/scanner/fs-scanner.js.map +1 -0
- package/dist/router/scanner/functional-compiler.d.ts +9 -0
- package/dist/router/scanner/functional-compiler.d.ts.map +1 -0
- package/dist/router/scanner/functional-compiler.js +233 -0
- package/dist/router/scanner/functional-compiler.js.map +1 -0
- package/dist/router/scanner/index.d.ts +9 -0
- package/dist/router/scanner/index.d.ts.map +1 -0
- package/dist/router/scanner/index.js +19 -0
- package/dist/router/scanner/index.js.map +1 -0
- package/dist/router/types.d.ts +23 -0
- package/dist/router/types.d.ts.map +1 -1
- package/dist/server/app.d.ts +3 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +13 -0
- package/dist/server/app.js.map +1 -1
- package/dist/server/bootstrapper.d.ts.map +1 -1
- package/dist/server/bootstrapper.js +91 -30
- package/dist/server/bootstrapper.js.map +1 -1
- package/dist/server/cluster.d.ts.map +1 -1
- package/dist/server/cluster.js +13 -2
- package/dist/server/cluster.js.map +1 -1
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/context.js +50 -6
- package/dist/server/context.js.map +1 -1
- package/dist/server/helpers/body-parser.d.ts +18 -0
- package/dist/server/helpers/body-parser.d.ts.map +1 -0
- package/dist/server/helpers/body-parser.js +246 -0
- package/dist/server/helpers/body-parser.js.map +1 -0
- package/dist/server/helpers/cookie.d.ts +4 -0
- package/dist/server/helpers/cookie.d.ts.map +1 -0
- package/dist/server/helpers/cookie.js +61 -0
- package/dist/server/helpers/cookie.js.map +1 -0
- package/dist/server/helpers/etag.d.ts +3 -0
- package/dist/server/helpers/etag.d.ts.map +1 -0
- package/dist/server/helpers/etag.js +25 -0
- package/dist/server/helpers/etag.js.map +1 -0
- package/dist/server/helpers/index.d.ts +6 -0
- package/dist/server/helpers/index.d.ts.map +1 -0
- package/dist/server/helpers/index.js +21 -0
- package/dist/server/helpers/index.js.map +1 -0
- package/dist/server/helpers/ip.d.ts +9 -0
- package/dist/server/helpers/ip.d.ts.map +1 -0
- package/dist/server/helpers/ip.js +62 -0
- package/dist/server/helpers/ip.js.map +1 -0
- package/dist/server/helpers/stream.d.ts +4 -0
- package/dist/server/helpers/stream.d.ts.map +1 -0
- package/dist/server/helpers/stream.js +193 -0
- package/dist/server/helpers/stream.js.map +1 -0
- package/dist/server/lifecycle.d.ts +22 -0
- package/dist/server/lifecycle.d.ts.map +1 -0
- package/dist/server/lifecycle.js +106 -0
- package/dist/server/lifecycle.js.map +1 -0
- package/dist/server/request-handler.d.ts +1 -0
- package/dist/server/request-handler.d.ts.map +1 -1
- package/dist/server/request-handler.js +27 -17
- package/dist/server/request-handler.js.map +1 -1
- package/dist/server/request.d.ts +1 -139
- package/dist/server/request.d.ts.map +1 -1
- package/dist/server/request.js +37 -433
- package/dist/server/request.js.map +1 -1
- package/dist/server/response.d.ts +112 -156
- package/dist/server/response.d.ts.map +1 -1
- package/dist/server/response.js +129 -279
- package/dist/server/response.js.map +1 -1
- package/dist/swagger/decorators.d.ts +81 -0
- package/dist/swagger/decorators.d.ts.map +1 -0
- package/dist/swagger/decorators.js +172 -0
- package/dist/swagger/decorators.js.map +1 -0
- package/dist/swagger/generator.d.ts +19 -0
- package/dist/swagger/generator.d.ts.map +1 -0
- package/dist/swagger/generator.js +344 -0
- package/dist/swagger/generator.js.map +1 -0
- package/dist/swagger/index.d.ts +31 -0
- package/dist/swagger/index.d.ts.map +1 -0
- package/dist/swagger/index.js +53 -0
- package/dist/swagger/index.js.map +1 -0
- package/dist/swagger/mounter.d.ts +7 -0
- package/dist/swagger/mounter.d.ts.map +1 -0
- package/dist/swagger/mounter.js +56 -0
- package/dist/swagger/mounter.js.map +1 -0
- package/dist/swagger/types.d.ts +190 -0
- package/dist/swagger/types.d.ts.map +1 -0
- package/dist/swagger/types.js +3 -0
- package/dist/swagger/types.js.map +1 -0
- package/dist/swagger/ui.d.ts +6 -0
- package/dist/swagger/ui.d.ts.map +1 -0
- package/dist/swagger/ui.js +118 -0
- package/dist/swagger/ui.js.map +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/mocks.d.ts.map +1 -1
- package/dist/testing/mocks.js +15 -3
- package/dist/testing/mocks.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +184 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/validator/builder.d.ts +223 -0
- package/dist/validator/builder.d.ts.map +1 -0
- package/dist/validator/builder.js +517 -0
- package/dist/validator/builder.js.map +1 -0
- package/dist/validator/engine.d.ts +19 -0
- package/dist/validator/engine.d.ts.map +1 -0
- package/dist/validator/engine.js +568 -0
- package/dist/validator/engine.js.map +1 -0
- package/dist/validator/error.d.ts +12 -0
- package/dist/validator/error.d.ts.map +1 -0
- package/dist/validator/error.js +63 -0
- package/dist/validator/error.js.map +1 -0
- package/dist/validator/pagination.d.ts +40 -0
- package/dist/validator/pagination.d.ts.map +1 -0
- package/dist/validator/pagination.js +60 -0
- package/dist/validator/pagination.js.map +1 -0
- package/dist/validator/tex-types.d.ts +2 -1
- package/dist/validator/tex-types.d.ts.map +1 -1
- package/dist/validator/tex-types.js +2 -1
- package/dist/validator/tex-types.js.map +1 -1
- package/dist/validator/tex.d.ts +6 -142
- package/dist/validator/tex.d.ts.map +1 -1
- package/dist/validator/tex.js +14 -733
- package/dist/validator/tex.js.map +1 -1
- package/dist/validator/types.d.ts +83 -0
- package/dist/validator/types.d.ts.map +1 -0
- package/dist/validator/types.js +3 -0
- package/dist/validator/types.js.map +1 -0
- package/package.json +8 -4
- package/dist/dev/error-overlay.d.ts +0 -3
- package/dist/dev/error-overlay.d.ts.map +0 -1
- package/dist/dev/error-overlay.js +0 -118
- package/dist/dev/error-overlay.js.map +0 -1
|
@@ -1,46 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockSuspiciousProbes = void 0;
|
|
36
4
|
exports.Use = Use;
|
|
37
5
|
exports.UseGuards = UseGuards;
|
|
38
6
|
exports.UseInterceptors = UseInterceptors;
|
|
39
7
|
exports.UseFilters = UseFilters;
|
|
40
8
|
exports.Idempotent = Idempotent;
|
|
41
9
|
exports.Timeout = Timeout;
|
|
10
|
+
exports.RateLimit = RateLimit;
|
|
11
|
+
exports.Cors = Cors;
|
|
12
|
+
exports.IpFilter = IpFilter;
|
|
13
|
+
exports.Compress = Compress;
|
|
14
|
+
exports.Dedupe = Dedupe;
|
|
15
|
+
exports.BlockProbes = BlockProbes;
|
|
42
16
|
const constants_1 = require("./constants");
|
|
43
17
|
const metadata_1 = require("./core/metadata");
|
|
18
|
+
const rate_limit_1 = require("../middleware/rate-limit");
|
|
19
|
+
const middleware_1 = require("../middleware/middleware");
|
|
20
|
+
const security_1 = require("../middleware/security");
|
|
21
|
+
const ip_filter_1 = require("../middleware/ip-filter");
|
|
22
|
+
const compression_1 = require("../middleware/compression");
|
|
23
|
+
const dedupe_1 = require("../middleware/dedupe");
|
|
24
|
+
const idempotency_1 = require("../middleware/idempotency");
|
|
25
|
+
const security_2 = require("../middleware/security");
|
|
44
26
|
/**
|
|
45
27
|
* Classifies a handler item into middleware, guard, interceptor, or filter.
|
|
46
28
|
*/
|
|
@@ -164,9 +146,45 @@ function UseInterceptors(...interceptors) {
|
|
|
164
146
|
function UseFilters(...filters) {
|
|
165
147
|
return Use(...filters);
|
|
166
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Helper to apply a middleware factory at either class or method level.
|
|
151
|
+
*/
|
|
152
|
+
function applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, middlewareFactory, unshift = false) {
|
|
153
|
+
const isStandard = typeof contextOrPropertyKey === 'object' && contextOrPropertyKey !== null;
|
|
154
|
+
const kind = isStandard ? contextOrPropertyKey.kind : undefined;
|
|
155
|
+
if (kind === 'class' ||
|
|
156
|
+
(!isStandard && typeof target === 'function' && !contextOrPropertyKey)) {
|
|
157
|
+
const proto = target.prototype || target;
|
|
158
|
+
const classMiddlewares = metadata_1.MetadataEngine.init(proto, constants_1.MIDDLEWARE_REGISTRY, { _classMiddlewares: [] });
|
|
159
|
+
if (!classMiddlewares._classMiddlewares) {
|
|
160
|
+
classMiddlewares._classMiddlewares = [];
|
|
161
|
+
}
|
|
162
|
+
if (unshift) {
|
|
163
|
+
classMiddlewares._classMiddlewares.unshift(middlewareFactory);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
classMiddlewares._classMiddlewares.push(middlewareFactory);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
const fn = isStandard
|
|
171
|
+
? target
|
|
172
|
+
: descriptor
|
|
173
|
+
? descriptor.value
|
|
174
|
+
: target[contextOrPropertyKey];
|
|
175
|
+
const methodMiddlewares = metadata_1.MetadataEngine.init(fn, constants_1.METHOD_MIDDLEWARES, []);
|
|
176
|
+
if (unshift) {
|
|
177
|
+
methodMiddlewares.unshift(middlewareFactory);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
methodMiddlewares.push(middlewareFactory);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
167
184
|
/**
|
|
168
185
|
* Idempotency Decorator.
|
|
169
186
|
* Caches responses based on the provided Idempotency-Key header.
|
|
187
|
+
* Works on both Controller classes and individual route methods.
|
|
170
188
|
*
|
|
171
189
|
* Example:
|
|
172
190
|
* @Post('/checkout')
|
|
@@ -174,26 +192,14 @@ function UseFilters(...filters) {
|
|
|
174
192
|
* checkout() {}
|
|
175
193
|
*/
|
|
176
194
|
function Idempotent(options = {}) {
|
|
195
|
+
const handler = (0, idempotency_1.idempotent)(options);
|
|
177
196
|
return function (target, contextOrPropertyKey, descriptor) {
|
|
178
|
-
|
|
179
|
-
const fn = isStandard
|
|
180
|
-
? target
|
|
181
|
-
: descriptor
|
|
182
|
-
? descriptor.value
|
|
183
|
-
: target[contextOrPropertyKey];
|
|
184
|
-
const methodMiddlewares = metadata_1.MetadataEngine.init(fn, constants_1.METHOD_MIDDLEWARES, []);
|
|
185
|
-
// Defer import to avoid circular dependencies
|
|
186
|
-
const middlewareProxy = async (req, res, next) => {
|
|
187
|
-
const { Idempotent: IdempotentMiddleware } = await Promise.resolve().then(() => __importStar(require('../middleware/idempotency')));
|
|
188
|
-
const handler = IdempotentMiddleware(options);
|
|
189
|
-
return handler(req, res, next);
|
|
190
|
-
};
|
|
191
|
-
methodMiddlewares.push(middlewareProxy);
|
|
197
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
192
198
|
};
|
|
193
199
|
}
|
|
194
200
|
/**
|
|
195
|
-
* Route-Level Timeout Decorator.
|
|
196
|
-
* Configures an explicit timeout override for a
|
|
201
|
+
* Route-Level / Controller-Level Timeout Decorator.
|
|
202
|
+
* Configures an explicit timeout override for a route method or entire controller.
|
|
197
203
|
*
|
|
198
204
|
* Example:
|
|
199
205
|
* @Post('/heavy-task')
|
|
@@ -201,20 +207,100 @@ function Idempotent(options = {}) {
|
|
|
201
207
|
* heavyTask() {}
|
|
202
208
|
*/
|
|
203
209
|
function Timeout(msOrOptions) {
|
|
210
|
+
const handler = (0, security_1.routeTimeout)(msOrOptions);
|
|
204
211
|
return function (target, contextOrPropertyKey, descriptor) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler, true);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Rate Limiting Decorator.
|
|
217
|
+
* Enforces request rate limits on a Controller class or route method.
|
|
218
|
+
*
|
|
219
|
+
* Example:
|
|
220
|
+
* @Get('/sensitive-data')
|
|
221
|
+
* @RateLimit({ max: 10, windowMs: 60000 })
|
|
222
|
+
* getSensitiveData() {}
|
|
223
|
+
*/
|
|
224
|
+
function RateLimit(options = {}) {
|
|
225
|
+
const handler = (0, rate_limit_1.rateLimit)(options);
|
|
226
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
227
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* CORS Decorator.
|
|
232
|
+
* Configures Cross-Origin Resource Sharing on a Controller class or route method.
|
|
233
|
+
*
|
|
234
|
+
* Example:
|
|
235
|
+
* @Get('/public-api')
|
|
236
|
+
* @Cors({ origin: '*' })
|
|
237
|
+
* getPublicData() {}
|
|
238
|
+
*/
|
|
239
|
+
function Cors(options = {}) {
|
|
240
|
+
const handler = (0, middleware_1.cors)(options);
|
|
241
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
242
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler, true);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* IP Filter Decorator.
|
|
247
|
+
* Enforces IP/CIDR allowlist and denylist on a Controller class or route method.
|
|
248
|
+
*
|
|
249
|
+
* Example:
|
|
250
|
+
* @Controller('/admin')
|
|
251
|
+
* @IpFilter({ allow: ['127.0.0.1', '10.0.0.0/8'] })
|
|
252
|
+
* export class AdminController {}
|
|
253
|
+
*/
|
|
254
|
+
function IpFilter(options) {
|
|
255
|
+
const handler = (0, ip_filter_1.ipFilter)(options);
|
|
256
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
257
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Compression Decorator.
|
|
262
|
+
* Enables automatic gzip/brotli response compression on a Controller class or route method.
|
|
263
|
+
*
|
|
264
|
+
* Example:
|
|
265
|
+
* @Get('/large-dataset')
|
|
266
|
+
* @Compress()
|
|
267
|
+
* getDataset() {}
|
|
268
|
+
*/
|
|
269
|
+
function Compress() {
|
|
270
|
+
const handler = (0, compression_1.compression)();
|
|
271
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
272
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Request Deduplication Decorator.
|
|
277
|
+
* Prevents duplicate parallel requests sharing the same key.
|
|
278
|
+
*
|
|
279
|
+
* Example:
|
|
280
|
+
* @Post('/order/charge')
|
|
281
|
+
* @Dedupe({ keyGenerator: (req) => req.user?.id || req.ip })
|
|
282
|
+
* chargeOrder() {}
|
|
283
|
+
*/
|
|
284
|
+
function Dedupe(options) {
|
|
285
|
+
const handler = (0, dedupe_1.dedupeMiddleware)(options);
|
|
286
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
287
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Security Scanner Noise Suppression & Blackhole Decorator.
|
|
292
|
+
* Intercepts exploit probes (`.env`, `/.git`, `/.DS_Store`) and blackholes them.
|
|
293
|
+
*
|
|
294
|
+
* Example:
|
|
295
|
+
* @Controller('/api')
|
|
296
|
+
* @BlockProbes({ statusCode: 404, silent: true })
|
|
297
|
+
* export default class ApiController {}
|
|
298
|
+
*/
|
|
299
|
+
function BlockProbes(options) {
|
|
300
|
+
const handler = (0, security_2.blockSuspiciousProbes)(options);
|
|
301
|
+
return function (target, contextOrPropertyKey, descriptor) {
|
|
302
|
+
applyMiddlewareDecorator(target, contextOrPropertyKey, descriptor, handler);
|
|
218
303
|
};
|
|
219
304
|
}
|
|
305
|
+
exports.BlockSuspiciousProbes = BlockProbes;
|
|
220
306
|
//# sourceMappingURL=middleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/decorators/middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/decorators/middleware.ts"],"names":[],"mappings":";;;AA0DA,kBAsFC;AAKD,8BAEC;AAKD,0CAEC;AAKD,gCAEC;AA+DD,gCAWC;AAWD,0BAiBC;AAWD,8BAWC;AAWD,oBAeC;AAWD,4BAWC;AAWD,4BASC;AAWD,wBAWC;AAWD,kCASC;AA/YD,2CAIoB;AACpB,8CAAgD;AAChD,yDAAoD;AACpD,yDAA+C;AAC/C,qDAAqD;AACrD,uDAAkD;AAClD,2DAAuD;AACvD,iDAAuD;AACvD,2DAA8E;AAC9E,qDAG+B;AAE/B;;GAEG;AACH,SAAS,YAAY,CACnB,IAAS;IAET,IAAI,CAAC,IAAI;QAAE,OAAO,YAAY,CAAA;IAE9B,sCAAsC;IACtC,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;IAEhE,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU;YAAE,OAAO,OAAO,CAAA;QAC3D,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,UAAU;YAAE,OAAO,aAAa,CAAA;QAC/D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;YAAE,OAAO,QAAQ,CAAA;IACxD,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU;YAAE,OAAO,OAAO,CAAA;QAC1D,IAAI,OAA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BAA4C,EAC5C,UAAqC;QAErC,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC7E,CAAC,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,MAAM,CACpB,OAAqD;IAErD,MAAM,OAAO,GAAG,IAAA,yBAAgB,EAAC,OAAO,CAAC,CAAA;IACzC,OAAO,UACL,MAAW,EACX,oBAA4C,EAC5C,UAAqC;QAErC,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC7E,CAAC,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACtD,MAAM,OAAO,GAAG,IAAA,gCAAqB,EAAC,OAAO,CAAC,CAAA;IAC9C,OAAO,UACL,MAAW,EACX,oBAA4C,EAC5C,UAAqC;QAErC,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC7E,CAAC,CAAA;AACH,CAAC;AAEY,QAAA,qBAAqB,GAAG,WAAW,CAAA"}
|
|
@@ -15,7 +15,10 @@ export type CustomParamFactory<TData = any, TResult = any> = (data: TData, ctx:
|
|
|
15
15
|
/**
|
|
16
16
|
* Creates a custom route parameter decorator.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* @param factory Function extracting custom data from request context
|
|
19
|
+
* @returns Parameter decorator
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
19
22
|
* ```ts
|
|
20
23
|
* export const CurrentUser = createParamDecorator(
|
|
21
24
|
* (data: string | undefined, ctx) => {
|
|
@@ -31,30 +34,127 @@ export type CustomParamFactory<TData = any, TResult = any> = (data: TData, ctx:
|
|
|
31
34
|
*/
|
|
32
35
|
export declare function createParamDecorator<TData = any>(factory: CustomParamFactory<TData>): (data?: TData, ...pipes: any[]) => ParameterDecorator;
|
|
33
36
|
export declare function createParamDecorator(type: string, nameOrPipe?: string | any, ...pipes: any[]): ParameterDecorator;
|
|
37
|
+
/**
|
|
38
|
+
* Injects a route parameter from the URL path (e.g. `:id`).
|
|
39
|
+
*
|
|
40
|
+
* @param name Parameter name matching the route path placeholder
|
|
41
|
+
* @param pipes Optional validation pipes
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* @Get('/:id')
|
|
46
|
+
* getUser(@Param('id') id: string) {
|
|
47
|
+
* return { id }
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
34
51
|
export declare const Param: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
52
|
+
/**
|
|
53
|
+
* Injects the parsed request body into a controller method argument.
|
|
54
|
+
*
|
|
55
|
+
* @param nameOrPipe Optional body property key or validation pipe/schema
|
|
56
|
+
* @param pipes Optional transformation pipes
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* @Post('/')
|
|
61
|
+
* createUser(@Body() body: CreateUserDto) {
|
|
62
|
+
* return body
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
35
66
|
export declare const Body: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
67
|
+
/**
|
|
68
|
+
* Injects request headers or a specific header value.
|
|
69
|
+
*
|
|
70
|
+
* @param name Optional header name (case-insensitive)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* @Get('/')
|
|
75
|
+
* getInfo(@Headers('authorization') auth: string) {}
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
36
78
|
export declare const Headers: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
37
79
|
export declare const HostParam: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
80
|
+
/**
|
|
81
|
+
* Injects the ExisJS request instance (`ExisRequest`).
|
|
82
|
+
*/
|
|
38
83
|
export declare const Req: () => ParameterDecorator;
|
|
39
84
|
export declare const Socket: () => ParameterDecorator;
|
|
40
85
|
export declare const Stream: () => ParameterDecorator;
|
|
86
|
+
/**
|
|
87
|
+
* Injects the active session object if session middleware is enabled.
|
|
88
|
+
*/
|
|
41
89
|
export declare const Session: () => ParameterDecorator;
|
|
42
90
|
export declare const Next: () => ParameterDecorator;
|
|
91
|
+
/**
|
|
92
|
+
* Injects the client's IP address.
|
|
93
|
+
*/
|
|
43
94
|
export declare const Ip: () => ParameterDecorator;
|
|
95
|
+
/**
|
|
96
|
+
* Injects an uploaded file from multipart form data.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* @Post('/avatar')
|
|
101
|
+
* @Upload()
|
|
102
|
+
* uploadAvatar(@UploadedFile() file: ExisFile) {
|
|
103
|
+
* return { filename: file.filename, size: file.size }
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
44
107
|
export declare const UploadedFile: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
108
|
+
/**
|
|
109
|
+
* Injects all uploaded files from multipart form data.
|
|
110
|
+
*/
|
|
45
111
|
export declare const UploadedFiles: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
112
|
+
/**
|
|
113
|
+
* Injects all parsed request cookies as a key-value record.
|
|
114
|
+
*/
|
|
115
|
+
export declare const Cookies: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
116
|
+
/**
|
|
117
|
+
* Injects a specific cookie by name.
|
|
118
|
+
*/
|
|
119
|
+
export declare const Cookie: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
120
|
+
/**
|
|
121
|
+
* Injects custom execution state from AsyncLocalStorage context.
|
|
122
|
+
*/
|
|
123
|
+
export declare const State: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
124
|
+
/**
|
|
125
|
+
* Injects the ExisJS App application instance.
|
|
126
|
+
*/
|
|
127
|
+
export declare const AppCtx: () => ParameterDecorator;
|
|
128
|
+
export declare const Fields: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
129
|
+
/**
|
|
130
|
+
* Injects the ExisJS response instance (`ExisResponse`).
|
|
131
|
+
* By default, injecting `@Res()` switches the handler into manual response mode unless `{ passthrough: true }` is specified.
|
|
132
|
+
*
|
|
133
|
+
* @param options Pass `{ passthrough: true }` to allow returning values from handler while retaining response object access
|
|
134
|
+
*/
|
|
46
135
|
export declare const Res: (options?: {
|
|
47
136
|
passthrough?: boolean;
|
|
48
137
|
}) => any;
|
|
49
138
|
/**
|
|
50
139
|
* Injects a query parameter from the URL query string.
|
|
51
140
|
*
|
|
52
|
-
*
|
|
141
|
+
* @example
|
|
53
142
|
* ```ts
|
|
54
143
|
* @Get('/search')
|
|
55
144
|
* search(@QueryParam('q') q: string) { return { q }; }
|
|
56
145
|
* ```
|
|
57
146
|
*/
|
|
58
147
|
export declare const QueryParam: (nameOrPipe?: string | any, ...pipes: any[]) => ParameterDecorator;
|
|
148
|
+
/**
|
|
149
|
+
* Injects query parameters from the URL query string, or defines a QUERY HTTP route.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* @Get('/search')
|
|
154
|
+
* search(@Query('q') query: string) {
|
|
155
|
+
* return { query }
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
59
159
|
export declare function Query(pathOrName?: string | any, schemaOrPipe?: RouteSchema<any, any, any, any> | any, ...pipes: any[]): any;
|
|
60
160
|
//# sourceMappingURL=params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/decorators/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":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AAW,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,GAazD,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,GAAG,EAAE,uBAChB,CAAA;AAErD;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CACnB,UAAU,CAAC,EAAE,MAAM,GAAG,GAAG,EACzB,YAAY,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,EACpD,GAAG,KAAK,EAAE,GAAG,EAAE,GACd,GAAG,CAwCL"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueryParam = exports.Res = exports.UploadedFiles = exports.UploadedFile = exports.Ip = exports.Next = exports.Session = exports.Stream = exports.Socket = exports.Req = exports.HostParam = exports.Headers = exports.Body = exports.Param = void 0;
|
|
3
|
+
exports.QueryParam = exports.Res = exports.Fields = exports.AppCtx = exports.State = exports.Cookie = exports.Cookies = exports.UploadedFiles = exports.UploadedFile = exports.Ip = exports.Next = exports.Session = exports.Stream = exports.Socket = exports.Req = exports.HostParam = exports.Headers = exports.Body = exports.Param = void 0;
|
|
4
4
|
exports.createParamDecorator = createParamDecorator;
|
|
5
5
|
exports.Query = Query;
|
|
6
6
|
const constants_1 = require("./constants");
|
|
7
7
|
const metadata_1 = require("./core/metadata");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
8
9
|
function createParamDecorator(typeOrFactory, nameOrPipe, ...pipes) {
|
|
9
10
|
if (typeof typeOrFactory === 'function') {
|
|
10
11
|
const factory = typeOrFactory;
|
|
@@ -39,9 +40,36 @@ function createParamDecorator(typeOrFactory, nameOrPipe, ...pipes) {
|
|
|
39
40
|
paramMeta[parameterIndex] = { type, name, pipes: allPipes };
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Injects a route parameter from the URL path (e.g. `:id`).
|
|
45
|
+
*
|
|
46
|
+
* @param name Parameter name matching the route path placeholder
|
|
47
|
+
* @param pipes Optional validation pipes
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* @Get('/:id')
|
|
52
|
+
* getUser(@Param('id') id: string) {
|
|
53
|
+
* return { id }
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
43
57
|
const Param = (nameOrPipe, ...pipes) => createParamDecorator('param', nameOrPipe, ...pipes);
|
|
44
58
|
exports.Param = Param;
|
|
59
|
+
/**
|
|
60
|
+
* Injects the parsed request body into a controller method argument.
|
|
61
|
+
*
|
|
62
|
+
* @param nameOrPipe Optional body property key or validation pipe/schema
|
|
63
|
+
* @param pipes Optional transformation pipes
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* @Post('/')
|
|
68
|
+
* createUser(@Body() body: CreateUserDto) {
|
|
69
|
+
* return body
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
45
73
|
const Body = (nameOrPipe, ...pipes) => {
|
|
46
74
|
if (nameOrPipe === undefined && pipes.length === 0) {
|
|
47
75
|
logger_1.logger.warn(`@Body() decorator used without a validation schema or pipe. It is highly recommended to validate incoming payloads.`);
|
|
@@ -49,26 +77,89 @@ const Body = (nameOrPipe, ...pipes) => {
|
|
|
49
77
|
return createParamDecorator('body', nameOrPipe, ...pipes);
|
|
50
78
|
};
|
|
51
79
|
exports.Body = Body;
|
|
80
|
+
/**
|
|
81
|
+
* Injects request headers or a specific header value.
|
|
82
|
+
*
|
|
83
|
+
* @param name Optional header name (case-insensitive)
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* @Get('/')
|
|
88
|
+
* getInfo(@Headers('authorization') auth: string) {}
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
52
91
|
const Headers = (nameOrPipe, ...pipes) => createParamDecorator('header', nameOrPipe, ...pipes);
|
|
53
92
|
exports.Headers = Headers;
|
|
54
93
|
const HostParam = (nameOrPipe, ...pipes) => createParamDecorator('host', nameOrPipe, ...pipes);
|
|
55
94
|
exports.HostParam = HostParam;
|
|
95
|
+
/**
|
|
96
|
+
* Injects the ExisJS request instance (`ExisRequest`).
|
|
97
|
+
*/
|
|
56
98
|
const Req = () => createParamDecorator('req');
|
|
57
99
|
exports.Req = Req;
|
|
58
100
|
const Socket = () => createParamDecorator('socket');
|
|
59
101
|
exports.Socket = Socket;
|
|
60
102
|
const Stream = () => createParamDecorator('stream');
|
|
61
103
|
exports.Stream = Stream;
|
|
104
|
+
/**
|
|
105
|
+
* Injects the active session object if session middleware is enabled.
|
|
106
|
+
*/
|
|
62
107
|
const Session = () => createParamDecorator('session');
|
|
63
108
|
exports.Session = Session;
|
|
64
109
|
const Next = () => createParamDecorator('next');
|
|
65
110
|
exports.Next = Next;
|
|
111
|
+
/**
|
|
112
|
+
* Injects the client's IP address.
|
|
113
|
+
*/
|
|
66
114
|
const Ip = () => createParamDecorator('ip');
|
|
67
115
|
exports.Ip = Ip;
|
|
116
|
+
/**
|
|
117
|
+
* Injects an uploaded file from multipart form data.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* @Post('/avatar')
|
|
122
|
+
* @Upload()
|
|
123
|
+
* uploadAvatar(@UploadedFile() file: ExisFile) {
|
|
124
|
+
* return { filename: file.filename, size: file.size }
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
68
128
|
const UploadedFile = (nameOrPipe, ...pipes) => createParamDecorator('uploadedFile', nameOrPipe, ...pipes);
|
|
69
129
|
exports.UploadedFile = UploadedFile;
|
|
130
|
+
/**
|
|
131
|
+
* Injects all uploaded files from multipart form data.
|
|
132
|
+
*/
|
|
70
133
|
const UploadedFiles = (nameOrPipe, ...pipes) => createParamDecorator('uploadedFiles', nameOrPipe, ...pipes);
|
|
71
134
|
exports.UploadedFiles = UploadedFiles;
|
|
135
|
+
/**
|
|
136
|
+
* Injects all parsed request cookies as a key-value record.
|
|
137
|
+
*/
|
|
138
|
+
const Cookies = (nameOrPipe, ...pipes) => createParamDecorator('cookies', nameOrPipe, ...pipes);
|
|
139
|
+
exports.Cookies = Cookies;
|
|
140
|
+
/**
|
|
141
|
+
* Injects a specific cookie by name.
|
|
142
|
+
*/
|
|
143
|
+
const Cookie = (nameOrPipe, ...pipes) => createParamDecorator('cookie', nameOrPipe, ...pipes);
|
|
144
|
+
exports.Cookie = Cookie;
|
|
145
|
+
/**
|
|
146
|
+
* Injects custom execution state from AsyncLocalStorage context.
|
|
147
|
+
*/
|
|
148
|
+
const State = (nameOrPipe, ...pipes) => createParamDecorator('state', nameOrPipe, ...pipes);
|
|
149
|
+
exports.State = State;
|
|
150
|
+
/**
|
|
151
|
+
* Injects the ExisJS App application instance.
|
|
152
|
+
*/
|
|
153
|
+
const AppCtx = () => createParamDecorator('app');
|
|
154
|
+
exports.AppCtx = AppCtx;
|
|
155
|
+
const Fields = (nameOrPipe, ...pipes) => createParamDecorator('fields', nameOrPipe, ...pipes);
|
|
156
|
+
exports.Fields = Fields;
|
|
157
|
+
/**
|
|
158
|
+
* Injects the ExisJS response instance (`ExisResponse`).
|
|
159
|
+
* By default, injecting `@Res()` switches the handler into manual response mode unless `{ passthrough: true }` is specified.
|
|
160
|
+
*
|
|
161
|
+
* @param options Pass `{ passthrough: true }` to allow returning values from handler while retaining response object access
|
|
162
|
+
*/
|
|
72
163
|
const Res = (options) => {
|
|
73
164
|
return function (target, propertyKey, parameterIndex) {
|
|
74
165
|
const fn = target[propertyKey];
|
|
@@ -82,7 +173,7 @@ exports.Res = Res;
|
|
|
82
173
|
/**
|
|
83
174
|
* Injects a query parameter from the URL query string.
|
|
84
175
|
*
|
|
85
|
-
*
|
|
176
|
+
* @example
|
|
86
177
|
* ```ts
|
|
87
178
|
* @Get('/search')
|
|
88
179
|
* search(@QueryParam('q') q: string) { return { q }; }
|
|
@@ -90,6 +181,17 @@ exports.Res = Res;
|
|
|
90
181
|
*/
|
|
91
182
|
const QueryParam = (nameOrPipe, ...pipes) => createParamDecorator('query', nameOrPipe, ...pipes);
|
|
92
183
|
exports.QueryParam = QueryParam;
|
|
184
|
+
/**
|
|
185
|
+
* Injects query parameters from the URL query string, or defines a QUERY HTTP route.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* @Get('/search')
|
|
190
|
+
* search(@Query('q') query: string) {
|
|
191
|
+
* return { query }
|
|
192
|
+
* }
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
93
195
|
function Query(pathOrName, schemaOrPipe, ...pipes) {
|
|
94
196
|
return function (target, contextOrPropertyKey, descriptorOrIndex) {
|
|
95
197
|
const isParam = typeof descriptorOrIndex === 'number' ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/decorators/params.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/decorators/params.ts"],"names":[],"mappings":";;;AAwDA,oDAsDC;AA0KD,sBA4CC;AAnUD,2CAKoB;AACpB,8CAAgD;AAChD,sCAAkC;AAgDlC,SAAgB,oBAAoB,CAClC,aAA+C,EAC/C,UAAyB,EACzB,GAAG,KAAY;IAEf,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAA;QAC7B,OAAO,UAAU,UAAgB,EAAE,GAAG,WAAkB;YACtD,OAAO,UACL,MAAW,EACX,WAA4B,EAC5B,cAAsB;gBAEtB,MAAM,MAAM,GACV,OAAO,UAAU,KAAK,UAAU;oBAChC,CAAC,OAAO,UAAU,KAAK,QAAQ;wBAC7B,UAAU,KAAK,IAAI;wBACnB,CAAC,OAAO,U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B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,CAcvD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,GAClD,GAAG,CAaL;AAED,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,mBAAgB,KAAG,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/decorators/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG3C;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAa1C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,CAcvD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,GAClD,GAAG,CAaL;AAED,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,mBAAgB,KAAG,GAexD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,GAAG,aAAa,MAAM,EAAE,KAAG,GAmBtD,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,GAAG,OAAO,MAAM,EAAE,KAAG,GAkB1C,CAAA"}
|