@asgardeo/browser 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.
- package/LICENSE +201 -0
- package/README.md +48 -0
- package/dist/AsgardeoBrowserClient.d.ts +28 -0
- package/dist/__legacy__/client.d.ts +651 -0
- package/dist/__legacy__/clients/index.d.ts +19 -0
- package/dist/__legacy__/clients/main-thread-client.d.ts +21 -0
- package/dist/__legacy__/clients/web-worker-client.d.ts +21 -0
- package/dist/__legacy__/constants/errors.d.ts +18 -0
- package/dist/__legacy__/constants/hooks.d.ts +29 -0
- package/dist/__legacy__/constants/index.d.ts +23 -0
- package/dist/__legacy__/constants/messages-types.d.ts +51 -0
- package/dist/__legacy__/constants/parameters.d.ts +21 -0
- package/dist/__legacy__/constants/session-management.d.ts +25 -0
- package/dist/__legacy__/constants/storage.d.ts +18 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts +58 -0
- package/dist/__legacy__/helpers/index.d.ts +20 -0
- package/dist/__legacy__/helpers/session-management-helper.d.ts +20 -0
- package/dist/__legacy__/helpers/spa-helper.d.ts +28 -0
- package/dist/__legacy__/http-client/clients/axios-http-client.d.ts +117 -0
- package/dist/__legacy__/http-client/clients/index.d.ts +19 -0
- package/dist/__legacy__/http-client/helpers/decorators.d.ts +24 -0
- package/dist/__legacy__/http-client/helpers/index.d.ts +19 -0
- package/dist/__legacy__/http-client/index.d.ts +20 -0
- package/dist/__legacy__/http-client/models/axios-http-client.d.ts +34 -0
- package/dist/__legacy__/http-client/models/http-client.d.ts +41 -0
- package/dist/__legacy__/http-client/models/index.d.ts +20 -0
- package/dist/__legacy__/models/client-config.d.ts +54 -0
- package/dist/__legacy__/models/client.d.ts +82 -0
- package/dist/__legacy__/models/http-client.d.ts +42 -0
- package/dist/__legacy__/models/index.d.ts +26 -0
- package/dist/__legacy__/models/message.d.ts +45 -0
- package/dist/__legacy__/models/request-custom-grant.d.ts +24 -0
- package/dist/__legacy__/models/session-management-helper.d.ts +23 -0
- package/dist/__legacy__/models/sign-in.d.ts +21 -0
- package/dist/__legacy__/models/sign-out-error.d.ts +21 -0
- package/dist/__legacy__/models/storage.d.ts +38 -0
- package/dist/__legacy__/models/web-worker.d.ts +55 -0
- package/dist/__legacy__/stores/index.d.ts +20 -0
- package/dist/__legacy__/stores/local-store.d.ts +23 -0
- package/dist/__legacy__/stores/memory-store.d.ts +25 -0
- package/dist/__legacy__/stores/session-store.d.ts +23 -0
- package/dist/__legacy__/utils/crypto-utils.d.ts +31 -0
- package/dist/__legacy__/utils/index.d.ts +19 -0
- package/dist/__legacy__/utils/message-utils.d.ts +37 -0
- package/dist/__legacy__/utils/spa-utils.d.ts +107 -0
- package/dist/__legacy__/worker/index.d.ts +19 -0
- package/dist/__legacy__/worker/worker-core.d.ts +21 -0
- package/dist/__legacy__/worker/worker-receiver.d.ts +21 -0
- package/dist/cjs/index.js +5437 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/constants/StyleConstants.d.ts +28 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +5459 -0
- package/dist/index.js.map +7 -0
- package/dist/models/config.d.ts +19 -0
- package/dist/utils/hasAuthParamsInUrl.d.ts +25 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +32 -0
- package/dist/worker.d.ts +21 -0
- package/package.json +76 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-2024, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { SignOutError } from '../..';
|
|
19
|
+
export declare class SPAUtils {
|
|
20
|
+
private constructor();
|
|
21
|
+
static removeAuthorizationCode(): void;
|
|
22
|
+
static getPKCE(pkceKey: string): string;
|
|
23
|
+
static setPKCE(pkceKey: string, pkce: string): void;
|
|
24
|
+
static setSignOutURL(url: string, clientID: string, instanceID: number): void;
|
|
25
|
+
static getSignOutURL(clientID: string, instanceID: number): string;
|
|
26
|
+
static removePKCE(pkceKey: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* This method is used to discontinue the execution of the `signIn` method if `callOnlyOnRedirect` is true and
|
|
29
|
+
* the method is not called on being redirected from the authorization server.
|
|
30
|
+
*
|
|
31
|
+
* This method can be used to allow the `signIn` method to be called only
|
|
32
|
+
* on being redirected from the authorization server.
|
|
33
|
+
*
|
|
34
|
+
* @param callOnlyOnRedirect {boolean} - True if the method should only be called on redirect.
|
|
35
|
+
* @param authorizationCode {string} - Authorization code.
|
|
36
|
+
*
|
|
37
|
+
* @returns {boolean} - True if the method should be called.
|
|
38
|
+
*/
|
|
39
|
+
static canContinueSignIn(callOnlyOnRedirect: boolean, authorizationCode?: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Specifies if `trySilentSignIn` has been called.
|
|
42
|
+
*
|
|
43
|
+
* @returns {boolean} True if the `trySilentSignIn` method has been called once.
|
|
44
|
+
*/
|
|
45
|
+
static isInitializedSilentSignIn(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Specifies if the `signIn` method has been called.
|
|
48
|
+
*
|
|
49
|
+
* @returns {boolean} True if the `signIn` has been called.
|
|
50
|
+
*/
|
|
51
|
+
static wasSignInCalled(): boolean;
|
|
52
|
+
static wasSilentSignInCalled(): boolean;
|
|
53
|
+
static isSignOutSuccessful(): Promise<boolean>;
|
|
54
|
+
static didSignOutFail(): boolean | SignOutError;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if the URL the user agent is redirected to after an authorization request has the state parameter.
|
|
57
|
+
*
|
|
58
|
+
* @returns {boolean} True if there is a session-check state or a silent sign-in state.
|
|
59
|
+
*/
|
|
60
|
+
static isSilentStatePresentInURL(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Util function to test if `code` and `session_state` are available in the URL as search params.
|
|
63
|
+
* @since 0.2.0
|
|
64
|
+
* @deprecated Use `hasAuthParamsInUrl` from `@asgardeo/browser` instead.
|
|
65
|
+
*
|
|
66
|
+
* @param params - Search params.
|
|
67
|
+
* @return {boolean}
|
|
68
|
+
*/
|
|
69
|
+
static hasAuthSearchParamsInURL(params?: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Util function to check if the URL contains an error.
|
|
72
|
+
*
|
|
73
|
+
* @param url - URL to be checked.
|
|
74
|
+
*
|
|
75
|
+
* @returns {boolean} - True if the URL contains an error.
|
|
76
|
+
*/
|
|
77
|
+
static hasErrorInURL(url?: string): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Checks if a prompt none can be sent by checking if a request has already been sent.
|
|
80
|
+
*
|
|
81
|
+
* @since 0.2.3
|
|
82
|
+
*
|
|
83
|
+
* @returns {boolean} - True if a prompt none request has not been sent.
|
|
84
|
+
*/
|
|
85
|
+
static canSendPromptNoneRequest(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the status of prompt none request.
|
|
88
|
+
*
|
|
89
|
+
* @since 0.2.3
|
|
90
|
+
*
|
|
91
|
+
* @param canSend {boolean} - True if a prompt none request can be sent.
|
|
92
|
+
*/
|
|
93
|
+
static setPromptNoneRequestSent(canSend: boolean): void;
|
|
94
|
+
/**
|
|
95
|
+
* Waits for a specified amount of time to give the user agent enough time to redirect.
|
|
96
|
+
*
|
|
97
|
+
* @param time {number} - Time in seconds.
|
|
98
|
+
*/
|
|
99
|
+
static waitTillPageRedirect(time?: number): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Waits for a condition before executing the rest of the code in non-blocking manner.
|
|
102
|
+
*
|
|
103
|
+
* @param condition {() => boolean} - Condition to be checked.
|
|
104
|
+
* @param timeout {number} - Time in miliseconds.
|
|
105
|
+
*/
|
|
106
|
+
static until: (condition: () => boolean, timeout?: number) => Promise<unknown>;
|
|
107
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export * from "./worker-receiver";
|
|
19
|
+
export * from "./worker-core";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { AsgardeoAuthClient, AuthClientConfig } from '@asgardeo/javascript';
|
|
19
|
+
import { AuthenticationHelper, SPAHelper } from '../helpers';
|
|
20
|
+
import { WebWorkerClientConfig, WebWorkerCoreInterface } from '../models';
|
|
21
|
+
export declare const WebWorkerCore: (config: AuthClientConfig<WebWorkerClientConfig>, getAuthHelper: (authClient: AsgardeoAuthClient<WebWorkerClientConfig>, spaHelper: SPAHelper<WebWorkerClientConfig>) => AuthenticationHelper<WebWorkerClientConfig>) => Promise<WebWorkerCoreInterface>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { AsgardeoAuthClient } from '@asgardeo/javascript';
|
|
19
|
+
import { AuthenticationHelper, SPAHelper } from '../helpers';
|
|
20
|
+
import { WebWorkerClientConfig } from '../models';
|
|
21
|
+
export declare const workerReceiver: (getAuthHelper: (authClient: AsgardeoAuthClient<WebWorkerClientConfig>, spaHelper: SPAHelper<WebWorkerClientConfig>) => AuthenticationHelper<WebWorkerClientConfig>) => void;
|