@asgardeo/react 0.11.1 → 0.11.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.
- package/dist/AsgardeoReactClient.d.ts +10 -10
- package/dist/__temp__/api.d.ts +6 -6
- package/dist/__temp__/models.d.ts +30 -30
- package/dist/cjs/index.js +5988 -5754
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/adapters/FacebookButton.d.ts +1 -1
- package/dist/components/adapters/GitHubButton.d.ts +1 -1
- package/dist/components/adapters/GoogleButton.d.ts +1 -1
- package/dist/components/adapters/LinkedInButton.d.ts +1 -1
- package/dist/components/adapters/MicrosoftButton.d.ts +1 -1
- package/dist/components/adapters/SignInWithEthereumButton.d.ts +1 -1
- package/dist/components/adapters/SmsOtpButton.d.ts +1 -1
- package/dist/components/factories/FieldFactory.d.ts +25 -25
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +1 -18
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +1 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +26 -26
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +1 -31
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +1 -6
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +3 -3
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +1 -27
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +6 -6
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +1 -25
- package/dist/components/presentation/User/BaseUser.d.ts +4 -4
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts +1 -15
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +3 -3
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts +1 -26
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +1 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +13 -13
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +51 -51
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +6 -10
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/InviteUser/index.d.ts +1 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +57 -57
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +6 -10
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +15 -15
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts +1 -27
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts +1 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +12 -12
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +15 -15
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts +30 -30
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +47 -47
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +20 -20
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts +1 -26
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +40 -40
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +46 -46
- package/dist/components/primitives/Alert/Alert.d.ts +8 -8
- package/dist/components/primitives/Alert/Alert.styles.d.ts +1 -8
- package/dist/components/primitives/Avatar/Avatar.d.ts +4 -4
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts +1 -7
- package/dist/components/primitives/Button/Button.d.ts +14 -14
- package/dist/components/primitives/Button/Button.styles.d.ts +1 -13
- package/dist/components/primitives/Card/Card.d.ts +4 -4
- package/dist/components/primitives/Card/Card.styles.d.ts +1 -11
- package/dist/components/primitives/Checkbox/Checkbox.d.ts +8 -8
- package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts +1 -8
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +12 -12
- package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts +1 -6
- package/dist/components/primitives/Dialog/Dialog.d.ts +17 -17
- package/dist/components/primitives/Dialog/Dialog.styles.d.ts +1 -9
- package/dist/components/primitives/Divider/Divider.d.ts +2 -2
- package/dist/components/primitives/Divider/Divider.styles.d.ts +1 -7
- package/dist/components/primitives/FormControl/FormControl.d.ts +4 -4
- package/dist/components/primitives/FormControl/FormControl.styles.d.ts +1 -5
- package/dist/components/primitives/InputLabel/InputLabel.d.ts +10 -10
- package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts +1 -7
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +4 -4
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts +1 -17
- package/dist/components/primitives/Logo/Logo.d.ts +8 -8
- package/dist/components/primitives/Logo/Logo.styles.d.ts +1 -7
- package/dist/components/primitives/MultiInput/MultiInput.d.ts +28 -28
- package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts +1 -11
- package/dist/components/primitives/OtpField/OtpField.d.ts +20 -20
- package/dist/components/primitives/OtpField/OtpField.styles.d.ts +1 -6
- package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts +1 -5
- package/dist/components/primitives/Select/Select.d.ts +18 -18
- package/dist/components/primitives/Select/Select.styles.d.ts +1 -6
- package/dist/components/primitives/Spinner/Spinner.d.ts +4 -4
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts +1 -6
- package/dist/components/primitives/TextField/TextField.d.ts +18 -18
- package/dist/components/primitives/TextField/TextField.styles.d.ts +1 -9
- package/dist/components/primitives/Typography/Typography.d.ts +24 -24
- package/dist/components/primitives/Typography/Typography.styles.d.ts +1 -19
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +62 -62
- package/dist/contexts/Branding/BrandingContext.d.ts +12 -11
- package/dist/contexts/Branding/BrandingProvider.d.ts +10 -10
- package/dist/contexts/Flow/FlowContext.d.ts +25 -24
- package/dist/contexts/Flow/FlowProvider.d.ts +4 -4
- package/dist/contexts/I18n/I18nContext.d.ts +6 -5
- package/dist/contexts/I18n/I18nProvider.d.ts +1 -1
- package/dist/contexts/Theme/ThemeContext.d.ts +12 -11
- package/dist/contexts/Theme/ThemeProvider.d.ts +10 -10
- package/dist/contexts/Theme/types.d.ts +30 -30
- package/dist/contexts/User/UserContext.d.ts +2 -2
- package/dist/contexts/User/UserProvider.d.ts +2 -2
- package/dist/hooks/useBranding.d.ts +17 -17
- package/dist/hooks/useForm.d.ts +10 -9
- package/dist/hooks/useTranslation.d.ts +4 -4
- package/dist/index.d.ts +6 -26
- package/dist/index.js +5969 -5705
- package/dist/index.js.map +4 -4
- package/dist/utils/v2/flowTransformer.d.ts +7 -7
- package/dist/utils/v2/getAuthComponentHeadings.d.ts +2 -2
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { AsgardeoBrowserClient, UserProfile, SignInOptions, SignOutOptions, User, EmbeddedFlowExecuteResponse, SignUpOptions, EmbeddedFlowExecuteRequestPayload, EmbeddedSignInFlowHandleRequestPayload, Organization, IdToken, EmbeddedFlowExecuteRequestConfig, AllOrganizationsApiResponse, TokenResponse, HttpRequestConfig, HttpResponse,
|
|
18
|
+
import { AsgardeoBrowserClient, UserProfile, SignInOptions, SignOutOptions, User, EmbeddedFlowExecuteResponse, SignUpOptions, EmbeddedFlowExecuteRequestPayload, EmbeddedSignInFlowHandleRequestPayload, Organization, IdToken, EmbeddedFlowExecuteRequestConfig, AllOrganizationsApiResponse, TokenResponse, HttpRequestConfig, HttpResponse, TokenExchangeRequestConfig } from '@asgardeo/browser';
|
|
19
19
|
import { AsgardeoReactConfig } from './models/config';
|
|
20
20
|
/**
|
|
21
21
|
* Client for mplementing Asgardeo in React applications.
|
|
@@ -25,8 +25,8 @@ import { AsgardeoReactConfig } from './models/config';
|
|
|
25
25
|
*/
|
|
26
26
|
declare class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> extends AsgardeoBrowserClient<T> {
|
|
27
27
|
private asgardeo;
|
|
28
|
-
private
|
|
29
|
-
private
|
|
28
|
+
private loadingState;
|
|
29
|
+
private clientInstanceId;
|
|
30
30
|
/**
|
|
31
31
|
* Creates a new AsgardeoReactClient instance.
|
|
32
32
|
* @param instanceId - Optional instance ID for multi-auth context support. Defaults to 0 for backward compatibility.
|
|
@@ -48,22 +48,22 @@ declare class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactC
|
|
|
48
48
|
* @returns Promise with the result of the operation
|
|
49
49
|
*/
|
|
50
50
|
private withLoading;
|
|
51
|
-
initialize(config: AsgardeoReactConfig
|
|
51
|
+
initialize(config: AsgardeoReactConfig): Promise<boolean>;
|
|
52
52
|
reInitialize(config: Partial<AsgardeoReactConfig>): Promise<boolean>;
|
|
53
|
-
updateUserProfile(
|
|
53
|
+
updateUserProfile(): Promise<User>;
|
|
54
54
|
getUser(options?: any): Promise<User>;
|
|
55
55
|
getDecodedIdToken(sessionId?: string): Promise<IdToken>;
|
|
56
56
|
getIdToken(): Promise<string>;
|
|
57
57
|
getUserProfile(options?: any): Promise<UserProfile>;
|
|
58
|
-
getMyOrganizations(options?: any
|
|
59
|
-
getAllOrganizations(options?: any
|
|
58
|
+
getMyOrganizations(options?: any): Promise<Organization[]>;
|
|
59
|
+
getAllOrganizations(options?: any): Promise<AllOrganizationsApiResponse>;
|
|
60
60
|
getCurrentOrganization(): Promise<Organization | null>;
|
|
61
|
-
switchOrganization(organization: Organization
|
|
61
|
+
switchOrganization(organization: Organization): Promise<TokenResponse | Response>;
|
|
62
62
|
isLoading(): boolean;
|
|
63
63
|
isInitialized(): Promise<boolean>;
|
|
64
64
|
isSignedIn(): Promise<boolean>;
|
|
65
65
|
getConfiguration(): T;
|
|
66
|
-
exchangeToken(config: TokenExchangeRequestConfig
|
|
66
|
+
exchangeToken(config: TokenExchangeRequestConfig): Promise<TokenResponse | Response>;
|
|
67
67
|
signIn(options?: SignInOptions, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
68
68
|
signIn(payload: EmbeddedSignInFlowHandleRequestPayload, request: EmbeddedFlowExecuteRequestConfig, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
69
69
|
signInSilently(options?: SignInOptions): Promise<User | boolean>;
|
|
@@ -76,6 +76,6 @@ declare class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactC
|
|
|
76
76
|
getAccessToken(sessionId?: string): Promise<string>;
|
|
77
77
|
clearSession(sessionId?: string): void;
|
|
78
78
|
setSession(sessionData: Record<string, unknown>, sessionId?: string): Promise<void>;
|
|
79
|
-
decodeJwtToken<
|
|
79
|
+
decodeJwtToken<TResult = Record<string, unknown>>(token: string): Promise<TResult>;
|
|
80
80
|
}
|
|
81
81
|
export default AsgardeoReactClient;
|
package/dist/__temp__/api.d.ts
CHANGED
|
@@ -19,18 +19,18 @@ import { AsgardeoSPAClient, AuthClientConfig, User, LegacyConfig as Config, IdTo
|
|
|
19
19
|
import { AuthStateInterface } from './models';
|
|
20
20
|
declare class AuthAPI {
|
|
21
21
|
static DEFAULT_STATE: AuthStateInterface;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
22
|
+
private authState;
|
|
23
|
+
private client;
|
|
24
|
+
private apiInstanceId;
|
|
25
|
+
private loadingState;
|
|
26
26
|
constructor(spaClient?: AsgardeoSPAClient, instanceId?: number);
|
|
27
27
|
/**
|
|
28
28
|
* Get the instance ID for this AuthAPI instance.
|
|
29
29
|
* @returns The instance ID used for multi-auth context support.
|
|
30
30
|
*/
|
|
31
31
|
getInstanceId(): number;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
setLoadingState(isLoading: boolean): void;
|
|
33
|
+
getLoadingState(): boolean;
|
|
34
34
|
isLoading(): boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Method to return Auth Client instance authentication state.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
3
|
*
|
|
4
|
-
* WSO2
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
5
|
* Version 2.0 (the "License"); you may not use this file except
|
|
6
6
|
* in compliance with the License.
|
|
7
7
|
* You may obtain a copy of the License at
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { AsgardeoAuthException, AuthClientConfig, AuthSPAClientConfig, Config, TokenExchangeRequestConfig, IdToken, Hooks, HttpClientInstance, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, User } from '@asgardeo/browser';
|
|
19
19
|
export interface ReactConfig {
|
|
20
|
+
disableAutoSignIn?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The `AuthProvider`, by default, looks for an active session in the server and updates the session information
|
|
23
|
+
* with the latest session information from the server. This option could be used to disable that behaviour.
|
|
24
|
+
*/
|
|
25
|
+
disableTrySignInSilently?: boolean;
|
|
20
26
|
/**
|
|
21
27
|
* The SDK's `AuthProvider` by default is listening to the URL changes to see
|
|
22
28
|
* if `code` & `session_state` search params are available so that it could perform
|
|
23
29
|
* token exchange. This option could be used to override that behaviour.
|
|
24
30
|
*/
|
|
25
31
|
skipRedirectCallback?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The `AuthProvider`, by default, looks for an active session in the server and updates the session information
|
|
28
|
-
* with the latest session information from the server. This option could be used to disable that behaviour.
|
|
29
|
-
*/
|
|
30
|
-
disableTrySignInSilently?: boolean;
|
|
31
|
-
disableAutoSignIn?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export type AuthReactConfig = AuthSPAClientConfig & ReactConfig;
|
|
34
34
|
/**
|
|
@@ -44,48 +44,48 @@ export interface AuthStateInterface {
|
|
|
44
44
|
* The email address of the user.
|
|
45
45
|
*/
|
|
46
46
|
email?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Specifies if the user is authenticated or not.
|
|
49
|
-
*/
|
|
50
|
-
isSignedIn: boolean;
|
|
51
47
|
/**
|
|
52
48
|
* Are the Auth requests loading.
|
|
53
49
|
*/
|
|
54
50
|
isLoading: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Specifies if the user is authenticated or not.
|
|
53
|
+
*/
|
|
54
|
+
isSignedIn: boolean;
|
|
55
55
|
/**
|
|
56
56
|
* The username of the user.
|
|
57
57
|
*/
|
|
58
58
|
username?: string;
|
|
59
59
|
}
|
|
60
60
|
export interface AuthContextInterface {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
signOut: (callback?: (response: boolean) => void) => Promise<boolean>;
|
|
65
|
-
getUser(): Promise<User>;
|
|
66
|
-
httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>>;
|
|
67
|
-
httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]>;
|
|
61
|
+
disableHttpHandler(): Promise<boolean>;
|
|
62
|
+
enableHttpHandler(): Promise<boolean>;
|
|
63
|
+
error: AsgardeoAuthException;
|
|
68
64
|
exchangeToken(config: TokenExchangeRequestConfig, callback?: (response: User | Response) => void): void;
|
|
69
|
-
|
|
70
|
-
getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
|
|
71
|
-
getHttpClient(): Promise<HttpClientInstance>;
|
|
65
|
+
getAccessToken(): Promise<string>;
|
|
72
66
|
getDecodedIDPIDToken(): Promise<IdToken>;
|
|
73
67
|
getDecodedIdToken(sessionId?: string): Promise<IdToken>;
|
|
68
|
+
getHttpClient(): Promise<HttpClientInstance>;
|
|
74
69
|
getIdToken(): Promise<string>;
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
|
|
71
|
+
getUser(): Promise<User>;
|
|
72
|
+
httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>>;
|
|
73
|
+
httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]>;
|
|
77
74
|
isSignedIn(): Promise<boolean>;
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): void;
|
|
76
|
+
on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): void;
|
|
77
|
+
on(hook: Hooks, callback: (response?: any) => void, id?: string): void;
|
|
80
78
|
reInitialize(config: Partial<AuthClientConfig<Config>>): Promise<void>;
|
|
79
|
+
refreshAccessToken(): Promise<User>;
|
|
80
|
+
revokeAccessToken(): Promise<boolean>;
|
|
81
|
+
signIn: (config?: SignInConfig, authorizationCode?: string, sessionState?: string, state?: string, callback?: (response: User) => void, tokenRequestConfig?: {
|
|
82
|
+
params: Record<string, unknown>;
|
|
83
|
+
}) => Promise<User>;
|
|
81
84
|
signInSilently: (additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
|
|
82
85
|
params: Record<string, unknown>;
|
|
83
86
|
}) => Promise<boolean | User>;
|
|
84
|
-
|
|
85
|
-
on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): void;
|
|
86
|
-
on(hook: Hooks, callback: (response?: any) => void, id?: string): void;
|
|
87
|
+
signOut: (callback?: (response: boolean) => void) => Promise<boolean>;
|
|
87
88
|
state: AuthStateInterface;
|
|
88
|
-
error: AsgardeoAuthException;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* The model of the object returned by the `getAuthParams` prop method of the `AuthProvider`.
|