use ports package
This commit is contained in:
parent
737d69e788
commit
bdaacf5ff2
11
package-lock.json
generated
11
package-lock.json
generated
@ -1,14 +1,15 @@
|
||||
{
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apihub24/authentication": "^1.0.1",
|
||||
"@apihub24/token-authentication": "^1.0.4",
|
||||
"@nestjs/common": "^11.1.6",
|
||||
"@nestjs/config": "^4.0.2",
|
||||
@ -37,6 +38,12 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@apihub24/authentication": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@apihub24/authentication/-/authentication-1.0.1.tgz",
|
||||
"integrity": "sha512-nWw75ofQKHxE0dI7PzvNBQNcQrX/HSrzuAJTYNu42BoCROba1NUz8QAodTn5+3dIeQEzw127gtSb6D7yW0B8Jg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@apihub24/repository": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@apihub24/repository/-/repository-1.0.3.tgz",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@ -14,7 +14,7 @@
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.1.6",
|
||||
"@nestjs/config": "^4.0.2",
|
||||
"@apihub24/token-authentication": "^1.0.4",
|
||||
"@apihub24/authentication": "^1.0.1",
|
||||
"bcrypt": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { IPasswordService } from "@apihub24/token-authentication";
|
||||
import { IPasswordService } from "@apihub24/authentication";
|
||||
import { Inject, Injectable } from "@nestjs/common";
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import bcrypt from "bcrypt";
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import {
|
||||
APIHUB24_PASSWORD_SERVICE_INJECTION_KEY,
|
||||
PasswordHasherModule,
|
||||
} from "./";
|
||||
import { PasswordHasherModule } from "./";
|
||||
|
||||
describe("PasswordHasherModule Tests", () => {
|
||||
let module: TestingModule | null = null;
|
||||
@ -13,10 +10,6 @@ describe("PasswordHasherModule Tests", () => {
|
||||
}).compile();
|
||||
});
|
||||
|
||||
it("should export injection Key", () => {
|
||||
expect(APIHUB24_PASSWORD_SERVICE_INJECTION_KEY).toBeDefined();
|
||||
});
|
||||
|
||||
it("should get PasswordHasherService by injection Key @apihub24/password_service", () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get("@apihub24/password_service");
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
import { DynamicModule, Global, Module } from "@nestjs/common";
|
||||
import { PasswordHashService } from "./password.hash.service";
|
||||
import { ConfigModule } from "@nestjs/config";
|
||||
|
||||
export const APIHUB24_PASSWORD_SERVICE_INJECTION_KEY =
|
||||
"@apihub24/password_service";
|
||||
import { APIHUB24_PASSWORD_SERVICE } from "@apihub24/authentication";
|
||||
|
||||
@Global()
|
||||
@Module({})
|
||||
@ -11,7 +9,7 @@ export class PasswordHasherModule {
|
||||
static forRoot(): DynamicModule {
|
||||
const providers = [
|
||||
{
|
||||
provide: APIHUB24_PASSWORD_SERVICE_INJECTION_KEY,
|
||||
provide: APIHUB24_PASSWORD_SERVICE,
|
||||
useClass: PasswordHashService,
|
||||
},
|
||||
];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user