listpage-next-nest 0.0.25 → 0.0.26
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/cjs/index.cjs +24 -16
- package/dist/cjs/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -24,20 +24,21 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
BaseQueryDto: ()=>BaseQueryDto,
|
|
28
|
-
HttpExceptionFilter: ()=>HttpExceptionFilter,
|
|
29
27
|
RequestContextMiddleware: ()=>RequestContextMiddleware,
|
|
30
|
-
setup: ()=>setup,
|
|
31
28
|
StaticRouteMiddleware: ()=>StaticRouteMiddleware,
|
|
32
29
|
PaginationData: ()=>PaginationData,
|
|
33
|
-
|
|
34
|
-
RequestContextService: ()=>RequestContextService,
|
|
30
|
+
StaticRouteMiddlewareFactory: ()=>StaticRouteMiddlewareFactory,
|
|
35
31
|
RequestIdMiddleware: ()=>RequestIdMiddleware,
|
|
36
32
|
LoggingInterceptor: ()=>LoggingInterceptor,
|
|
37
|
-
ResponseInterceptor: ()=>ResponseInterceptor,
|
|
38
33
|
StaticRouteModule: ()=>StaticRouteModule,
|
|
34
|
+
ResponseInterceptor: ()=>ResponseInterceptor,
|
|
39
35
|
CorsInterceptor: ()=>CorsInterceptor,
|
|
40
|
-
|
|
36
|
+
BaseQueryDto: ()=>BaseQueryDto,
|
|
37
|
+
ApiResponse: ()=>ApiResponse,
|
|
38
|
+
HttpExceptionFilter: ()=>HttpExceptionFilter,
|
|
39
|
+
PaginatedResponse: ()=>PaginatedResponse,
|
|
40
|
+
RequestContextService: ()=>RequestContextService,
|
|
41
|
+
setup: ()=>setup
|
|
41
42
|
});
|
|
42
43
|
const common_namespaceObject = require("@nestjs/common");
|
|
43
44
|
const external_async_hooks_namespaceObject = require("async_hooks");
|
|
@@ -386,7 +387,19 @@ function static_route_middleware_ts_metadata(k, v) {
|
|
|
386
387
|
}
|
|
387
388
|
class StaticRouteMiddleware {
|
|
388
389
|
use(req, res, next) {
|
|
389
|
-
|
|
390
|
+
return StaticRouteMiddlewareFactory(this.options)(req, res, next);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
static_route_middleware_ts_decorate([
|
|
394
|
+
(0, common_namespaceObject.Inject)(STATIC_ROUTE_OPTIONS),
|
|
395
|
+
static_route_middleware_ts_metadata("design:type", "undefined" == typeof StaticRouteOptions ? Object : StaticRouteOptions)
|
|
396
|
+
], StaticRouteMiddleware.prototype, "options", void 0);
|
|
397
|
+
StaticRouteMiddleware = static_route_middleware_ts_decorate([
|
|
398
|
+
(0, common_namespaceObject.Injectable)()
|
|
399
|
+
], StaticRouteMiddleware);
|
|
400
|
+
function StaticRouteMiddlewareFactory(options) {
|
|
401
|
+
return function(req, res, next) {
|
|
402
|
+
const { rootDir, routeMappings } = options;
|
|
390
403
|
if (external_path_namespaceObject.extname(req.path)) {
|
|
391
404
|
const filePath = external_path_namespaceObject.join(this.options.rootDir, req.path);
|
|
392
405
|
if (!(0, external_fs_namespaceObject.existsSync)(filePath)) next(new common_namespaceObject.NotFoundException(`File not found: ${req.path}`));
|
|
@@ -402,15 +415,8 @@ class StaticRouteMiddleware {
|
|
|
402
415
|
});
|
|
403
416
|
}
|
|
404
417
|
return next();
|
|
405
|
-
}
|
|
418
|
+
};
|
|
406
419
|
}
|
|
407
|
-
static_route_middleware_ts_decorate([
|
|
408
|
-
(0, common_namespaceObject.Inject)(STATIC_ROUTE_OPTIONS),
|
|
409
|
-
static_route_middleware_ts_metadata("design:type", "undefined" == typeof StaticRouteOptions ? Object : StaticRouteOptions)
|
|
410
|
-
], StaticRouteMiddleware.prototype, "options", void 0);
|
|
411
|
-
StaticRouteMiddleware = static_route_middleware_ts_decorate([
|
|
412
|
-
(0, common_namespaceObject.Injectable)()
|
|
413
|
-
], StaticRouteMiddleware);
|
|
414
420
|
function static_route_module_ts_decorate(decorators, target, key, desc) {
|
|
415
421
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
416
422
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -477,6 +483,7 @@ exports.RequestContextService = __webpack_exports__.RequestContextService;
|
|
|
477
483
|
exports.RequestIdMiddleware = __webpack_exports__.RequestIdMiddleware;
|
|
478
484
|
exports.ResponseInterceptor = __webpack_exports__.ResponseInterceptor;
|
|
479
485
|
exports.StaticRouteMiddleware = __webpack_exports__.StaticRouteMiddleware;
|
|
486
|
+
exports.StaticRouteMiddlewareFactory = __webpack_exports__.StaticRouteMiddlewareFactory;
|
|
480
487
|
exports.StaticRouteModule = __webpack_exports__.StaticRouteModule;
|
|
481
488
|
exports.setup = __webpack_exports__.setup;
|
|
482
489
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -492,6 +499,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
492
499
|
"RequestIdMiddleware",
|
|
493
500
|
"ResponseInterceptor",
|
|
494
501
|
"StaticRouteMiddleware",
|
|
502
|
+
"StaticRouteMiddlewareFactory",
|
|
495
503
|
"StaticRouteModule",
|
|
496
504
|
"setup"
|
|
497
505
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -117,6 +117,8 @@ export declare class StaticRouteMiddleware implements NestMiddleware {
|
|
|
117
117
|
use(req: Request_2, res: Response_2, next: NextFunction): void;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
export declare function StaticRouteMiddlewareFactory(options: StaticRouteOptions): (req: Request_2, res: Response_2, next: NextFunction) => void;
|
|
121
|
+
|
|
120
122
|
export declare class StaticRouteModule {
|
|
121
123
|
static routes: string;
|
|
122
124
|
static forRoot(options: StaticRouteOptions): DynamicModule;
|