@bigso/auth-sdk 0.5.1 → 0.5.3

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,81 @@
1
+ interface BigsoAuthOptions {
2
+ clientId: string;
3
+ ssoOrigin: string;
4
+ jwksUrl: string;
5
+ timeout?: number;
6
+ debug?: boolean;
7
+ redirectUri?: string;
8
+ tenantHint?: string;
9
+ theme?: 'light' | 'dark';
10
+ }
11
+ interface SsoUser {
12
+ userId: string;
13
+ email: string;
14
+ firstName: string;
15
+ lastName: string;
16
+ }
17
+ interface SsoTenant {
18
+ tenantId: string;
19
+ name: string;
20
+ slug: string;
21
+ role: string;
22
+ }
23
+ interface SsoJwtTenant {
24
+ id: string;
25
+ name: string;
26
+ slug: string;
27
+ role: string;
28
+ apps: string[];
29
+ }
30
+ interface SsoTokenPayload {
31
+ sub: string;
32
+ jti: string;
33
+ iss: string;
34
+ aud: string;
35
+ exp: number;
36
+ iat: number;
37
+ tenants: SsoJwtTenant[];
38
+ systemRole: string;
39
+ scope?: string[];
40
+ deviceFingerprint?: string;
41
+ }
42
+ interface V2LoginResponse {
43
+ success: boolean;
44
+ tokens: {
45
+ accessToken: string;
46
+ expiresIn: number;
47
+ };
48
+ user: SsoUser;
49
+ }
50
+ interface V2ExchangeResponse {
51
+ success: boolean;
52
+ tokens: {
53
+ accessToken: string;
54
+ refreshToken: string;
55
+ expiresIn: number;
56
+ };
57
+ user: SsoUser;
58
+ tenant: SsoTenant;
59
+ }
60
+ interface V2RefreshResponse {
61
+ success: boolean;
62
+ tokens: {
63
+ accessToken: string;
64
+ expiresIn: number;
65
+ };
66
+ }
67
+ interface BigsoAuthResult {
68
+ code: string;
69
+ state: string;
70
+ nonce: string;
71
+ codeVerifier: string;
72
+ signed_payload: string;
73
+ tenant?: SsoTenant;
74
+ jti?: string;
75
+ iss?: string;
76
+ aud?: string;
77
+ exp?: number;
78
+ iat?: number;
79
+ }
80
+
81
+ export type { BigsoAuthOptions as B, SsoJwtTenant as S, V2ExchangeResponse as V, BigsoAuthResult as a, SsoTokenPayload as b, V2LoginResponse as c, V2RefreshResponse as d };
@@ -0,0 +1,81 @@
1
+ interface BigsoAuthOptions {
2
+ clientId: string;
3
+ ssoOrigin: string;
4
+ jwksUrl: string;
5
+ timeout?: number;
6
+ debug?: boolean;
7
+ redirectUri?: string;
8
+ tenantHint?: string;
9
+ theme?: 'light' | 'dark';
10
+ }
11
+ interface SsoUser {
12
+ userId: string;
13
+ email: string;
14
+ firstName: string;
15
+ lastName: string;
16
+ }
17
+ interface SsoTenant {
18
+ tenantId: string;
19
+ name: string;
20
+ slug: string;
21
+ role: string;
22
+ }
23
+ interface SsoJwtTenant {
24
+ id: string;
25
+ name: string;
26
+ slug: string;
27
+ role: string;
28
+ apps: string[];
29
+ }
30
+ interface SsoTokenPayload {
31
+ sub: string;
32
+ jti: string;
33
+ iss: string;
34
+ aud: string;
35
+ exp: number;
36
+ iat: number;
37
+ tenants: SsoJwtTenant[];
38
+ systemRole: string;
39
+ scope?: string[];
40
+ deviceFingerprint?: string;
41
+ }
42
+ interface V2LoginResponse {
43
+ success: boolean;
44
+ tokens: {
45
+ accessToken: string;
46
+ expiresIn: number;
47
+ };
48
+ user: SsoUser;
49
+ }
50
+ interface V2ExchangeResponse {
51
+ success: boolean;
52
+ tokens: {
53
+ accessToken: string;
54
+ refreshToken: string;
55
+ expiresIn: number;
56
+ };
57
+ user: SsoUser;
58
+ tenant: SsoTenant;
59
+ }
60
+ interface V2RefreshResponse {
61
+ success: boolean;
62
+ tokens: {
63
+ accessToken: string;
64
+ expiresIn: number;
65
+ };
66
+ }
67
+ interface BigsoAuthResult {
68
+ code: string;
69
+ state: string;
70
+ nonce: string;
71
+ codeVerifier: string;
72
+ signed_payload: string;
73
+ tenant?: SsoTenant;
74
+ jti?: string;
75
+ iss?: string;
76
+ aud?: string;
77
+ exp?: number;
78
+ iat?: number;
79
+ }
80
+
81
+ export type { BigsoAuthOptions as B, SsoJwtTenant as S, V2ExchangeResponse as V, BigsoAuthResult as a, SsoTokenPayload as b, V2LoginResponse as c, V2RefreshResponse as d };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigso/auth-sdk",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "SDK de autenticación para SSO v2 - JWT Bearer + PKCE",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -38,6 +38,7 @@
38
38
  "scripts": {
39
39
  "build": "tsup src/browser/index.ts src/node/index.ts src/express/index.ts --format esm,cjs --dts --out-dir dist",
40
40
  "dev": "tsup src/browser/index.ts src/node/index.ts src/express/index.ts --watch --out-dir dist",
41
+ "prepublishOnly": "npm run build",
41
42
  "lint": "eslint .",
42
43
  "test": "vitest",
43
44
  "release": "git tag v$npm_package_version && git push origin v$npm_package_version"