@smartsoft001/nestjs 2.147.0 → 2.149.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/package.json +4 -4
- package/src/index.js +8 -5
- package/src/index.js.map +1 -1
- package/src/lib/auth/index.js +5 -2
- package/src/lib/auth/index.js.map +1 -1
- package/src/lib/auth/jwt.strategy.js +14 -11
- package/src/lib/auth/jwt.strategy.js.map +1 -1
- package/src/lib/auth/permission.service.js +13 -10
- package/src/lib/auth/permission.service.js.map +1 -1
- package/src/lib/decorators/index.js +4 -1
- package/src/lib/decorators/index.js.map +1 -1
- package/src/lib/decorators/user/user.decorator.js +5 -2
- package/src/lib/decorators/user/user.decorator.js.map +1 -1
- package/src/lib/filters/execution/exception.filter.js +17 -14
- package/src/lib/filters/execution/exception.filter.js.map +1 -1
- package/src/lib/filters/index.js +4 -1
- package/src/lib/filters/index.js.map +1 -1
- package/src/lib/shared.config.js +8 -5
- package/src/lib/shared.config.js.map +1 -1
- package/src/lib/shared.module.js +13 -9
- package/src/lib/shared.module.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/nestjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.149.0",
|
|
4
|
+
"description": "Shared NestJS building blocks: SharedModule with its JWT and permission configuration, PermissionService, the JWT strategy, the @User decorator and the application exception filter.",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"access": "public"
|
|
6
7
|
},
|
|
@@ -12,8 +13,7 @@
|
|
|
12
13
|
"passport-jwt": "^4.0.1",
|
|
13
14
|
"@nestjs/passport": "^11.0.5",
|
|
14
15
|
"@nestjs/common": "^11.0.7",
|
|
15
|
-
"@
|
|
16
|
-
"@smartsoft001/
|
|
17
|
-
"@smartsoft001/users": "2.147.0"
|
|
16
|
+
"@smartsoft001/domain-core": "2.149.0",
|
|
17
|
+
"@smartsoft001/users": "2.149.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/shared.config"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/shared.module"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/filters"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/decorators"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/auth"), exports);
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/nestjs/src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,8DAAoC;AACpC,wDAA8B;AAC9B,2DAAiC;AACjC,qDAA2B"}
|
package/src/lib/auth/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./jwt.strategy"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./permission.service"), exports);
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,+DAAqC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JwtStrategy = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const passport_1 = require("@nestjs/passport");
|
|
7
|
+
const passport_jwt_1 = require("passport-jwt");
|
|
8
|
+
const shared_config_1 = require("../shared.config");
|
|
9
|
+
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) {
|
|
7
10
|
config;
|
|
8
11
|
constructor(config) {
|
|
9
12
|
super({
|
|
10
|
-
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
13
|
+
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
11
14
|
ignoreExpiration: false,
|
|
12
15
|
secretOrKey: config.tokenConfig?.secretOrPrivateKey,
|
|
13
16
|
});
|
|
@@ -21,9 +24,9 @@ let JwtStrategy = class JwtStrategy extends PassportStrategy(Strategy) {
|
|
|
21
24
|
};
|
|
22
25
|
}
|
|
23
26
|
};
|
|
24
|
-
JwtStrategy =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
exports.JwtStrategy = JwtStrategy;
|
|
28
|
+
exports.JwtStrategy = JwtStrategy = tslib_1.__decorate([
|
|
29
|
+
(0, common_1.Injectable)(),
|
|
30
|
+
tslib_1.__metadata("design:paramtypes", [shared_config_1.SharedConfig])
|
|
27
31
|
], JwtStrategy);
|
|
28
|
-
export { JwtStrategy };
|
|
29
32
|
//# sourceMappingURL=jwt.strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/jwt.strategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/jwt.strategy.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,+CAAoD;AAEpD,oDAAgD;AAGzC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACrC;IAApB,YAAoB,MAAoB;QACtC,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,kBAA4B;SAC9D,CAAC,CAAC;QALe,WAAM,GAAN,MAAM,CAAc;IAMxC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAY;QACzB,OAAO;YACL,GAAG,OAAO;YACV,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,GAAG;SACtB,CAAC;IACJ,CAAC;CACF,CAAA;AAhBY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;6CAEiB,4BAAY;GAD7B,WAAW,CAgBvB"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const domain_core_1 = require("@smartsoft001/domain-core");
|
|
7
|
+
const shared_config_1 = require("../shared.config");
|
|
5
8
|
/**
|
|
6
9
|
* Service to handle permission validation for users.
|
|
7
10
|
*
|
|
@@ -25,14 +28,14 @@ let PermissionService = class PermissionService {
|
|
|
25
28
|
if (!typeConfig)
|
|
26
29
|
return;
|
|
27
30
|
if (!user.permissions)
|
|
28
|
-
throw new DomainForbiddenError(`Context forbidden`);
|
|
31
|
+
throw new domain_core_1.DomainForbiddenError(`Context forbidden`);
|
|
29
32
|
if (!typeConfig.some((tc) => user.permissions.some((up) => tc === up)))
|
|
30
|
-
throw new DomainForbiddenError(`Context forbidden`);
|
|
33
|
+
throw new domain_core_1.DomainForbiddenError(`Context forbidden`);
|
|
31
34
|
}
|
|
32
35
|
};
|
|
33
|
-
PermissionService =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
exports.PermissionService = PermissionService;
|
|
37
|
+
exports.PermissionService = PermissionService = tslib_1.__decorate([
|
|
38
|
+
(0, common_1.Injectable)(),
|
|
39
|
+
tslib_1.__metadata("design:paramtypes", [shared_config_1.SharedConfig])
|
|
36
40
|
], PermissionService);
|
|
37
|
-
export { PermissionService };
|
|
38
41
|
//# sourceMappingURL=permission.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.service.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/permission.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permission.service.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/auth/permission.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,2DAAiE;AAGjE,oDAAgE;AAEhE;;;;GAIG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACR;IAApB,YAAoB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAE5C;;;;;OAKG;IACH,KAAK,CAAC,IAAoB,EAAE,IAAW;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;YAAE,OAAO;QAErC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEjD,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,kCAAoB,CAAC,mBAAmB,CAAC,CAAC;QAE3E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACpE,MAAM,IAAI,kCAAoB,CAAC,mBAAmB,CAAC,CAAC;IACxD,CAAC;CACF,CAAA;AArBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;6CAEiB,4BAAY;GAD7B,iBAAiB,CAqB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/decorators/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/decorators/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.User = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
2
5
|
/**
|
|
3
6
|
* Custom decorator to extract the user object from the request.
|
|
4
7
|
*
|
|
@@ -19,7 +22,7 @@ import { createParamDecorator } from '@nestjs/common';
|
|
|
19
22
|
* }
|
|
20
23
|
* ```
|
|
21
24
|
*/
|
|
22
|
-
|
|
25
|
+
exports.User = (0, common_1.createParamDecorator)((_, context) => {
|
|
23
26
|
const [req] = context.getArgs();
|
|
24
27
|
return req.user;
|
|
25
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.decorator.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/nestjs/src/lib/decorators/user/user.decorator.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"user.decorator.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/nestjs/src/lib/decorators/user/user.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,IAAI,GAAG,IAAA,6BAAoB,EAAC,CAAC,CAAC,EAAE,OAAyB,EAAE,EAAE;IACxE,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var AppExceptionFilter_1;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AppExceptionFilter = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const domain_core_1 = require("@smartsoft001/domain-core");
|
|
5
8
|
/**
|
|
6
9
|
* Exception filter to handle and format exceptions thrown by the application.
|
|
7
10
|
*
|
|
@@ -39,25 +42,25 @@ let AppExceptionFilter = AppExceptionFilter_1 = class AppExceptionFilter {
|
|
|
39
42
|
catch(exception, host) {
|
|
40
43
|
const ctx = host.switchToHttp();
|
|
41
44
|
const response = ctx.getResponse();
|
|
42
|
-
let status = HttpStatus.INTERNAL_SERVER_ERROR;
|
|
45
|
+
let status = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
43
46
|
let message = null;
|
|
44
|
-
if (exception instanceof HttpException) {
|
|
47
|
+
if (exception instanceof common_1.HttpException) {
|
|
45
48
|
status = exception.getStatus();
|
|
46
49
|
message = exception['message'];
|
|
47
50
|
}
|
|
48
|
-
else if (exception['type'] === DomainValidationError) {
|
|
49
|
-
status = HttpStatus.BAD_REQUEST;
|
|
51
|
+
else if (exception['type'] === domain_core_1.DomainValidationError) {
|
|
52
|
+
status = common_1.HttpStatus.BAD_REQUEST;
|
|
50
53
|
message = exception['message'];
|
|
51
54
|
}
|
|
52
|
-
else if (exception['type'] === DomainForbiddenError) {
|
|
53
|
-
status = HttpStatus.FORBIDDEN;
|
|
55
|
+
else if (exception['type'] === domain_core_1.DomainForbiddenError) {
|
|
56
|
+
status = common_1.HttpStatus.FORBIDDEN;
|
|
54
57
|
message = exception['message'];
|
|
55
58
|
}
|
|
56
59
|
else {
|
|
57
|
-
status = HttpStatus.INTERNAL_SERVER_ERROR;
|
|
60
|
+
status = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
58
61
|
message = 'Internal server error';
|
|
59
62
|
}
|
|
60
|
-
Logger.error(exception['stack'] || exception['message'] || exception, AppExceptionFilter_1.name);
|
|
63
|
+
common_1.Logger.error(exception['stack'] || exception['message'] || exception, AppExceptionFilter_1.name);
|
|
61
64
|
const result = response.status(status);
|
|
62
65
|
if (message && result.json) {
|
|
63
66
|
result.json({
|
|
@@ -77,8 +80,8 @@ let AppExceptionFilter = AppExceptionFilter_1 = class AppExceptionFilter {
|
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
};
|
|
80
|
-
AppExceptionFilter =
|
|
81
|
-
|
|
83
|
+
exports.AppExceptionFilter = AppExceptionFilter;
|
|
84
|
+
exports.AppExceptionFilter = AppExceptionFilter = AppExceptionFilter_1 = tslib_1.__decorate([
|
|
85
|
+
(0, common_1.Catch)()
|
|
82
86
|
], AppExceptionFilter);
|
|
83
|
-
export { AppExceptionFilter };
|
|
84
87
|
//# sourceMappingURL=exception.filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.filter.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/nestjs/src/lib/filters/execution/exception.filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exception.filter.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/nestjs/src/lib/filters/execution/exception.filter.ts"],"names":[],"mappings":";;;;;AAAA,2CAOwB;AAExB,2DAGmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,SAAc,EAAE,IAAmB;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAEnC,IAAI,MAAM,GAAG,mBAAU,CAAC,qBAAqB,CAAC;QAC9C,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,IAAI,SAAS,YAAY,sBAAa,EAAE,CAAC;YACvC,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;YAC/B,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;aAAM,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,mCAAqB,EAAE,CAAC;YACvD,MAAM,GAAG,mBAAU,CAAC,WAAW,CAAC;YAChC,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;aAAM,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,kCAAoB,EAAE,CAAC;YACtD,MAAM,GAAG,mBAAU,CAAC,SAAS,CAAC;YAC9B,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,mBAAU,CAAC,qBAAqB,CAAC;YAC1C,OAAO,GAAG,uBAAuB,CAAC;QACpC,CAAC;QAED,eAAM,CAAC,KAAK,CACV,SAAS,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,EACvD,oBAAkB,CAAC,IAAI,CACxB,CAAC;QAEF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC;gBACV,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC;aAAM,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC;gBACV,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;CACF,CAAA;AA/CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,cAAK,GAAE;GACK,kBAAkB,CA+C9B"}
|
package/src/lib/filters/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./execution/exception.filter"), exports);
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/filters/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/shared/nestjs/src/lib/filters/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C"}
|
package/src/lib/shared.config.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
3
6
|
let SharedConfig = class SharedConfig {
|
|
4
7
|
tokenConfig;
|
|
5
8
|
permissions;
|
|
6
9
|
type;
|
|
7
10
|
};
|
|
8
|
-
SharedConfig =
|
|
9
|
-
|
|
11
|
+
exports.SharedConfig = SharedConfig;
|
|
12
|
+
exports.SharedConfig = SharedConfig = tslib_1.__decorate([
|
|
13
|
+
(0, common_1.Injectable)()
|
|
10
14
|
], SharedConfig);
|
|
11
|
-
export { SharedConfig };
|
|
12
15
|
//# sourceMappingURL=shared.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.config.js","sourceRoot":"","sources":["../../../../../../packages/shared/nestjs/src/lib/shared.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.config.js","sourceRoot":"","sources":["../../../../../../packages/shared/nestjs/src/lib/shared.config.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAWrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,WAAW,CAGT;IACF,WAAW,CAAsB;IACjC,IAAI,CAAO;CACZ,CAAA;AAPY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAOxB"}
|
package/src/lib/shared.module.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedModule = void 0;
|
|
4
|
+
const auth_1 = require("./auth");
|
|
5
|
+
const shared_config_1 = require("./shared.config");
|
|
3
6
|
/**
|
|
4
7
|
* SharedModule class provides methods to configure the module's core functionalities and database settings.
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
class SharedModule {
|
|
7
10
|
/**
|
|
8
11
|
* Configures the module's core functionalities.
|
|
9
12
|
*
|
|
@@ -14,14 +17,14 @@ export class SharedModule {
|
|
|
14
17
|
return {
|
|
15
18
|
module: SharedModule,
|
|
16
19
|
providers: [
|
|
17
|
-
{ provide: SharedConfig, useValue: config },
|
|
18
|
-
JwtStrategy,
|
|
19
|
-
PermissionService,
|
|
20
|
+
{ provide: shared_config_1.SharedConfig, useValue: config },
|
|
21
|
+
auth_1.JwtStrategy,
|
|
22
|
+
auth_1.PermissionService,
|
|
20
23
|
],
|
|
21
24
|
exports: [
|
|
22
|
-
{ provide: SharedConfig, useValue: config },
|
|
23
|
-
PermissionService,
|
|
24
|
-
JwtStrategy,
|
|
25
|
+
{ provide: shared_config_1.SharedConfig, useValue: config },
|
|
26
|
+
auth_1.PermissionService,
|
|
27
|
+
auth_1.JwtStrategy,
|
|
25
28
|
],
|
|
26
29
|
};
|
|
27
30
|
}
|
|
@@ -39,4 +42,5 @@ export class SharedModule {
|
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
}
|
|
45
|
+
exports.SharedModule = SharedModule;
|
|
42
46
|
//# sourceMappingURL=shared.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.module.js","sourceRoot":"","sources":["../../../../../../packages/shared/nestjs/src/lib/shared.module.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"shared.module.js","sourceRoot":"","sources":["../../../../../../packages/shared/nestjs/src/lib/shared.module.ts"],"names":[],"mappings":";;;AAEA,iCAAwD;AACxD,mDAA+C;AAE/C;;GAEG;AACH,MAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAoB;QACpC,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,4BAAY,EAAE,QAAQ,EAAE,MAAM,EAAE;gBAC3C,kBAAW;gBACX,wBAAiB;aAClB;YACD,OAAO,EAAE;gBACP,EAAE,OAAO,EAAE,4BAAY,EAAE,QAAQ,EAAE,MAAM,EAAE;gBAC3C,wBAAiB;gBACjB,kBAAW;aACZ;SACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,MAQC;QAED,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC1C,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC3C,CAAC;IACJ,CAAC;CACF;AA9CD,oCA8CC"}
|