@hemia/auth-sdk 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.
@@ -0,0 +1,9 @@
1
+ export interface ISessionUser {
2
+ sub: string;
3
+ email: string;
4
+ name: string;
5
+ given_name?: string;
6
+ family_name?: string;
7
+ picture?: string;
8
+ [key: string]: any;
9
+ }
@@ -0,0 +1,29 @@
1
+ export interface StandardClaims {
2
+ sub: string;
3
+ name?: string;
4
+ given_name?: string;
5
+ family_name?: string;
6
+ middle_name?: string;
7
+ nickname?: string;
8
+ preferred_username?: string;
9
+ profile?: string;
10
+ picture?: string;
11
+ website?: string;
12
+ gender?: string;
13
+ birthdate?: string;
14
+ zoneinfo?: string;
15
+ locale?: string;
16
+ updated_at?: number;
17
+ email?: string;
18
+ email_verified?: boolean;
19
+ phone_number?: string;
20
+ phone_number_verified?: boolean;
21
+ address?: {
22
+ formatted?: string;
23
+ street_address?: string;
24
+ locality?: string;
25
+ region?: string;
26
+ postal_code?: string;
27
+ country?: string;
28
+ };
29
+ }
@@ -0,0 +1,4 @@
1
+ export interface IStoredState {
2
+ state: string;
3
+ codeVerifier: string;
4
+ }
@@ -0,0 +1,9 @@
1
+ export interface ITokenResponse {
2
+ access_token: string;
3
+ token_type: string;
4
+ expires_in: number;
5
+ refresh_token?: string;
6
+ id_token?: string;
7
+ scope?: string;
8
+ session_id?: string;
9
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Utilidades para manejo de PKCE y codificación Base64URL
3
+ */
4
+ export declare class Generators {
5
+ /**
6
+ * Base64URL Encoding
7
+ * Reemplaza la implementación manual con Buffer de Node.js
8
+ */
9
+ static base64urlEncode(strOrBuffer: string | Buffer): string;
10
+ /**
11
+ * Genera un Code Verifier para el flujo PKCE (OAuth 2.0).
12
+ * Crea una cadena aleatoria de 43 a 128 caracteres, codificada en Base64URL.
13
+ */
14
+ static generateCodeVerifier(): string;
15
+ /**
16
+ * Generate Code Challenge (SHA-256)
17
+ */
18
+ static generateCodeChallenge(verifier: string): string;
19
+ /**
20
+ * Genera un estado aleatorio para la protección CSRF.
21
+ */
22
+ static state(): string;
23
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@hemia/auth-sdk",
3
+ "version": "0.0.1",
4
+ "description": "Hemia SDK for authentication",
5
+ "main": "dist/hemia-auth-sdk.js",
6
+ "module": "dist/hemia-auth-sdk.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 --detectOpenHandles",
13
+ "test:coverage": "jest --coverage",
14
+ "test:watch": "jest --watch"
15
+ },
16
+ "devDependencies": {
17
+ "@rollup/plugin-commonjs": "^26.0.1",
18
+ "@rollup/plugin-json": "^6.1.0",
19
+ "@rollup/plugin-node-resolve": "^15.2.3",
20
+ "@types/jest": "^29.5.14",
21
+ "@types/node": "^22.3.0",
22
+ "@typescript-eslint/eslint-plugin": "^8.5.0",
23
+ "@hemia/network-services": "^0.0.3",
24
+ "@hemia/jwt-manager": "^0.0.4",
25
+ "@hemia/common": "^0.0.2",
26
+ "@hemia/cache-manager": "^0.0.5",
27
+ "@types/express": "^4.17.21",
28
+ "express": "^5.2.1",
29
+ "events": "^3.3.0",
30
+ "inversify": "^7.11.0",
31
+ "jest": "^29.7.0",
32
+ "rimraf": "^6.0.1",
33
+ "rollup": "^4.20.0",
34
+ "rollup-plugin-typescript2": "^0.36.0",
35
+ "ts-jest": "^29.2.5",
36
+ "ts-node": "^8.9.0",
37
+ "typescript": "^5.5.4"
38
+ },
39
+ "author": "",
40
+ "license": "ISC",
41
+ "files": [
42
+ "dist"
43
+ ],
44
+ "peerDependencies": {
45
+ "reflect-metadata": "^0.2.2",
46
+ "inversify": "^7.11.0",
47
+ "@hemia/common": "^0.0.1",
48
+ "@hemia/network-services": "^0.0.3",
49
+ "@hemia/jwt-manager": "^0.0.4"
50
+ },
51
+ "dependencies": {
52
+
53
+ }
54
+ }