@sparkstudio/authentication-ui 1.0.4 → 1.0.6
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.cjs +79 -3182
- package/dist/index.css +1 -1
- package/dist/index.d.cts +47 -30
- package/dist/index.d.ts +47 -30
- package/dist/index.js +100 -3211
- package/package.json +6 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.css
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare function UserInfoCard(): react_jsx_runtime.JSX.Element;
|
|
5
|
-
|
|
6
|
-
interface AuthenticatorProviderProps {
|
|
7
|
-
googleClientId: string;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Public entrypoint for consumers:
|
|
12
|
-
* Wraps children with Google OAuth + User context.
|
|
13
|
-
*/
|
|
14
|
-
declare function AuthenticatorProvider({ googleClientId, children, }: AuthenticatorProviderProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
interface LoginButtonProps {
|
|
17
|
-
onSuccess?: (tokenResponse: any) => void;
|
|
18
|
-
}
|
|
19
|
-
declare function LoginButton({ onSuccess }: LoginButtonProps): react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
21
4
|
/**
|
|
22
5
|
* Represents an Auto-generated model for UserDTO.
|
|
23
6
|
*/
|
|
@@ -36,15 +19,61 @@ declare class UserDTO implements IUserDTO {
|
|
|
36
19
|
constructor(init: UserDTOInit);
|
|
37
20
|
}
|
|
38
21
|
|
|
22
|
+
interface UserInfoCardProps {
|
|
23
|
+
onLogin?: (user: UserDTO) => void;
|
|
24
|
+
onLoginFailed?: (error: string) => void;
|
|
25
|
+
onLogout?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare function UserInfoCard({ onLogin, onLogout, onLoginFailed }: UserInfoCardProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface AuthenticatorProviderProps {
|
|
30
|
+
googleClientId: string;
|
|
31
|
+
apiUrl: string;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
onLoginSuccess?: (user: UserDTO | null) => void;
|
|
34
|
+
onLoginFailed?: (error: unknown) => void;
|
|
35
|
+
onLogoutSuccess?: () => void;
|
|
36
|
+
onLogoutFailed?: (error: unknown) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Public entrypoint for consumers:
|
|
40
|
+
* Wraps children with Google OAuth + User context.
|
|
41
|
+
*/
|
|
42
|
+
declare function AuthenticatorProvider({ googleClientId, apiUrl, children, onLoginSuccess, onLoginFailed, onLogoutSuccess, onLogoutFailed, }: AuthenticatorProviderProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Represents an Auto-generated model for AuthResponse.
|
|
46
|
+
*/
|
|
47
|
+
interface IAuthResponse {
|
|
48
|
+
User: UserDTO;
|
|
49
|
+
}
|
|
50
|
+
type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
|
|
51
|
+
declare class AuthResponse implements IAuthResponse {
|
|
52
|
+
User: UserDTO;
|
|
53
|
+
constructor(init: AuthResponseInit);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface LoginButtonProps {
|
|
57
|
+
onLogin?: (user: AuthResponse["User"]) => void;
|
|
58
|
+
onLoginFailed?: (error: any) => void;
|
|
59
|
+
}
|
|
60
|
+
declare function LoginButton({ onLogin, onLoginFailed }: LoginButtonProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
39
62
|
interface UserContextType {
|
|
40
63
|
user: UserDTO | null;
|
|
41
64
|
setUser: (user: UserDTO | null) => void;
|
|
42
65
|
logout: () => Promise<void>;
|
|
66
|
+
apiUrl: string;
|
|
43
67
|
}
|
|
44
68
|
interface UserProviderProps {
|
|
45
69
|
children: ReactNode;
|
|
70
|
+
apiUrl: string;
|
|
71
|
+
onLoginSuccess?: (user: UserDTO | null) => void;
|
|
72
|
+
onLoginFailed?: (error: unknown) => void;
|
|
73
|
+
onLogoutSuccess?: () => void;
|
|
74
|
+
onLogoutFailed?: (error: unknown) => void;
|
|
46
75
|
}
|
|
47
|
-
declare function UserProvider({ children }: UserProviderProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function UserProvider({ children, apiUrl, onLoginSuccess, onLoginFailed, onLogoutSuccess, onLogoutFailed, }: UserProviderProps): react_jsx_runtime.JSX.Element;
|
|
48
77
|
declare function useUser(): UserContextType;
|
|
49
78
|
|
|
50
79
|
type Guid = string;
|
|
@@ -62,18 +91,6 @@ declare class TokenRequest implements ITokenRequest {
|
|
|
62
91
|
constructor(init: TokenRequestInit);
|
|
63
92
|
}
|
|
64
93
|
|
|
65
|
-
/**
|
|
66
|
-
* Represents an Auto-generated model for AuthResponse.
|
|
67
|
-
*/
|
|
68
|
-
interface IAuthResponse {
|
|
69
|
-
User: UserDTO;
|
|
70
|
-
}
|
|
71
|
-
type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
|
|
72
|
-
declare class AuthResponse implements IAuthResponse {
|
|
73
|
-
User: UserDTO;
|
|
74
|
-
constructor(init: AuthResponseInit);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
94
|
/**
|
|
78
95
|
* Auto-generated client for the Auth controller.
|
|
79
96
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare function UserInfoCard(): react_jsx_runtime.JSX.Element;
|
|
5
|
-
|
|
6
|
-
interface AuthenticatorProviderProps {
|
|
7
|
-
googleClientId: string;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Public entrypoint for consumers:
|
|
12
|
-
* Wraps children with Google OAuth + User context.
|
|
13
|
-
*/
|
|
14
|
-
declare function AuthenticatorProvider({ googleClientId, children, }: AuthenticatorProviderProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
interface LoginButtonProps {
|
|
17
|
-
onSuccess?: (tokenResponse: any) => void;
|
|
18
|
-
}
|
|
19
|
-
declare function LoginButton({ onSuccess }: LoginButtonProps): react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
21
4
|
/**
|
|
22
5
|
* Represents an Auto-generated model for UserDTO.
|
|
23
6
|
*/
|
|
@@ -36,15 +19,61 @@ declare class UserDTO implements IUserDTO {
|
|
|
36
19
|
constructor(init: UserDTOInit);
|
|
37
20
|
}
|
|
38
21
|
|
|
22
|
+
interface UserInfoCardProps {
|
|
23
|
+
onLogin?: (user: UserDTO) => void;
|
|
24
|
+
onLoginFailed?: (error: string) => void;
|
|
25
|
+
onLogout?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare function UserInfoCard({ onLogin, onLogout, onLoginFailed }: UserInfoCardProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface AuthenticatorProviderProps {
|
|
30
|
+
googleClientId: string;
|
|
31
|
+
apiUrl: string;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
onLoginSuccess?: (user: UserDTO | null) => void;
|
|
34
|
+
onLoginFailed?: (error: unknown) => void;
|
|
35
|
+
onLogoutSuccess?: () => void;
|
|
36
|
+
onLogoutFailed?: (error: unknown) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Public entrypoint for consumers:
|
|
40
|
+
* Wraps children with Google OAuth + User context.
|
|
41
|
+
*/
|
|
42
|
+
declare function AuthenticatorProvider({ googleClientId, apiUrl, children, onLoginSuccess, onLoginFailed, onLogoutSuccess, onLogoutFailed, }: AuthenticatorProviderProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Represents an Auto-generated model for AuthResponse.
|
|
46
|
+
*/
|
|
47
|
+
interface IAuthResponse {
|
|
48
|
+
User: UserDTO;
|
|
49
|
+
}
|
|
50
|
+
type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
|
|
51
|
+
declare class AuthResponse implements IAuthResponse {
|
|
52
|
+
User: UserDTO;
|
|
53
|
+
constructor(init: AuthResponseInit);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface LoginButtonProps {
|
|
57
|
+
onLogin?: (user: AuthResponse["User"]) => void;
|
|
58
|
+
onLoginFailed?: (error: any) => void;
|
|
59
|
+
}
|
|
60
|
+
declare function LoginButton({ onLogin, onLoginFailed }: LoginButtonProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
39
62
|
interface UserContextType {
|
|
40
63
|
user: UserDTO | null;
|
|
41
64
|
setUser: (user: UserDTO | null) => void;
|
|
42
65
|
logout: () => Promise<void>;
|
|
66
|
+
apiUrl: string;
|
|
43
67
|
}
|
|
44
68
|
interface UserProviderProps {
|
|
45
69
|
children: ReactNode;
|
|
70
|
+
apiUrl: string;
|
|
71
|
+
onLoginSuccess?: (user: UserDTO | null) => void;
|
|
72
|
+
onLoginFailed?: (error: unknown) => void;
|
|
73
|
+
onLogoutSuccess?: () => void;
|
|
74
|
+
onLogoutFailed?: (error: unknown) => void;
|
|
46
75
|
}
|
|
47
|
-
declare function UserProvider({ children }: UserProviderProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function UserProvider({ children, apiUrl, onLoginSuccess, onLoginFailed, onLogoutSuccess, onLogoutFailed, }: UserProviderProps): react_jsx_runtime.JSX.Element;
|
|
48
77
|
declare function useUser(): UserContextType;
|
|
49
78
|
|
|
50
79
|
type Guid = string;
|
|
@@ -62,18 +91,6 @@ declare class TokenRequest implements ITokenRequest {
|
|
|
62
91
|
constructor(init: TokenRequestInit);
|
|
63
92
|
}
|
|
64
93
|
|
|
65
|
-
/**
|
|
66
|
-
* Represents an Auto-generated model for AuthResponse.
|
|
67
|
-
*/
|
|
68
|
-
interface IAuthResponse {
|
|
69
|
-
User: UserDTO;
|
|
70
|
-
}
|
|
71
|
-
type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
|
|
72
|
-
declare class AuthResponse implements IAuthResponse {
|
|
73
|
-
User: UserDTO;
|
|
74
|
-
constructor(init: AuthResponseInit);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
94
|
/**
|
|
78
95
|
* Auto-generated client for the Auth controller.
|
|
79
96
|
*/
|