@lerianstudio/sindarian-server 1.0.0-beta.9 → 1.1.0
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/README.md +268 -21
- package/dist/constants/keys.d.ts +3 -0
- package/dist/constants/keys.d.ts.map +1 -1
- package/dist/constants/keys.js +4 -1
- package/dist/constants/keys.js.map +1 -1
- package/dist/controllers/decorators/body-decorator.d.ts +12 -16
- package/dist/controllers/decorators/body-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/body-decorator.js +52 -58
- package/dist/controllers/decorators/body-decorator.js.map +1 -1
- package/dist/controllers/decorators/controller-decorator.d.ts +5 -4
- package/dist/controllers/decorators/controller-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/controller-decorator.js +29 -22
- package/dist/controllers/decorators/controller-decorator.js.map +1 -1
- package/dist/controllers/decorators/param-decorator.d.ts +4 -9
- package/dist/controllers/decorators/param-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/param-decorator.js +33 -29
- package/dist/controllers/decorators/param-decorator.js.map +1 -1
- package/dist/controllers/decorators/query-decorator.d.ts +11 -15
- package/dist/controllers/decorators/query-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/query-decorator.js +24 -38
- package/dist/controllers/decorators/query-decorator.js.map +1 -1
- package/dist/controllers/decorators/request-decorator.d.ts +8 -12
- package/dist/controllers/decorators/request-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/request-decorator.js +21 -17
- package/dist/controllers/decorators/request-decorator.js.map +1 -1
- package/dist/controllers/decorators/route-decorator.d.ts +16 -1
- package/dist/controllers/decorators/route-decorator.d.ts.map +1 -1
- package/dist/controllers/decorators/route-decorator.js +31 -16
- package/dist/controllers/decorators/route-decorator.js.map +1 -1
- package/dist/dependency-injection/container.d.ts +4 -3
- package/dist/dependency-injection/container.d.ts.map +1 -1
- package/dist/dependency-injection/container.js +14 -3
- package/dist/dependency-injection/container.js.map +1 -1
- package/dist/dependency-injection/injectable-decorator.d.ts +5 -0
- package/dist/dependency-injection/injectable-decorator.d.ts.map +1 -1
- package/dist/dependency-injection/injectable-decorator.js +9 -0
- package/dist/dependency-injection/injectable-decorator.js.map +1 -1
- package/dist/exceptions/api-exception.d.ts +4 -7
- package/dist/exceptions/api-exception.d.ts.map +1 -1
- package/dist/exceptions/api-exception.js +8 -4
- package/dist/exceptions/api-exception.js.map +1 -1
- package/dist/exceptions/base-exception-filter.d.ts.map +1 -1
- package/dist/exceptions/base-exception-filter.js +10 -3
- package/dist/exceptions/base-exception-filter.js.map +1 -1
- package/dist/exceptions/decorators/use-filters-decorator.d.ts +12 -1
- package/dist/exceptions/decorators/use-filters-decorator.d.ts.map +1 -1
- package/dist/exceptions/decorators/use-filters-decorator.js +34 -3
- package/dist/exceptions/decorators/use-filters-decorator.js.map +1 -1
- package/dist/guards/can-activate.d.ts +21 -0
- package/dist/guards/can-activate.d.ts.map +1 -0
- package/dist/guards/can-activate.js +3 -0
- package/dist/guards/can-activate.js.map +1 -0
- package/dist/guards/decorators/index.d.ts +2 -0
- package/dist/guards/decorators/index.d.ts.map +1 -0
- package/dist/guards/decorators/index.js +18 -0
- package/dist/guards/decorators/index.js.map +1 -0
- package/dist/guards/decorators/use-guards-decorator.d.ts +44 -0
- package/dist/guards/decorators/use-guards-decorator.d.ts.map +1 -0
- package/dist/guards/decorators/use-guards-decorator.js +127 -0
- package/dist/guards/decorators/use-guards-decorator.js.map +1 -0
- package/dist/guards/index.d.ts +3 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +19 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptor/decorators/use-interceptor-decorator.d.ts +10 -3
- package/dist/interceptor/decorators/use-interceptor-decorator.d.ts.map +1 -1
- package/dist/interceptor/decorators/use-interceptor-decorator.js +52 -22
- package/dist/interceptor/decorators/use-interceptor-decorator.js.map +1 -1
- package/dist/logger/console-logger.d.ts.map +1 -1
- package/dist/logger/console-logger.js +6 -0
- package/dist/logger/console-logger.js.map +1 -1
- package/dist/middleware/index.d.ts +3 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +19 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/middleware-handler.d.ts +6 -0
- package/dist/middleware/middleware-handler.d.ts.map +1 -0
- package/dist/middleware/middleware-handler.js +19 -0
- package/dist/middleware/middleware-handler.js.map +1 -0
- package/dist/middleware/middleware.d.ts +6 -0
- package/dist/middleware/middleware.d.ts.map +1 -0
- package/dist/middleware/middleware.js +7 -0
- package/dist/middleware/middleware.js.map +1 -0
- package/dist/modules/module-decorator.d.ts +2 -2
- package/dist/modules/module-decorator.d.ts.map +1 -1
- package/dist/modules/module-decorator.js +34 -14
- package/dist/modules/module-decorator.js.map +1 -1
- package/dist/pipes/decorators/index.d.ts +2 -0
- package/dist/pipes/decorators/index.d.ts.map +1 -0
- package/dist/pipes/decorators/index.js +6 -0
- package/dist/pipes/decorators/index.js.map +1 -0
- package/dist/pipes/decorators/use-pipes.d.ts +19 -0
- package/dist/pipes/decorators/use-pipes.d.ts.map +1 -0
- package/dist/pipes/decorators/use-pipes.js +118 -0
- package/dist/pipes/decorators/use-pipes.js.map +1 -0
- package/dist/pipes/index.d.ts +3 -0
- package/dist/pipes/index.d.ts.map +1 -0
- package/dist/pipes/index.js +18 -0
- package/dist/pipes/index.js.map +1 -0
- package/dist/pipes/pipe-transform.d.ts +46 -0
- package/dist/pipes/pipe-transform.d.ts.map +1 -0
- package/dist/pipes/pipe-transform.js +3 -0
- package/dist/pipes/pipe-transform.js.map +1 -0
- package/dist/server/server-factory.d.ts +48 -1
- package/dist/server/server-factory.d.ts.map +1 -1
- package/dist/server/server-factory.js +169 -34
- package/dist/server/server-factory.js.map +1 -1
- package/dist/services/guards.d.ts +2 -0
- package/dist/services/guards.d.ts.map +1 -0
- package/dist/services/guards.js +5 -0
- package/dist/services/guards.js.map +1 -0
- package/dist/services/middleware.d.ts +2 -0
- package/dist/services/middleware.d.ts.map +1 -0
- package/dist/services/middleware.js +5 -0
- package/dist/services/middleware.js.map +1 -0
- package/dist/services/pipes.d.ts +2 -0
- package/dist/services/pipes.d.ts.map +1 -0
- package/dist/services/pipes.js +5 -0
- package/dist/services/pipes.js.map +1 -0
- package/dist/utils/routes/route-specificity.d.ts +40 -0
- package/dist/utils/routes/route-specificity.d.ts.map +1 -0
- package/dist/utils/routes/route-specificity.js +89 -0
- package/dist/utils/routes/route-specificity.js.map +1 -0
- package/dist/utils/url/url-match.d.ts.map +1 -1
- package/dist/utils/url/url-match.js +16 -2
- package/dist/utils/url/url-match.js.map +1 -1
- package/dist/zod/create-zod-dto.d.ts +16 -0
- package/dist/zod/create-zod-dto.d.ts.map +1 -0
- package/dist/zod/create-zod-dto.js +14 -0
- package/dist/zod/create-zod-dto.js.map +1 -0
- package/dist/zod/index.d.ts +3 -0
- package/dist/zod/index.d.ts.map +1 -0
- package/dist/zod/index.js +8 -0
- package/dist/zod/index.js.map +1 -0
- package/dist/zod/zod-validation-pipe.d.ts +5 -0
- package/dist/zod/zod-validation-pipe.d.ts.map +1 -0
- package/dist/zod/zod-validation-pipe.js +35 -0
- package/dist/zod/zod-validation-pipe.js.map +1 -0
- package/package.json +6 -3
|
@@ -9,7 +9,9 @@ const inversify_1 = require("inversify");
|
|
|
9
9
|
class Container {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.loadedModules = new Set();
|
|
12
|
-
this.container = new inversify_1.Container(
|
|
12
|
+
this.container = new inversify_1.Container({
|
|
13
|
+
defaultScope: 'Singleton'
|
|
14
|
+
});
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Loads a module into the container.
|
|
@@ -31,12 +33,21 @@ class Container {
|
|
|
31
33
|
bind(serviceIdentifier) {
|
|
32
34
|
return this.container.bind(serviceIdentifier);
|
|
33
35
|
}
|
|
34
|
-
get(serviceIdentifier) {
|
|
36
|
+
get(serviceIdentifier, options) {
|
|
37
|
+
if (options !== undefined) {
|
|
38
|
+
return this.container.get(serviceIdentifier, options);
|
|
39
|
+
}
|
|
35
40
|
return this.container.get(serviceIdentifier);
|
|
36
41
|
}
|
|
37
|
-
getAsync(serviceIdentifier) {
|
|
42
|
+
getAsync(serviceIdentifier, options) {
|
|
43
|
+
if (options !== undefined) {
|
|
44
|
+
return this.container.getAsync(serviceIdentifier, options);
|
|
45
|
+
}
|
|
38
46
|
return this.container.getAsync(serviceIdentifier);
|
|
39
47
|
}
|
|
48
|
+
getAllAsync(serviceIdentifier, options) {
|
|
49
|
+
return this.container.getAllAsync(serviceIdentifier, options);
|
|
50
|
+
}
|
|
40
51
|
isBound(serviceIdentifier) {
|
|
41
52
|
return this.container.isBound(serviceIdentifier);
|
|
42
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/dependency-injection/container.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/dependency-injection/container.ts"],"names":[],"mappings":";;;AAAA,yCAOkB;AAElB;;;GAGG;AACH,MAAa,SAAS;IAIpB;QAFQ,kBAAa,GAAyB,IAAI,GAAG,EAAE,CAAA;QAGrD,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAkB,CAAC;YACtC,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,MAAuB;QAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CACb,qBAAqB,MAAM,kCAAkC,CAC9D,CAAA;QACH,CAAC;QAED,wDAAwD;QACxD,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;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AAC;CACF;AAND,0CAMC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Scope } from '../constants/scopes';
|
|
2
2
|
export declare function injectableHandler(target: Function): any;
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves the original class name stored at decorator-evaluation time.
|
|
5
|
+
* Falls back to constructor.name if no metadata is found (e.g. non-decorated classes).
|
|
6
|
+
*/
|
|
7
|
+
export declare function getClassName(target: Function): string;
|
|
3
8
|
export type InjectableOptions = {
|
|
4
9
|
scope?: Scope;
|
|
5
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectable-decorator.d.ts","sourceRoot":"","sources":["../../src/dependency-injection/injectable-decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,OAEjD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"injectable-decorator.d.ts","sourceRoot":"","sources":["../../src/dependency-injection/injectable-decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,OAEjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAIrD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,cAAc,CAY1E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.injectableHandler = injectableHandler;
|
|
4
|
+
exports.getClassName = getClassName;
|
|
4
5
|
exports.Injectable = Injectable;
|
|
5
6
|
const inversify_1 = require("inversify");
|
|
6
7
|
const keys_1 = require("../constants/keys");
|
|
@@ -8,10 +9,18 @@ const scopes_1 = require("../constants/scopes");
|
|
|
8
9
|
function injectableHandler(target) {
|
|
9
10
|
return Reflect.getOwnMetadata(keys_1.INJECTABLE_KEY, target);
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves the original class name stored at decorator-evaluation time.
|
|
14
|
+
* Falls back to constructor.name if no metadata is found (e.g. non-decorated classes).
|
|
15
|
+
*/
|
|
16
|
+
function getClassName(target) {
|
|
17
|
+
return (Reflect.getOwnMetadata(keys_1.CLASS_NAME_KEY, target) ?? target.name ?? 'Unknown');
|
|
18
|
+
}
|
|
11
19
|
function Injectable(options = {}) {
|
|
12
20
|
const { scope = scopes_1.Scope.DEFAULT } = options;
|
|
13
21
|
return (target) => {
|
|
14
22
|
Reflect.defineMetadata(keys_1.INJECTABLE_KEY, { scope }, target);
|
|
23
|
+
Reflect.defineMetadata(keys_1.CLASS_NAME_KEY, target.name, target);
|
|
15
24
|
if (options?.scope) {
|
|
16
25
|
console.warn('Injectable: Scope option is not implemented.');
|
|
17
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectable-decorator.js","sourceRoot":"","sources":["../../src/dependency-injection/injectable-decorator.ts"],"names":[],"mappings":";;AAIA,8CAEC;AAMD,
|
|
1
|
+
{"version":3,"file":"injectable-decorator.js","sourceRoot":"","sources":["../../src/dependency-injection/injectable-decorator.ts"],"names":[],"mappings":";;AAIA,8CAEC;AAMD,oCAIC;AAMD,gCAYC;AAlCD,yCAAsC;AACtC,2CAAiE;AACjE,+CAA0C;AAE1C,SAAgB,iBAAiB,CAAC,MAAgB;IAChD,OAAO,OAAO,CAAC,cAAc,CAAC,qBAAc,EAAE,MAAM,CAAC,CAAA;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,MAAgB;IAC3C,OAAO,CACL,OAAO,CAAC,cAAc,CAAC,qBAAc,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI,SAAS,CAC3E,CAAA;AACH,CAAC;AAMD,SAAgB,UAAU,CAAC,UAA6B,EAAE;IACxD,MAAM,EAAE,KAAK,GAAG,cAAK,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IACzC,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,OAAO,CAAC,cAAc,CAAC,qBAAc,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC,CAAA;QACzD,OAAO,CAAC,cAAc,CAAC,qBAAc,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAE3D,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAA;QAC9D,CAAC;QAED,IAAA,sBAAU,GAAE,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -4,18 +4,15 @@ export declare class ApiException extends HttpException {
|
|
|
4
4
|
readonly code: string;
|
|
5
5
|
readonly title: string;
|
|
6
6
|
readonly message: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
title: string;
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
7
|
+
private readonly metadata;
|
|
8
|
+
constructor(code: string, title: string, message: string, status?: HttpStatus, metadata?: any);
|
|
9
|
+
getResponse(): any;
|
|
13
10
|
}
|
|
14
11
|
export declare class BadRequestApiException extends ApiException {
|
|
15
12
|
constructor(message: string);
|
|
16
13
|
}
|
|
17
14
|
export declare class ValidationApiException extends ApiException {
|
|
18
|
-
constructor(message: string);
|
|
15
|
+
constructor(message: string, errors?: any);
|
|
19
16
|
}
|
|
20
17
|
export declare class UnauthorizedApiException extends ApiException {
|
|
21
18
|
constructor(message?: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/api-exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,YAAa,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"api-exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/api-exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,YAAa,SAAQ,aAAa;aAI3B,IAAI,EAAE,MAAM;aACZ,KAAK,EAAE,MAAM;aACb,OAAO,EAAE,MAAM;IALjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;gBAGZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAC/B,MAAM,GAAE,UAA6C,EACrD,QAAQ,GAAE,GAAQ;IAMpB,WAAW;CAQZ;AAED,qBAAa,sBAAuB,SAAQ,YAAY;gBAC1C,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,sBAAuB,SAAQ,YAAY;gBAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG;CAK1C;AAED,qBAAa,wBAAyB,SAAQ,YAAY;gBAC5C,OAAO,GAAE,MAAuB;CAG7C;AAED,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,+BAAgC,SAAQ,YAAY;gBACnD,OAAO,EAAE,MAAM;CAQ5B;AAED,qBAAa,+BAAgC,SAAQ,YAAY;gBACnD,OAAO,EAAE,MAAM;CAQ5B;AAED,qBAAa,8BAA+B,SAAQ,YAAY;gBAClD,OAAO,EAAE,MAAM;CAQ5B"}
|
|
@@ -4,17 +4,19 @@ exports.ServiceUnavailableApiException = exports.InternalServerErrorApiException
|
|
|
4
4
|
const http_status_1 = require("../constants/http-status");
|
|
5
5
|
const http_exception_1 = require("./http-exception");
|
|
6
6
|
class ApiException extends http_exception_1.HttpException {
|
|
7
|
-
constructor(code, title, message, status = http_status_1.HttpStatus.INTERNAL_SERVER_ERROR) {
|
|
7
|
+
constructor(code, title, message, status = http_status_1.HttpStatus.INTERNAL_SERVER_ERROR, metadata = {}) {
|
|
8
8
|
super(message, status);
|
|
9
9
|
this.code = code;
|
|
10
10
|
this.title = title;
|
|
11
11
|
this.message = message;
|
|
12
|
+
this.metadata = metadata;
|
|
12
13
|
}
|
|
13
14
|
getResponse() {
|
|
14
15
|
return {
|
|
15
16
|
code: this.code,
|
|
16
17
|
title: this.title,
|
|
17
|
-
message: this.message
|
|
18
|
+
message: this.message,
|
|
19
|
+
...this.metadata
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -26,8 +28,10 @@ class BadRequestApiException extends ApiException {
|
|
|
26
28
|
}
|
|
27
29
|
exports.BadRequestApiException = BadRequestApiException;
|
|
28
30
|
class ValidationApiException extends ApiException {
|
|
29
|
-
constructor(message) {
|
|
30
|
-
super('0007', 'Validation Error', message, http_status_1.HttpStatus.BAD_REQUEST
|
|
31
|
+
constructor(message, errors) {
|
|
32
|
+
super('0007', 'Validation Error', message, http_status_1.HttpStatus.BAD_REQUEST, {
|
|
33
|
+
errors
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
exports.ValidationApiException = ValidationApiException;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-exception.js","sourceRoot":"","sources":["../../src/exceptions/api-exception.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,qDAAgD;AAEhD,MAAa,YAAa,SAAQ,8BAAa;
|
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,OAAe;QACzB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAU,CAAC,SAAS,CAAC,CAAA;IAC3D,CAAC;CACF;AAJD,sDAIC;AAED,MAAa,oBAAqB,SAAQ,YAAY;IACpD,YAAY,OAAe;QACzB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAU,CAAC,SAAS,CAAC,CAAA;IAC3D,CAAC;CACF;AAJD,oDAIC;AAED,MAAa,+BAAgC,SAAQ,YAAY;IAC/D,YAAY,OAAe;QACzB,KAAK,CACH,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,wBAAU,CAAC,oBAAoB,CAChC,CAAA;IACH,CAAC;CACF;AATD,0EASC;AAED,MAAa,+BAAgC,SAAQ,YAAY;IAC/D,YAAY,OAAe;QACzB,KAAK,CACH,MAAM,EACN,uBAAuB,EACvB,OAAO,EACP,wBAAU,CAAC,qBAAqB,CACjC,CAAA;IACH,CAAC;CACF;AATD,0EASC;AAED,MAAa,8BAA+B,SAAQ,YAAY;IAC9D,YAAY,OAAe;QACzB,KAAK,CACH,MAAM,EACN,qBAAqB,EACrB,OAAO,EACP,wBAAU,CAAC,mBAAmB,CAC/B,CAAA;IACH,CAAC;CACF;AATD,wEASC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-exception-filter.d.ts","sourceRoot":"","sources":["../../src/exceptions/base-exception-filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-exception-filter.d.ts","sourceRoot":"","sources":["../../src/exceptions/base-exception-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,qBAAa,mBAAoB,YAAW,eAAe;IACnD,KAAK,CAAC,SAAS,EAAE,GAAG;;;CAmB3B"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseExceptionFilter = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const api_exception_1 = require("./api-exception");
|
|
4
6
|
const server_1 = require("next/server");
|
|
5
7
|
class BaseExceptionFilter {
|
|
6
8
|
async catch(exception) {
|
|
7
|
-
|
|
9
|
+
if (exception instanceof api_exception_1.ApiException) {
|
|
10
|
+
const status = exception.getStatus ? exception.getStatus() : 500;
|
|
11
|
+
return server_1.NextResponse.json({
|
|
12
|
+
message: exception.message || 'Internal server error'
|
|
13
|
+
}, { status });
|
|
14
|
+
}
|
|
8
15
|
return server_1.NextResponse.json({
|
|
9
|
-
message: exception.message
|
|
10
|
-
}, { status });
|
|
16
|
+
message: exception.message
|
|
17
|
+
}, { status: constants_1.HttpStatus.INTERNAL_SERVER_ERROR });
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
20
|
exports.BaseExceptionFilter = BaseExceptionFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-exception-filter.js","sourceRoot":"","sources":["../../src/exceptions/base-exception-filter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base-exception-filter.js","sourceRoot":"","sources":["../../src/exceptions/base-exception-filter.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,mDAA8C;AAE9C,wCAA0C;AAE1C,MAAa,mBAAmB;IAC9B,KAAK,CAAC,KAAK,CAAC,SAAc;QACxB,IAAI,SAAS,YAAY,4BAAY,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;YAEhE,OAAO,qBAAY,CAAC,IAAI,CACtB;gBACE,OAAO,EAAE,SAAS,CAAC,OAAO,IAAI,uBAAuB;aACtD,EACD,EAAE,MAAM,EAAE,CACX,CAAA;QACH,CAAC;QAED,OAAO,qBAAY,CAAC,IAAI,CACtB;YACE,OAAO,EAAE,SAAS,CAAC,OAAO;SAC3B,EACD,EAAE,MAAM,EAAE,sBAAU,CAAC,qBAAqB,EAAE,CAC7C,CAAA;IACH,CAAC;CACF;AApBD,kDAoBC"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { Container } from '../../dependency-injection';
|
|
1
2
|
import { Class } from '../../types/class';
|
|
2
|
-
|
|
3
|
+
import { ExceptionFilter } from '../exception-filter';
|
|
4
|
+
export type FilterMetadata = {
|
|
5
|
+
filters: Class[];
|
|
6
|
+
};
|
|
7
|
+
export declare class FilterHandler {
|
|
8
|
+
static getMetadata(target: object): FilterMetadata;
|
|
9
|
+
static register(container: Container, target: object): Promise<void>;
|
|
10
|
+
static fetch(container: Container, target: object): Promise<ExceptionFilter[]>;
|
|
11
|
+
static _fetch(container: Container, filter: ExceptionFilter | Class<ExceptionFilter>): Promise<ExceptionFilter>;
|
|
12
|
+
static _register(container: Container, filter: ExceptionFilter | Class<ExceptionFilter>): Promise<void>;
|
|
13
|
+
}
|
|
3
14
|
export declare function UseFilters(filters: Class[]): ClassDecorator;
|
|
4
15
|
//# sourceMappingURL=use-filters-decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-filters-decorator.d.ts","sourceRoot":"","sources":["../../../src/exceptions/decorators/use-filters-decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"use-filters-decorator.d.ts","sourceRoot":"","sources":["../../../src/exceptions/decorators/use-filters-decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,KAAK,EAAE,CAAA;CACjB,CAAA;AAED,qBAAa,aAAa;IACxB,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;WAQrC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM;WAQ7C,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM;WAQ1C,MAAM,CACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;WAUrC,SAAS,CACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;CAQnD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,cAAc,CAS3D"}
|
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FilterHandler = void 0;
|
|
4
4
|
exports.UseFilters = UseFilters;
|
|
5
5
|
const keys_1 = require("../../constants/keys");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
class FilterHandler {
|
|
7
|
+
static getMetadata(target) {
|
|
8
|
+
const metadata = Reflect.getOwnMetadata(keys_1.FILTER_KEY, target);
|
|
9
|
+
if (metadata) {
|
|
10
|
+
return { filters: metadata };
|
|
11
|
+
}
|
|
12
|
+
return { filters: [] };
|
|
13
|
+
}
|
|
14
|
+
static async register(container, target) {
|
|
15
|
+
const { filters } = this.getMetadata(target);
|
|
16
|
+
await Promise.all(filters.map((filter) => FilterHandler._register(container, filter)));
|
|
17
|
+
}
|
|
18
|
+
static async fetch(container, target) {
|
|
19
|
+
const { filters } = this.getMetadata(target);
|
|
20
|
+
return Promise.all(filters.map((filter) => this._fetch(container, filter)));
|
|
21
|
+
}
|
|
22
|
+
static async _fetch(container, filter) {
|
|
23
|
+
// If it's a class constructor (function), resolve from container
|
|
24
|
+
if (typeof filter === 'function') {
|
|
25
|
+
return container.getAsync(filter);
|
|
26
|
+
}
|
|
27
|
+
// If it's an instance, resolve from container using its constructor
|
|
28
|
+
return container.getAsync(filter.constructor);
|
|
29
|
+
}
|
|
30
|
+
static async _register(container, filter) {
|
|
31
|
+
if (typeof filter === 'function') {
|
|
32
|
+
container.bind(filter).to(filter).inSingletonScope();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
container.bind(filter.constructor).toConstantValue(filter);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
8
38
|
}
|
|
39
|
+
exports.FilterHandler = FilterHandler;
|
|
9
40
|
function UseFilters(filters) {
|
|
10
41
|
return (target) => {
|
|
11
42
|
const existingFilters = Reflect.getOwnMetadata(keys_1.FILTER_KEY, target) || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-filters-decorator.js","sourceRoot":"","sources":["../../../src/exceptions/decorators/use-filters-decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-filters-decorator.js","sourceRoot":"","sources":["../../../src/exceptions/decorators/use-filters-decorator.ts"],"names":[],"mappings":";;;AA0DA,gCASC;AAnED,2CAA6C;AAS7C,MAAa,aAAa;IACxB,MAAM,CAAC,WAAW,CAAC,MAAc;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAU,EAAE,MAAM,CAAC,CAAA;QAC3D,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;QAC9B,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAoB,EAAE,MAAc;QACxD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAE5C,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,MA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AAM,cAAc,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC,CAAA;QAEvD,OAAO,CAAC,cAAc,CAAC,iBAAU,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;IAC5D,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExecutionContext } from '../context/execution-context';
|
|
2
|
+
/**
|
|
3
|
+
* Interface defining the `canActivate()` function that must be implemented
|
|
4
|
+
* by a guard. Return value indicates whether or not the current request is
|
|
5
|
+
* allowed to proceed.
|
|
6
|
+
*
|
|
7
|
+
* @see [Guards](https://docs.nestjs.com/guards)
|
|
8
|
+
*
|
|
9
|
+
* @publicApi
|
|
10
|
+
*/
|
|
11
|
+
export interface CanActivate {
|
|
12
|
+
/**
|
|
13
|
+
* @param context Current execution context. Provides access to details about
|
|
14
|
+
* the current request pipeline.
|
|
15
|
+
*
|
|
16
|
+
* @returns Value indicating whether or not the current request is allowed to
|
|
17
|
+
* proceed. Can be a boolean or a Promise that resolves to a boolean.
|
|
18
|
+
*/
|
|
19
|
+
canActivate(context: ExecutionContext): boolean | Promise<boolean>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=can-activate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can-activate.d.ts","sourceRoot":"","sources":["../../src/guards/can-activate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can-activate.js","sourceRoot":"","sources":["../../src/guards/can-activate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/guards/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-guards-decorator"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/guards/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAsC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CanActivate } from '../can-activate';
|
|
2
|
+
import { ExecutionContext } from '../../context/execution-context';
|
|
3
|
+
import { Class } from '../../types/class';
|
|
4
|
+
import type { Container } from '../../dependency-injection';
|
|
5
|
+
export type GuardMetadata = {
|
|
6
|
+
guards: (CanActivate | Class<CanActivate>)[];
|
|
7
|
+
};
|
|
8
|
+
export declare class GuardHandler {
|
|
9
|
+
static getClassMetadata(target: object): GuardMetadata | undefined;
|
|
10
|
+
static getMethodMetadata(target: object, propertyKey: string | symbol): GuardMetadata | undefined;
|
|
11
|
+
static register(container: Container, target: Class): void;
|
|
12
|
+
static fetch(container: Container, target: object, methodName: string | symbol): Promise<CanActivate[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Execute guards in sequence. If any guard returns false, throws ForbiddenApiException.
|
|
15
|
+
* Guards execute in order: global guards -> class guards -> method guards
|
|
16
|
+
*/
|
|
17
|
+
static execute(executionContext: ExecutionContext, guards: CanActivate[]): Promise<boolean>;
|
|
18
|
+
private static _fetch;
|
|
19
|
+
private static _register;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Decorator that binds guards to the scope of the controller or method,
|
|
23
|
+
* depending on its context.
|
|
24
|
+
*
|
|
25
|
+
* When `@UseGuards` is used at the controller level, the guard will be
|
|
26
|
+
* applied to every handler (method) in the controller.
|
|
27
|
+
*
|
|
28
|
+
* When `@UseGuards` is used at the individual handler level, the guard
|
|
29
|
+
* will apply only to that specific method.
|
|
30
|
+
*
|
|
31
|
+
* @param guards a single guard instance or class, or a list of guard instances
|
|
32
|
+
* or classes.
|
|
33
|
+
*
|
|
34
|
+
* @see [Guards](https://docs.nestjs.com/guards)
|
|
35
|
+
*
|
|
36
|
+
* @usageNotes
|
|
37
|
+
* Guards can also be set up globally for all controllers and routes
|
|
38
|
+
* using `app.useGlobalGuards()` or by registering via module providers
|
|
39
|
+
* with the `APP_GUARD` token.
|
|
40
|
+
*
|
|
41
|
+
* @publicApi
|
|
42
|
+
*/
|
|
43
|
+
export declare function UseGuards(...guards: (CanActivate | Class<CanActivate>)[]): ClassDecorator & MethodDecorator;
|
|
44
|
+
//# sourceMappingURL=use-guards-decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-guards-decorator.d.ts","sourceRoot":"","sources":["../../../src/guards/decorators/use-guards-decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAA;CAC7C,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIlE,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,aAAa,GAAG,SAAS;IAgB5B,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK;WA4BtC,KAAK,CAChB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,MAAM,GAC1B,OAAO,CAAC,WAAW,EAAE,CAAC;IA2BzB;;;OAGG;WACU,OAAO,CAClB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,WAAW,EAAE,GACpB,OAAO,CAAC,OAAO,CAAC;mBAYE,MAAM;IAU3B,OAAO,CAAC,MAAM,CAAC,SAAS;CAczB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CACvB,GAAG,MAAM,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,GAC9C,cAAc,GAAG,eAAe,CA8BlC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuardHandler = void 0;
|
|
4
|
+
exports.UseGuards = UseGuards;
|
|
5
|
+
const keys_1 = require("../../constants/keys");
|
|
6
|
+
const get_class_methods_1 = require("../../utils/class/get-class-methods");
|
|
7
|
+
const api_exception_1 = require("../../exceptions/api-exception");
|
|
8
|
+
class GuardHandler {
|
|
9
|
+
static getClassMetadata(target) {
|
|
10
|
+
return Reflect.getOwnMetadata(keys_1.GUARD_KEY, target);
|
|
11
|
+
}
|
|
12
|
+
static getMethodMetadata(target, propertyKey) {
|
|
13
|
+
// First check if metadata exists directly on the target (method-level decorator)
|
|
14
|
+
let metadata = Reflect.getOwnMetadata(keys_1.GUARD_KEY, target, propertyKey);
|
|
15
|
+
// If not found, check on the constructor prototype (class-level decorator)
|
|
16
|
+
if (!metadata && target.constructor) {
|
|
17
|
+
metadata = Reflect.getOwnMetadata(keys_1.GUARD_KEY, target.constructor.prototype, propertyKey);
|
|
18
|
+
}
|
|
19
|
+
return metadata;
|
|
20
|
+
}
|
|
21
|
+
static register(container, target) {
|
|
22
|
+
const metadata = GuardHandler.getClassMetadata(target);
|
|
23
|
+
if (metadata && metadata?.guards?.length !== 0) {
|
|
24
|
+
const { guards } = metadata;
|
|
25
|
+
guards.forEach((guard) => {
|
|
26
|
+
GuardHandler._register(container, guard);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// Register method guards
|
|
30
|
+
const methodNames = (0, get_class_methods_1.getClassMethods)(target);
|
|
31
|
+
methodNames.forEach((methodName) => {
|
|
32
|
+
const methodMetadata = Reflect.getOwnMetadata(keys_1.GUARD_KEY, target.prototype, methodName);
|
|
33
|
+
if (methodMetadata) {
|
|
34
|
+
methodMetadata.guards.forEach((guard) => {
|
|
35
|
+
GuardHandler._register(container, guard);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
static async fetch(container, target, methodName) {
|
|
41
|
+
const guards = [];
|
|
42
|
+
const metadata = GuardHandler.getClassMetadata(target.constructor);
|
|
43
|
+
if (metadata && metadata.guards.length > 0) {
|
|
44
|
+
guards.push(...(await Promise.all(metadata.guards.map((guard) => GuardHandler._fetch(container, guard)))));
|
|
45
|
+
}
|
|
46
|
+
const methodMetadata = GuardHandler.getMethodMetadata(target, methodName);
|
|
47
|
+
if (methodMetadata) {
|
|
48
|
+
guards.push(...(await Promise.all(methodMetadata.guards.map((guard) => GuardHandler._fetch(container, guard)))));
|
|
49
|
+
}
|
|
50
|
+
return guards;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Execute guards in sequence. If any guard returns false, throws ForbiddenApiException.
|
|
54
|
+
* Guards execute in order: global guards -> class guards -> method guards
|
|
55
|
+
*/
|
|
56
|
+
static async execute(executionContext, guards) {
|
|
57
|
+
for (const guard of guards) {
|
|
58
|
+
const canActivate = await guard.canActivate(executionContext);
|
|
59
|
+
if (!canActivate) {
|
|
60
|
+
throw new api_exception_1.ForbiddenApiException('Forbidden resource');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
static async _fetch(container, guard) {
|
|
66
|
+
if (typeof guard === 'function') {
|
|
67
|
+
return container.getAsync(guard);
|
|
68
|
+
}
|
|
69
|
+
return container.getAsync(guard.constructor);
|
|
70
|
+
}
|
|
71
|
+
static _register(container, guard) {
|
|
72
|
+
// If it's a class constructor (function), register it in the container
|
|
73
|
+
if (typeof guard === 'function') {
|
|
74
|
+
if (!container.isBound(guard)) {
|
|
75
|
+
container.bind(guard).toSelf().inSingletonScope();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// If it's an instance, bind it to its constructor class as a constant value
|
|
80
|
+
container.bind(guard.constructor).toConstantValue(guard);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.GuardHandler = GuardHandler;
|
|
85
|
+
/**
|
|
86
|
+
* Decorator that binds guards to the scope of the controller or method,
|
|
87
|
+
* depending on its context.
|
|
88
|
+
*
|
|
89
|
+
* When `@UseGuards` is used at the controller level, the guard will be
|
|
90
|
+
* applied to every handler (method) in the controller.
|
|
91
|
+
*
|
|
92
|
+
* When `@UseGuards` is used at the individual handler level, the guard
|
|
93
|
+
* will apply only to that specific method.
|
|
94
|
+
*
|
|
95
|
+
* @param guards a single guard instance or class, or a list of guard instances
|
|
96
|
+
* or classes.
|
|
97
|
+
*
|
|
98
|
+
* @see [Guards](https://docs.nestjs.com/guards)
|
|
99
|
+
*
|
|
100
|
+
* @usageNotes
|
|
101
|
+
* Guards can also be set up globally for all controllers and routes
|
|
102
|
+
* using `app.useGlobalGuards()` or by registering via module providers
|
|
103
|
+
* with the `APP_GUARD` token.
|
|
104
|
+
*
|
|
105
|
+
* @publicApi
|
|
106
|
+
*/
|
|
107
|
+
function UseGuards(...guards) {
|
|
108
|
+
return (target, propertyKey, descriptor) => {
|
|
109
|
+
if (descriptor && propertyKey) {
|
|
110
|
+
// Method decorator
|
|
111
|
+
Reflect.defineMetadata(keys_1.GUARD_KEY, { guards }, target, propertyKey);
|
|
112
|
+
return descriptor;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
// Class decorator
|
|
116
|
+
const methodNames = (0, get_class_methods_1.getClassMethods)(target);
|
|
117
|
+
// Store class-level guards metadata
|
|
118
|
+
Reflect.defineMetadata(keys_1.GUARD_KEY, { guards }, target);
|
|
119
|
+
// Process each method and store guards metadata
|
|
120
|
+
methodNames.forEach((methodName) => {
|
|
121
|
+
Reflect.defineMetadata(keys_1.GUARD_KEY, { guards }, target.prototype, methodName);
|
|
122
|
+
});
|
|
123
|
+
return target;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=use-guards-decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-guards-decorator.js","sourceRoot":"","sources":["../../../src/guards/decorators/use-guards-decorator.ts"],"names":[],"mappings":";;;AAkKA,8BAgCC;AAlMD,2CAA4C;AAI5C,uEAAiE;AAEjE,8DAAkE;AAMlE,MAAa,YAAY;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AAe,EAAC,MAAM,CAAC,CAAA;YAE3C,oCAAoC;YACpC,OAAO,CAAC,cAAc,CAAC,gBAAS,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,CAAA;YAErD,gDAAgD;YAChD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBACjC,OAAO,CAAC,cAAc,CACpB,gBAAS,EACT,EAAE,MAAM,EAAE,EACV,MAAM,CAAC,SAAS,EAChB,UAAU,CACX,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./can-activate"), exports);
|
|
18
|
+
__exportStar(require("./decorators"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,+CAA4B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,22 @@ export * from './constants';
|
|
|
3
3
|
export * from './utils/apply-decorators';
|
|
4
4
|
export * from './context';
|
|
5
5
|
export * from './exceptions';
|
|
6
|
+
export * from './guards';
|
|
6
7
|
export * from './interceptor';
|
|
7
8
|
export * from './logger';
|
|
8
9
|
export * from './controllers';
|
|
9
10
|
export * from './dependency-injection';
|
|
10
11
|
export * from './modules';
|
|
12
|
+
export * from './middleware';
|
|
13
|
+
export * from './pipes';
|
|
11
14
|
export * from './server';
|
|
15
|
+
export * from './zod';
|
|
12
16
|
export { REQUEST } from './services/request';
|
|
17
|
+
export { APP_GUARD } from './services/guards';
|
|
13
18
|
export { APP_INTERCEPTOR } from './services/interceptor';
|
|
14
19
|
export { APP_FILTER } from './services/filters';
|
|
20
|
+
export { APP_PIPE } from './services/pipes';
|
|
15
21
|
export { FetchModuleOptions, HttpService } from './services/http-service';
|
|
22
|
+
export { APP_MIDDLEWARE } from './services/middleware';
|
|
23
|
+
export { CLASS_NAME_KEY } from './constants/keys';
|
|
16
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAA;AAEzB,cAAc,aAAa,CAAA;AAC3B,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAA;AAEzB,cAAc,aAAa,CAAA;AAC3B,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AAGrB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|