@ubs-platform/users-mona-microservice-helper 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +18 -0
- package/README.md +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/backend-jwt-utils-exports.module.d.ts +1 -0
- package/dist/lib/backend-jwt-utils-exports.module.js +22 -0
- package/dist/lib/backend-jwt-utils-exports.module.js.map +1 -0
- package/dist/lib/backend-jwt-utils.module.d.ts +2 -0
- package/dist/lib/backend-jwt-utils.module.js +29 -0
- package/dist/lib/backend-jwt-utils.module.js.map +1 -0
- package/dist/lib/current-user-decorator.d.ts +1 -0
- package/dist/lib/current-user-decorator.js +6 -0
- package/dist/lib/current-user-decorator.js.map +1 -0
- package/dist/lib/guards/communication-handler.d.ts +7 -0
- package/dist/lib/guards/communication-handler.js +28 -0
- package/dist/lib/guards/communication-handler.js.map +1 -0
- package/dist/lib/guards/jwt.guard.d.ts +4 -0
- package/dist/lib/guards/jwt.guard.js +8 -0
- package/dist/lib/guards/jwt.guard.js.map +1 -0
- package/dist/lib/service/user.service.d.ts +9 -0
- package/dist/lib/service/user.service.js +30 -0
- package/dist/lib/service/user.service.js.map +1 -0
- package/dist/lib/strategies/jwt.strategy.d.ts +11 -0
- package/dist/lib/strategies/jwt.strategy.js +30 -0
- package/dist/lib/strategies/jwt.strategy.js.map +1 -0
- package/dist/lib/utils/jwt-consts.d.ts +2 -0
- package/dist/lib/utils/jwt-consts.js +6 -0
- package/dist/lib/utils/jwt-consts.js.map +1 -0
- package/jest.config.ts +11 -0
- package/package.json +42 -0
- package/tsconfig.json +27 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.spec.json +9 -0
package/.eslintrc.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"extends": ["../../../../.eslintrc.json"],
|
3
|
+
"ignorePatterns": ["!**/*"],
|
4
|
+
"overrides": [
|
5
|
+
{
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
7
|
+
"rules": {}
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"files": ["*.ts", "*.tsx"],
|
11
|
+
"rules": {}
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"files": ["*.js", "*.jsx"],
|
15
|
+
"rules": {}
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./lib/backend-jwt-utils.module"), exports);
|
5
|
+
tslib_1.__exportStar(require("./lib/backend-jwt-utils-exports.module"), exports);
|
6
|
+
tslib_1.__exportStar(require("./lib/guards/jwt.guard"), exports);
|
7
|
+
tslib_1.__exportStar(require("./lib/current-user-decorator"), exports);
|
8
|
+
tslib_1.__exportStar(require("./lib/service/user.service"), exports);
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,iFAAuD;AACvD,iEAAuC;AACvC,uEAA6C;AAC7C,qEAA2C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const BackendJwtUtilsExportModule: import("@nestjs/common").DynamicModule[];
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BackendJwtUtilsExportModule = void 0;
|
4
|
+
const jwt_1 = require("@nestjs/jwt");
|
5
|
+
const passport_1 = require("@nestjs/passport");
|
6
|
+
const jwt_consts_1 = require("./utils/jwt-consts");
|
7
|
+
// @Module({
|
8
|
+
// controllers: [],
|
9
|
+
// providers: [],
|
10
|
+
// exports: [],
|
11
|
+
// imports: [
|
12
|
+
// ],
|
13
|
+
// })
|
14
|
+
// export class BackendJwtUtilsExportModule {}
|
15
|
+
exports.BackendJwtUtilsExportModule = [
|
16
|
+
passport_1.PassportModule.register({ defaultStrategy: "jwt" }),
|
17
|
+
jwt_1.JwtModule.register({
|
18
|
+
secret: jwt_consts_1.SECRET_JWT,
|
19
|
+
signOptions: { expiresIn: "30d" },
|
20
|
+
}),
|
21
|
+
];
|
22
|
+
//# sourceMappingURL=backend-jwt-utils-exports.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"backend-jwt-utils-exports.module.js","sourceRoot":"","sources":["../../src/lib/backend-jwt-utils-exports.module.ts"],"names":[],"mappings":";;;AACA,qCAAoD;AACpD,+CAAkD;AAClD,mDAAgD;AAEhD,YAAY;AACZ,qBAAqB;AACrB,mBAAmB;AACnB,iBAAiB;AACjB,eAAe;AAEf,OAAO;AACP,KAAK;AACL,8CAA8C;AAEjC,QAAA,2BAA2B,GAAG;IACzC,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IACnD,eAAS,CAAC,QAAQ,CAAC;QACjB,MAAM,EAAE,uBAAU;QAClB,WAAW,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;KAClC,CAAC;CACH,CAAC"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BackendJwtUtilsModule = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const common_1 = require("@nestjs/common");
|
6
|
+
const microservices_1 = require("@nestjs/microservices");
|
7
|
+
const backend_jwt_utils_exports_module_1 = require("./backend-jwt-utils-exports.module");
|
8
|
+
const communication_handler_1 = require("./guards/communication-handler");
|
9
|
+
const jwt_strategy_1 = require("./strategies/jwt.strategy");
|
10
|
+
const user_service_1 = require("./service/user.service");
|
11
|
+
const nest_microservice_setup_util_1 = require("@ubs-platform/nest-microservice-setup-util");
|
12
|
+
// import { JwtStrategy } from './strategies/jwt.strategy';
|
13
|
+
let BackendJwtUtilsModule = class BackendJwtUtilsModule {
|
14
|
+
};
|
15
|
+
exports.BackendJwtUtilsModule = BackendJwtUtilsModule;
|
16
|
+
exports.BackendJwtUtilsModule = BackendJwtUtilsModule = tslib_1.__decorate([
|
17
|
+
(0, common_1.Module)({
|
18
|
+
controllers: [],
|
19
|
+
providers: [communication_handler_1.CommunicationHelper, jwt_strategy_1.JwtStrategy, user_service_1.UserService],
|
20
|
+
exports: [user_service_1.UserService],
|
21
|
+
imports: [
|
22
|
+
...backend_jwt_utils_exports_module_1.BackendJwtUtilsExportModule,
|
23
|
+
microservices_1.ClientsModule.register([
|
24
|
+
Object.assign({ name: "USER_CLIENT" }, (0, nest_microservice_setup_util_1.getMicroserviceConnection)("")),
|
25
|
+
]),
|
26
|
+
],
|
27
|
+
})
|
28
|
+
], BackendJwtUtilsModule);
|
29
|
+
//# sourceMappingURL=backend-jwt-utils.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"backend-jwt-utils.module.js","sourceRoot":"","sources":["../../src/lib/backend-jwt-utils.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,yDAAsD;AACtD,yFAAiF;AACjF,0EAAqE;AACrE,4DAAwD;AACxD,yDAAqD;AACrD,6FAAuF;AACvF,2DAA2D;AAgBpD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAdjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,2CAAmB,EAAE,0BAAW,EAAE,0BAAW,CAAC;QAC1D,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,OAAO,EAAE;YACP,GAAG,8DAA2B;YAC9B,6BAAa,CAAC,QAAQ,CAAC;gBACrB,gBACE,IAAI,EAAE,aAAa,IAChB,IAAA,wDAAyB,EAAC,EAAE,CAAC,CAC1B;aACT,CAAC;SACH;KACF,CAAC;GACW,qBAAqB,CAAG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const CurrentUser: (...dataOrPipes: any[]) => ParameterDecorator;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CurrentUser = void 0;
|
4
|
+
const common_1 = require("@nestjs/common");
|
5
|
+
exports.CurrentUser = (0, common_1.createParamDecorator)((data, context) => context.switchToHttp().getRequest().user);
|
6
|
+
//# sourceMappingURL=current-user-decorator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"current-user-decorator.js","sourceRoot":"","sources":["../../src/lib/current-user-decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAE3D,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC7C,CAAC,IAAS,EAAE,OAAyB,EAAE,EAAE,CACvC,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC,IAAI,CAC3C,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ClientKafka, ClientProxy } from '@nestjs/microservices';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
export declare class CommunicationHelper {
|
4
|
+
private userClient;
|
5
|
+
constructor(userClient: ClientProxy | ClientKafka | any);
|
6
|
+
sendMessageForResponse<DATA_TYPE, RESPONSE_TYPE>(pattern: string, data: DATA_TYPE): Observable<RESPONSE_TYPE>;
|
7
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CommunicationHelper = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const common_1 = require("@nestjs/common");
|
6
|
+
const microservices_1 = require("@nestjs/microservices");
|
7
|
+
const rxjs_1 = require("rxjs");
|
8
|
+
let CommunicationHelper = class CommunicationHelper {
|
9
|
+
constructor(userClient) {
|
10
|
+
this.userClient = userClient;
|
11
|
+
}
|
12
|
+
sendMessageForResponse(pattern, data) {
|
13
|
+
if (this.userClient instanceof microservices_1.ClientProxy) {
|
14
|
+
return this.userClient.send(pattern, data);
|
15
|
+
}
|
16
|
+
if (this.userClient instanceof microservices_1.ClientKafka) {
|
17
|
+
return this.userClient.send(pattern, data);
|
18
|
+
}
|
19
|
+
return new rxjs_1.Observable((a) => a.error('UBS: Unknown data type'));
|
20
|
+
}
|
21
|
+
};
|
22
|
+
exports.CommunicationHelper = CommunicationHelper;
|
23
|
+
exports.CommunicationHelper = CommunicationHelper = tslib_1.__decorate([
|
24
|
+
(0, common_1.Injectable)(),
|
25
|
+
tslib_1.__param(0, (0, common_1.Inject)('USER_CLIENT')),
|
26
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
27
|
+
], CommunicationHelper);
|
28
|
+
//# sourceMappingURL=communication-handler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"communication-handler.js","sourceRoot":"","sources":["../../../src/lib/guards/communication-handler.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,yDAAiE;AACjE,+BAAkD;AAG3C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACiC,UAA2C;QAA3C,eAAU,GAAV,UAAU,CAAiC;IACzE,CAAC;IAEJ,sBAAsB,CACpB,OAAe,EACf,IAAe;QAEf,IAAI,IAAI,CAAC,UAAU,YAAY,2BAAW,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAA8B,CAAC;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,YAAY,2BAAW,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAA8B,CAAC;QAC1E,CAAC;QACD,OAAO,IAAI,iBAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAjBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;;GAFb,mBAAmB,CAiB/B"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.JwtAuthGuard = void 0;
|
4
|
+
const passport_1 = require("@nestjs/passport");
|
5
|
+
class JwtAuthGuard extends (0, passport_1.AuthGuard)('jwt') {
|
6
|
+
}
|
7
|
+
exports.JwtAuthGuard = JwtAuthGuard;
|
8
|
+
//# sourceMappingURL=jwt.guard.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jwt.guard.js","sourceRoot":"","sources":["../../../src/lib/guards/jwt.guard.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAE7C,MAAa,YAAa,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;CAAG;AAArD,oCAAqD"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { OnModuleInit } from "@nestjs/common";
|
2
|
+
import { ClientProxy, ClientKafka, ClientRMQ } from "@nestjs/microservices";
|
3
|
+
import { UserDTO } from "@ubs-platform/users-common";
|
4
|
+
export declare class UserService implements OnModuleInit {
|
5
|
+
private userClient;
|
6
|
+
constructor(userClient: ClientProxy | ClientKafka | ClientRMQ | any);
|
7
|
+
onModuleInit(): void;
|
8
|
+
findUserAuth(userId: any): Promise<UserDTO>;
|
9
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UserService = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const common_1 = require("@nestjs/common");
|
6
|
+
const rxjs_1 = require("rxjs");
|
7
|
+
let UserService = class UserService {
|
8
|
+
constructor(userClient) {
|
9
|
+
this.userClient = userClient;
|
10
|
+
}
|
11
|
+
onModuleInit() {
|
12
|
+
var _a, _b;
|
13
|
+
(_b = (_a = this.userClient).subscribeToResponseOf) === null || _b === void 0 ? void 0 : _b.call(_a, "user-by-id");
|
14
|
+
}
|
15
|
+
findUserAuth(userId) {
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
17
|
+
console.debug("Fetching user");
|
18
|
+
const user = (yield (0, rxjs_1.firstValueFrom)(this.userClient.send("user-by-id", userId)));
|
19
|
+
console.debug(`The request made by: ${user.name} ${user.surname}`);
|
20
|
+
return user;
|
21
|
+
});
|
22
|
+
}
|
23
|
+
};
|
24
|
+
exports.UserService = UserService;
|
25
|
+
exports.UserService = UserService = tslib_1.__decorate([
|
26
|
+
(0, common_1.Injectable)(),
|
27
|
+
tslib_1.__param(0, (0, common_1.Inject)("USER_CLIENT")),
|
28
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
29
|
+
], UserService);
|
30
|
+
//# sourceMappingURL=user.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../src/lib/service/user.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAIlE,+BAAsC;AAG/B,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAEU,UAAuD;QAAvD,eAAU,GAAV,UAAU,CAA6C;IAC9D,CAAC;IACJ,YAAY;;QACV,MAAA,MAAC,IAAI,CAAC,UAA0B,EAAC,qBAAqB,mDAAG,YAAY,CAAC,CAAC;IACzE,CAAC;IAEK,YAAY,CAAC,MAAW;;YAC5B,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC/B,MAAM,IAAI,GAAG,CAAC,MAAM,IAAA,qBAAc,EAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAC3C,CAAY,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF,CAAA;AAjBY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;;GAFb,WAAW,CAiBvB"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { UserService } from "../service/user.service";
|
2
|
+
import { UserDTO } from "@ubs-platform/users-common";
|
3
|
+
declare const JwtStrategy_base: new (...args: any[]) => any;
|
4
|
+
export declare class JwtStrategy extends JwtStrategy_base {
|
5
|
+
private userService;
|
6
|
+
constructor(userService: UserService);
|
7
|
+
validate(validationPayload: {
|
8
|
+
userId: any;
|
9
|
+
}): Promise<UserDTO>;
|
10
|
+
}
|
11
|
+
export {};
|
@@ -0,0 +1,30 @@
|
|
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 user_service_1 = require("../service/user.service");
|
9
|
+
const jwt_consts_1 = require("../utils/jwt-consts");
|
10
|
+
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) {
|
11
|
+
constructor(userService) {
|
12
|
+
super({
|
13
|
+
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
|
14
|
+
ignoreExpiration: false,
|
15
|
+
secretOrKey: jwt_consts_1.SECRET_JWT,
|
16
|
+
});
|
17
|
+
this.userService = userService;
|
18
|
+
}
|
19
|
+
validate(validationPayload) {
|
20
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
21
|
+
return this.userService.findUserAuth(validationPayload.userId);
|
22
|
+
});
|
23
|
+
}
|
24
|
+
};
|
25
|
+
exports.JwtStrategy = JwtStrategy;
|
26
|
+
exports.JwtStrategy = JwtStrategy = tslib_1.__decorate([
|
27
|
+
(0, common_1.Injectable)({}),
|
28
|
+
tslib_1.__metadata("design:paramtypes", [user_service_1.UserService])
|
29
|
+
], JwtStrategy);
|
30
|
+
//# sourceMappingURL=jwt.strategy.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../src/lib/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAE3D,+CAAoD;AACpD,+CAAoD;AAEpD,0DAAsD;AACtD,oDAAiD;AAI1C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAAoB,WAAwB;QAC1C,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,uBAAU;SACxB,CAAC,CAAC;QALe,gBAAW,GAAX,WAAW,CAAa;IAM5C,CAAC;IAEK,QAAQ,CAAC,iBAAkC;;YAC/C,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACjE,CAAC;KAAA;CACF,CAAA;AAZY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,EAAC,EAAE,CAAC;6CAEoB,0BAAW;GADjC,WAAW,CAYvB"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SECRET_PW = exports.SECRET_JWT = void 0;
|
4
|
+
exports.SECRET_JWT = process.env["NX_SECRET_JWT"];
|
5
|
+
exports.SECRET_PW = process.env["NX_SECRET_PW"];
|
6
|
+
//# sourceMappingURL=jwt-consts.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jwt-consts.js","sourceRoot":"","sources":["../../../src/lib/utils/jwt-consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC1C,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC"}
|
package/jest.config.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
export default {
|
3
|
+
displayName: 'roles',
|
4
|
+
preset: '../../jest.preset.js',
|
5
|
+
testEnvironment: 'node',
|
6
|
+
transform: {
|
7
|
+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
8
|
+
},
|
9
|
+
moduleFileExtensions: ['ts', 'js', 'html'],
|
10
|
+
coverageDirectory: '../../coverage/libs/roles',
|
11
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "@ubs-platform/users-mona-microservice-helper",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"private": false,
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"license": "MIT",
|
7
|
+
"author": "Unlimited Bundle Systems",
|
8
|
+
"homepage": "https://github.com/ubs-platform/users-mona-microservice-helper",
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "https://github.com/ubs-platform/users-mona-microservice-helper"
|
12
|
+
},
|
13
|
+
"scripts": {
|
14
|
+
"build": "tsc",
|
15
|
+
"build-publish": "npm run build && npm publish"
|
16
|
+
},
|
17
|
+
"peerDependencies": {
|
18
|
+
"@nestjs/common": "^10.0.2",
|
19
|
+
"@nestjs/core": "^10.0.2",
|
20
|
+
"@nestjs/jwt": "^10.2.0",
|
21
|
+
"@nestjs/microservices": "^10.3.3",
|
22
|
+
"@nestjs/mongoose": "^10.0.4",
|
23
|
+
"@nestjs/passport": "^10.0.3",
|
24
|
+
"@nestjs/platform-express": "^10.0.2",
|
25
|
+
"@ubs-platform/nest-microservice-setup-util": "1.0.6",
|
26
|
+
"@ubs-platform/users-common": "1.0.8",
|
27
|
+
"@ubs-platform/users-mona-roles": "1.0.1",
|
28
|
+
"passport-jwt": "^4.0.1",
|
29
|
+
"rxjs": "^7.8.0"
|
30
|
+
},
|
31
|
+
"dependencies": {
|
32
|
+
"tslib": "^2.3.0",
|
33
|
+
"crypto-promise": "^2.1.0"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"typescript": "~5.3.2",
|
37
|
+
"@types/node": "~18.16.9"
|
38
|
+
},
|
39
|
+
"publishConfig": {
|
40
|
+
"access": "public"
|
41
|
+
}
|
42
|
+
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"compileOnSave": false,
|
3
|
+
"compilerOptions": {
|
4
|
+
"rootDir": "./src",
|
5
|
+
"sourceMap": true,
|
6
|
+
"moduleResolution": "node",
|
7
|
+
"emitDecoratorMetadata": true,
|
8
|
+
"experimentalDecorators": true,
|
9
|
+
"importHelpers": true,
|
10
|
+
"target": "es2015",
|
11
|
+
"module": "commonjs",
|
12
|
+
"outDir": "./dist",
|
13
|
+
"lib": ["es2020", "dom"],
|
14
|
+
"skipLibCheck": true,
|
15
|
+
"skipDefaultLibCheck": true,
|
16
|
+
"declaration": true,
|
17
|
+
"types": ["node"]
|
18
|
+
},
|
19
|
+
"exclude": [
|
20
|
+
"node_modules",
|
21
|
+
"tmp",
|
22
|
+
"jest.config.ts",
|
23
|
+
"src/**/*.spec.ts",
|
24
|
+
"src/**/*.test.ts"
|
25
|
+
],
|
26
|
+
"include": ["src/**/*.ts"]
|
27
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"compilerOptions": {
|
4
|
+
"outDir": "../../dist/out-tsc",
|
5
|
+
"declaration": true,
|
6
|
+
"types": ["node"],
|
7
|
+
"target": "es2021",
|
8
|
+
"strictNullChecks": true,
|
9
|
+
"noImplicitAny": true,
|
10
|
+
"strictBindCallApply": true,
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
12
|
+
"noFallthroughCasesInSwitch": true
|
13
|
+
},
|
14
|
+
"include": ["src/**/*.ts"],
|
15
|
+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
16
|
+
}
|