use ports package
This commit is contained in:
parent
3c7e98642f
commit
99d59d92f0
99
package-lock.json
generated
99
package-lock.json
generated
@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "@apihub24/in-memory-sessions",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@apihub24/in-memory-sessions",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apihub24/token-authentication": "^1.0.4",
|
||||
"@apihub24/authentication": "^1.0.1",
|
||||
"@nestjs/common": "^11.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -35,25 +35,12 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@apihub24/repository": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@apihub24/repository/-/repository-1.0.3.tgz",
|
||||
"integrity": "sha512-m2twcVPrdnKAcnNQFabGzQ/18/kQUEtuqAuSzVBTEc3mxBKBQ5ex1+Cx4JP/sZ1HqdS4GisFXDa8zfrnpdcLaA==",
|
||||
"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/token-authentication": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@apihub24/token-authentication/-/token-authentication-1.0.4.tgz",
|
||||
"integrity": "sha512-4v572LBbk9mDAthrYcI7wbm45gVki2GvZJUCKZPG7fYjR33M67+JtaVaLHy5jQ47QtOo1FF7cdF69wEq6nnn1g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apihub24/repository": "^1.0.3",
|
||||
"@nestjs/common": "^11.1.6",
|
||||
"@nestjs/config": "^4.0.2",
|
||||
"@nestjs/core": "^11.1.6",
|
||||
"class-validator": "^0.14.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
|
||||
@ -1096,27 +1083,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/config": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/config/-/config-4.0.2.tgz",
|
||||
"integrity": "sha512-McMW6EXtpc8+CwTUwFdg6h7dYcBUpH5iUILCclAsa+MbCEvC9ZKu4dCHRlJqALuhjLw97pbQu62l4+wRwGeZqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dotenv": "16.4.7",
|
||||
"dotenv-expand": "12.0.1",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
||||
"rxjs": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/core": {
|
||||
"version": "11.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.6.tgz",
|
||||
"integrity": "sha512-siWX7UDgErisW18VTeJA+x+/tpNZrJewjTBsRPF3JVxuWRuAB1kRoiJcxHgln8Lb5UY9NdvklITR84DUEXD0Cg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@nuxt/opencollective": "0.4.1",
|
||||
"fast-safe-stringify": "2.1.1",
|
||||
@ -1184,7 +1158,9 @@
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz",
|
||||
"integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"consola": "^3.2.3"
|
||||
},
|
||||
@ -1386,7 +1362,9 @@
|
||||
"version": "13.15.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.2.tgz",
|
||||
"integrity": "sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q==",
|
||||
"license": "MIT"
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@types/yargs": {
|
||||
"version": "17.0.33",
|
||||
@ -2037,6 +2015,8 @@
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.2.tgz",
|
||||
"integrity": "sha512-3kMVRF2io8N8pY1IFIXlho9r8IPUUIfHe2hYVtiebvAzU2XeQFXTv+XI4WX+TnXmtwXMDcjngcpkiPM0O9PvLw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/validator": "^13.11.8",
|
||||
"libphonenumber-js": "^1.11.1",
|
||||
@ -2170,7 +2150,9 @@
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
|
||||
"integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >=16.10.0"
|
||||
}
|
||||
@ -2249,33 +2231,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.4.7",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
||||
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv-expand": {
|
||||
"version": "12.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.1.tgz",
|
||||
"integrity": "sha512-LaKRbou8gt0RNID/9RoI+J2rvXsBRPMV7p+ElHlPhcSARbCPDYcYG2s1TIzAfWv4YSgyY5taidWzzs31lNV3yQ==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.4.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/eastasianwidth": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||
@ -2424,7 +2379,9 @@
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
|
||||
"integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
|
||||
"license": "MIT"
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/fb-watchman": {
|
||||
"version": "2.0.2",
|
||||
@ -3555,7 +3512,9 @@
|
||||
"version": "1.12.13",
|
||||
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.13.tgz",
|
||||
"integrity": "sha512-QZXnR/OGiDcBjF4hGk0wwVrPcZvbSSyzlvkjXv5LFfktj7O2VZDrt4Xs8SgR/vOFco+qk1i8J43ikMXZoTrtPw==",
|
||||
"license": "MIT"
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/lines-and-columns": {
|
||||
"version": "1.2.4",
|
||||
@ -3596,12 +3555,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.memoize": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
|
||||
@ -3970,7 +3923,9 @@
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
|
||||
"integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
@ -4891,6 +4846,8 @@
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz",
|
||||
"integrity": "sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apihub24/in-memory-sessions",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@ -12,7 +12,7 @@
|
||||
"rel": "npm i && npm run build && npm run test:coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apihub24/token-authentication": "^1.0.4",
|
||||
"@apihub24/authentication": "^1.0.1",
|
||||
"@nestjs/common": "^11.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
import {
|
||||
IAccount,
|
||||
ISession,
|
||||
ISessionService,
|
||||
} from "@apihub24/token-authentication";
|
||||
import { IAccount, ISession, ISessionService } from "@apihub24/authentication";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@Injectable()
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
import { TestingModule, Test } from "@nestjs/testing";
|
||||
import {
|
||||
InMemorySessionsModule,
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY,
|
||||
} from "./";
|
||||
import { InMemorySessionsModule } from "./";
|
||||
|
||||
describe("InMemorySessionsModule Tests", () => {
|
||||
let module: TestingModule | null = null;
|
||||
@ -13,10 +10,6 @@ describe("InMemorySessionsModule Tests", () => {
|
||||
}).compile();
|
||||
});
|
||||
|
||||
it("should export injection Key @apihub24/session_service", () => {
|
||||
expect(APIHUB24_SESSION_SERVICE_INJECTION_KEY).toBeDefined();
|
||||
});
|
||||
|
||||
it("should get InMemorySessionService by injection Key", () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get("@apihub24/session_service");
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { DynamicModule, Global, Module } from "@nestjs/common";
|
||||
import { InMemorySessionService } from "./in.memory.session.service";
|
||||
|
||||
export const APIHUB24_SESSION_SERVICE_INJECTION_KEY =
|
||||
"@apihub24/session_service";
|
||||
import { APIHUB24_SESSION_SERVICE } from "@apihub24/authentication";
|
||||
|
||||
@Global()
|
||||
@Module({})
|
||||
@ -10,7 +8,7 @@ export class InMemorySessionsModule {
|
||||
static forRoot(): DynamicModule {
|
||||
const providers = [
|
||||
{
|
||||
provide: APIHUB24_SESSION_SERVICE_INJECTION_KEY,
|
||||
provide: APIHUB24_SESSION_SERVICE,
|
||||
useClass: InMemorySessionService,
|
||||
},
|
||||
];
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import {
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY,
|
||||
InMemorySessionService,
|
||||
InMemorySessionsModule,
|
||||
} from "./";
|
||||
import { InMemorySessionService, InMemorySessionsModule } from "./";
|
||||
import { APIHUB24_SESSION_SERVICE } from "@apihub24/authentication";
|
||||
|
||||
describe("InMemorySessionService Tests", () => {
|
||||
let module: TestingModule | null = null;
|
||||
@ -17,7 +14,7 @@ describe("InMemorySessionService Tests", () => {
|
||||
it("should create a new Session", async () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get<InMemorySessionService>(
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY
|
||||
APIHUB24_SESSION_SERVICE
|
||||
);
|
||||
expect(service).toBeDefined();
|
||||
|
||||
@ -39,7 +36,7 @@ describe("InMemorySessionService Tests", () => {
|
||||
it("should get Session by Id", async () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get<InMemorySessionService>(
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY
|
||||
APIHUB24_SESSION_SERVICE
|
||||
);
|
||||
expect(service).toBeDefined();
|
||||
|
||||
@ -60,7 +57,7 @@ describe("InMemorySessionService Tests", () => {
|
||||
it("should get Session by Filter", async () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get<InMemorySessionService>(
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY
|
||||
APIHUB24_SESSION_SERVICE
|
||||
);
|
||||
expect(service).toBeDefined();
|
||||
|
||||
@ -83,7 +80,7 @@ describe("InMemorySessionService Tests", () => {
|
||||
it("should remove Session", async () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get<InMemorySessionService>(
|
||||
APIHUB24_SESSION_SERVICE_INJECTION_KEY
|
||||
APIHUB24_SESSION_SERVICE
|
||||
);
|
||||
expect(service).toBeDefined();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user