@asgardeo/javascript 0.1.15 → 0.1.16
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/cjs/index.js +817 -713
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +812 -713
- package/dist/index.js.map +4 -4
- package/dist/models/platforms.d.ts +35 -0
- package/dist/theme/createTheme.d.ts +2 -1
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts +29 -0
- package/dist/utils/identifyPlatform.d.ts +30 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. 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
|
+
/**
|
|
19
|
+
* Enumeration of supported identity platforms.
|
|
20
|
+
*
|
|
21
|
+
* - `Asgardeo`: Represents the Asgardeo cloud identity platform (asgardeo.io domains).
|
|
22
|
+
* - `IdentityServer`: Represents WSO2 Identity Server (on-prem or custom domains).
|
|
23
|
+
* - `Unknown`: Used when the platform cannot be determined from the configuration.
|
|
24
|
+
*
|
|
25
|
+
* This enum is used to distinguish between different identity providers and to
|
|
26
|
+
* enable platform-specific logic throughout the SDK.
|
|
27
|
+
*/
|
|
28
|
+
export declare enum Platform {
|
|
29
|
+
/** Asgardeo cloud identity platform (asgardeo.io domains) */
|
|
30
|
+
Asgardeo = "ASGARDEO",
|
|
31
|
+
/** WSO2 Identity Server (on-prem or custom domains) */
|
|
32
|
+
IdentityServer = "IDENTITY_SERVER",
|
|
33
|
+
/** Unknown or unsupported platform */
|
|
34
|
+
Unknown = "UNKNOWN"
|
|
35
|
+
}
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
* specific language governing permissions and limitations
|
|
32
32
|
* under the License.
|
|
33
33
|
*/
|
|
34
|
-
import { Theme, ThemeConfig } from './types';
|
|
34
|
+
import { Theme, ThemeConfig, ThemeMode } from './types';
|
|
35
35
|
import { RecursivePartial } from '../models/utility-types';
|
|
36
36
|
declare const createTheme: (config?: RecursivePartial<ThemeConfig>, isDark?: boolean) => Theme;
|
|
37
|
+
export declare const DEFAULT_THEME: ThemeMode;
|
|
37
38
|
export default createTheme;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. 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 { Config } from '../models/config';
|
|
19
|
+
/**
|
|
20
|
+
* Utility to generate the redirect-based sign-up URL for Asgardeo.
|
|
21
|
+
*
|
|
22
|
+
* If the baseUrl is recognized (standard Asgardeo pattern), constructs the sign-up URL.
|
|
23
|
+
* Otherwise, returns an empty string.
|
|
24
|
+
*
|
|
25
|
+
* @param baseUrl - The base URL of the Asgardeo identity server (string or undefined)
|
|
26
|
+
* @returns The sign-up URL if baseUrl is recognized, otherwise an empty string
|
|
27
|
+
*/
|
|
28
|
+
declare const getRedirectBasedSignUpUrl: (config: Config) => string;
|
|
29
|
+
export default getRedirectBasedSignUpUrl;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. 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 { Config } from '../models/config';
|
|
19
|
+
import { Platform } from '../models/platforms';
|
|
20
|
+
/**
|
|
21
|
+
* Identifies the platform based on the given base URL.
|
|
22
|
+
*
|
|
23
|
+
* If the URL is recognized and matches the Asgardeo domain, returns Platform.Asgardeo.
|
|
24
|
+
* Otherwise, returns Platform.IdentityServer.
|
|
25
|
+
*
|
|
26
|
+
* @param baseUrl - The base URL to check
|
|
27
|
+
* @returns Platform enum value
|
|
28
|
+
*/
|
|
29
|
+
declare const identifyPlatform: (config: Config) => Platform;
|
|
30
|
+
export default identifyPlatform;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. 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
|
+
/**
|
|
19
|
+
* Utility to determine if sensible Asgardeo fallbacks can be used based on the given base URL.
|
|
20
|
+
*
|
|
21
|
+
* This checks if the URL follows the standard Asgardeo pattern: /t/{orgHandle}
|
|
22
|
+
* Returns true if sensible fallbacks (like deriving organization handle, tenant, etc.) can be used, false otherwise.
|
|
23
|
+
*
|
|
24
|
+
* @param baseUrl - The base URL of the Asgardeo identity server (string or undefined)
|
|
25
|
+
* @returns boolean - true if sensible fallbacks can be used, false otherwise
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* isRecognizedBaseUrlPattern('https://dev.asgardeo.io/t/dxlab'); // true
|
|
29
|
+
* isRecognizedBaseUrlPattern('https://custom.example.com/auth'); // false
|
|
30
|
+
*/
|
|
31
|
+
declare const isRecognizedBaseUrlPattern: (baseUrl: string | undefined) => boolean;
|
|
32
|
+
export default isRecognizedBaseUrlPattern;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgardeo/javascript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Framework agnostic JavaScript SDK for Asgardeo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"asgardeo",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"directory": "packages/javascript"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^22.15.
|
|
37
|
+
"@types/node": "^22.15.30",
|
|
38
38
|
"@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?a1fc6eb570653c999828aea9f5027cba06af4391",
|
|
39
39
|
"@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?a1fc6eb570653c999828aea9f5027cba06af4391",
|
|
40
40
|
"esbuild": "^0.25.9",
|