@gh-platform/auth-sdk 1.0.3 → 1.0.5

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/dist/index.d.ts CHANGED
@@ -24,12 +24,26 @@ export interface TokenData {
24
24
  message?: string;
25
25
  [key: string]: any;
26
26
  }
27
-
27
+ export interface UserMetadata {
28
+ address?: string;
29
+ phone?: string;
30
+ telegram?: string;
31
+ theme?: string;
32
+ [key: string]: any; // cho phép mở rộng metadata
33
+ }
34
+ export interface UserInfo {
35
+ id: string;
36
+ email: string;
37
+ username: string;
38
+ display_name: number;
39
+ metadata?: UserMetadata;
40
+ roles: string[];
41
+ }
28
42
  export interface AuthResponse {
29
43
  status: string; // "success" | "error"
30
44
  code: number; // HTTP-like status code
31
45
  message: string;
32
- data: TokenData;
46
+ data: TokenData | UserInfo;
33
47
  }
34
48
 
35
49
  export class TokenStorage {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gh-platform/auth-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "VanillaJS Auth SDK for GH Platform",
5
5
  "type": "module",
6
6
  "main": "dist/auth-sdk.umd.js",
package/src/index.d.ts CHANGED
@@ -24,12 +24,26 @@ export interface TokenData {
24
24
  message?: string;
25
25
  [key: string]: any;
26
26
  }
27
-
27
+ export interface UserMetadata {
28
+ address?: string;
29
+ phone?: string;
30
+ telegram?: string;
31
+ theme?: string;
32
+ [key: string]: any; // cho phép mở rộng metadata
33
+ }
34
+ export interface UserInfo {
35
+ id: string;
36
+ email: string;
37
+ username: string;
38
+ display_name: number;
39
+ metadata?: UserMetadata;
40
+ roles: string[];
41
+ }
28
42
  export interface AuthResponse {
29
43
  status: string; // "success" | "error"
30
44
  code: number; // HTTP-like status code
31
45
  message: string;
32
- data: TokenData;
46
+ data: TokenData | UserInfo;
33
47
  }
34
48
 
35
49
  export class TokenStorage {