@hemia/jwt-manager 0.0.1
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 +90 -0
- package/dist/hemia-jwt-manager.esm.js +5845 -0
- package/dist/hemia-jwt-manager.js +5847 -0
- package/dist/types/Enums/Enums.d.ts +1 -0
- package/dist/types/Enums/Operatives.d.ts +3 -0
- package/dist/types/config/jwt.config.d.ts +5 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/mixin/jwt.mixin.d.ts +6 -0
- package/dist/types/services/jwt.service.d.ts +13 -0
- package/dist/types/types/jwt-payload.d.ts +9 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Operatives } from "./Operatives";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
2
|
+
export declare class Mixin {
|
|
3
|
+
protected createBasicToken(payload: string | Buffer | object, secret: string, expiresIn: any | number, options?: SignOptions): string;
|
|
4
|
+
protected validateTokenBase(token: string, secretKey: string): JwtPayload | null;
|
|
5
|
+
decodeToken(token: string): JwtPayload | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
2
|
+
import { Operatives } from '../Enums/Enums';
|
|
3
|
+
import { Mixin } from '../mixin/jwt.mixin';
|
|
4
|
+
export declare class JwtManager extends Mixin {
|
|
5
|
+
private _secretKey;
|
|
6
|
+
constructor();
|
|
7
|
+
getTokenWithoutKey(payload: object, expiresIn?: string | number, options?: SignOptions): string;
|
|
8
|
+
getTokenWithKey(payload: object, secretKey: string, expiresIn?: string | number, options?: SignOptions): string;
|
|
9
|
+
getTokenCleanCredentials(operative?: Operatives, expiresIn?: string | number): string;
|
|
10
|
+
validateToken(token: string, secretKey?: string): JwtPayload | null;
|
|
11
|
+
decode(token: string): JwtPayload | null;
|
|
12
|
+
getJwtKey(): string;
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hemia/jwt-manager",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Gestor de JWT seguro y extensible para aplicaciones Node.js",
|
|
5
|
+
"main": "dist/hemia-jwt-manager.js",
|
|
6
|
+
"module": "dist/hemia-jwt-manager.esm.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "rimraf dist",
|
|
10
|
+
"tscBuild": "rollup -c",
|
|
11
|
+
"build": "npm run clean && npm run tscBuild",
|
|
12
|
+
"test": "jest",
|
|
13
|
+
"coverage": "nyc npm run test",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"nyc": {
|
|
17
|
+
"reporter": [
|
|
18
|
+
"lcov",
|
|
19
|
+
"text"
|
|
20
|
+
],
|
|
21
|
+
"include": [
|
|
22
|
+
"src/**/*.ts"
|
|
23
|
+
],
|
|
24
|
+
"exclude": [
|
|
25
|
+
"test/**/*.ts"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"jwt",
|
|
30
|
+
"jsonwebtoken",
|
|
31
|
+
"auth",
|
|
32
|
+
"security",
|
|
33
|
+
"typescript",
|
|
34
|
+
"hemia"
|
|
35
|
+
],
|
|
36
|
+
"author": "Hemia Technologies",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"jsonwebtoken": "^9.0.2",
|
|
40
|
+
"@types/jsonwebtoken": "^9.0.7"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
|
|
44
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
45
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
46
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
47
|
+
"@types/chai": "^4.3.17",
|
|
48
|
+
"@types/jest": "^29.5.14",
|
|
49
|
+
"@types/mocha": "^10.0.7",
|
|
50
|
+
"@types/node": "^22.3.0",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
|
52
|
+
"chai": "^4.2.0",
|
|
53
|
+
"events": "^3.3.0",
|
|
54
|
+
"jest": "^29.7.0",
|
|
55
|
+
"mocha": "^10.7.3",
|
|
56
|
+
"rimraf": "^6.0.1",
|
|
57
|
+
"rollup": "^4.20.0",
|
|
58
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
59
|
+
"ts-jest": "^29.2.5",
|
|
60
|
+
"ts-node": "^8.9.0",
|
|
61
|
+
"typescript": "^5.5.4"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist"
|
|
65
|
+
],
|
|
66
|
+
"overrides": {
|
|
67
|
+
"glob": "10.4.2"
|
|
68
|
+
}
|
|
69
|
+
}
|