@asgardeo/react 0.2.4 → 0.3.0
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/README.md +108 -6
- package/dist/AsgardeoReactClient.d.ts +37 -0
- package/dist/__temp__/api.d.ts +229 -0
- package/dist/__temp__/models.d.ts +105 -0
- package/dist/api/scim2/getMeProfile.d.ts +39 -0
- package/dist/api/scim2/getSchemas.d.ts +39 -0
- package/dist/api/scim2/updateMeProfile.d.ts +38 -0
- package/dist/cjs/index.js +1955 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +65 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts +46 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +65 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts +44 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +65 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts +45 -0
- package/dist/components/control/SignedIn.d.ts +45 -0
- package/dist/components/control/SignedOut.d.ts +45 -0
- package/dist/components/presentation/User.d.ts +57 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +76 -0
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +49 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +42 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +49 -0
- package/dist/{esm/types/components/SignIn/SignIn.d.ts → components/primitives/Avatar/Avatar.d.ts} +25 -14
- package/dist/{esm/types/oxygen-ui-react-auth-components/models/component.d.ts → components/primitives/Checkbox/Checkbox.d.ts} +22 -7
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +50 -0
- package/dist/components/primitives/Popover/Popover.d.ts +59 -0
- package/dist/components/primitives/Select/Select.d.ts +60 -0
- package/dist/components/primitives/TextField/TextField.d.ts +46 -0
- package/dist/contexts/AsgardeoContext.d.ts +56 -0
- package/dist/{esm/types/contexts/i18n-context.d.ts → hooks/useAsgardeo.d.ts} +4 -5
- package/dist/hooks/useBrowserUrl.d.ts +47 -0
- package/dist/index.d.ts +36 -348
- package/dist/index.js +1935 -0
- package/dist/index.js.map +7 -0
- package/dist/{esm/types/oxygen-ui-react-auth-components/index.d.ts → models/config.d.ts} +3 -3
- package/dist/{esm/types/hooks/use-config.d.ts → providers/AsgardeoProvider.d.ts} +7 -5
- package/dist/{esm/types/models/asgardeo-provider-props.d.ts → theme/ThemeContext.d.ts} +8 -7
- package/dist/{esm/types/models/branding-preference-provider-props.d.ts → theme/ThemeProvider.d.ts} +7 -5
- package/dist/{esm/types/models/use-on.d.ts → theme/types.d.ts} +22 -12
- package/dist/{esm/types/models/public-models.d.ts → theme/useTheme.d.ts} +3 -3
- package/dist/{esm/types/models/signed-props.d.ts → utils/getMappedUserProfileValue.d.ts} +3 -6
- package/dist/utils/getUserProfile.d.ts +59 -0
- package/package.json +55 -60
- package/dist/esm/index.js +0 -45278
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/SignIn/fragments/BasicAuth.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/EmailOtp.d.ts +0 -32
- package/dist/esm/types/components/SignIn/fragments/IdentifierFirst.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/LoginOptionsBox.d.ts +0 -30
- package/dist/esm/types/components/SignIn/fragments/SmsOtp.d.ts +0 -21
- package/dist/esm/types/components/SignIn/fragments/Totp.d.ts +0 -33
- package/dist/esm/types/components/SignInButton/SignInButton.d.ts +0 -29
- package/dist/esm/types/components/SignOutButton/SignOutButton.d.ts +0 -27
- package/dist/esm/types/components/SignedIn/SignedIn.d.ts +0 -29
- package/dist/esm/types/components/SignedOut/SignedOut.d.ts +0 -29
- package/dist/esm/types/components/public-components.d.ts +0 -22
- package/dist/esm/types/contexts/asgardeo-context.d.ts +0 -21
- package/dist/esm/types/contexts/branding-preference-context.d.ts +0 -21
- package/dist/esm/types/hooks/use-authentication.d.ts +0 -27
- package/dist/esm/types/hooks/use-on.d.ts +0 -20
- package/dist/esm/types/hooks/use-translations.d.ts +0 -33
- package/dist/esm/types/index.d.ts +0 -22
- package/dist/esm/types/models/auth-context.d.ts +0 -43
- package/dist/esm/types/models/basic-auth-props.d.ts +0 -29
- package/dist/esm/types/models/email-otp-props.d.ts +0 -26
- package/dist/esm/types/models/i18n.d.ts +0 -34
- package/dist/esm/types/models/jwt-verify-options.d.ts +0 -25
- package/dist/esm/types/models/login-options-box-props.d.ts +0 -24
- package/dist/esm/types/models/sign-in.d.ts +0 -49
- package/dist/esm/types/models/totp-props.d.ts +0 -26
- package/dist/esm/types/models/use-authentication.d.ts +0 -29
- package/dist/esm/types/models/use-config.d.ts +0 -22
- package/dist/esm/types/models/use-translations.d.ts +0 -22
- package/dist/esm/types/oxygen-ui-react-auth-components/SignIn/SignIn.d.ts +0 -79
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.d.ts +0 -37
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInButton/SignInButton.d.ts +0 -27
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.d.ts +0 -29
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInImage/SignInImage.d.ts +0 -23
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInLink/SignInLink.d.ts +0 -25
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.d.ts +0 -30
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.d.ts +0 -32
- package/dist/esm/types/providers/AsgardeoProvider.d.ts +0 -34
- package/dist/esm/types/providers/BrandingPreferenceProvider.d.ts +0 -32
- package/dist/esm/types/providers/I18nProvider.d.ts +0 -33
- package/dist/esm/types/theme/generate-theme-sign-in.d.ts +0 -28
- package/dist/esm/types/theme/generate-theme.d.ts +0 -30
- package/dist/esm/types/utils/crypto-utils.d.ts +0 -52
- package/dist/esm/types/utils/session-store.d.ts +0 -25
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* Retrieves the authenticated user's profile information with all SCIM2 schema properties
|
|
20
|
+
* flattened to the root level for easier access.
|
|
21
|
+
*
|
|
22
|
+
* The function flattens properties from all schemas defined in WellKnownSchemaIds:
|
|
23
|
+
* - Core User properties (urn:ietf:params:scim:schemas:core:2.0:User)
|
|
24
|
+
* - Enterprise User properties (urn:ietf:params:scim:schemas:extension:enterprise:2.0:User)
|
|
25
|
+
* - System User properties (urn:scim:wso2:schema)
|
|
26
|
+
* - Custom User properties (urn:scim:schemas:extension:custom:User)
|
|
27
|
+
*
|
|
28
|
+
* @param requestConfig - Request configuration object.
|
|
29
|
+
* @returns A promise that resolves with the flattened user profile information.
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* try {
|
|
33
|
+
* const userProfile = await getUserProfile({
|
|
34
|
+
* url: "https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Me",
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Access flattened properties directly:
|
|
38
|
+
* console.log("Email:", userProfile.emails[0]);
|
|
39
|
+
* console.log("Name:", userProfile.name.formatted);
|
|
40
|
+
* console.log("Username:", userProfile.userName);
|
|
41
|
+
*
|
|
42
|
+
* // WSO2 specific properties:
|
|
43
|
+
* console.log("Account State:", userProfile.accountState);
|
|
44
|
+
* console.log("Email Verified:", userProfile.emailVerified);
|
|
45
|
+
*
|
|
46
|
+
* // Enterprise properties (if available):
|
|
47
|
+
* console.log("Employee Number:", userProfile.employeeNumber);
|
|
48
|
+
* console.log("Cost Center:", userProfile.costCenter);
|
|
49
|
+
* } catch (error) {
|
|
50
|
+
* if (error instanceof AsgardeoAPIError) {
|
|
51
|
+
* console.error('Failed to get user profile:', error.message);
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare const getUserProfile: ({ baseUrl }: {
|
|
57
|
+
baseUrl: any;
|
|
58
|
+
}) => Promise<any>;
|
|
59
|
+
export default getUserProfile;
|
package/package.json
CHANGED
|
@@ -1,80 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgardeo/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "React implementation of Asgardeo JavaScript SDK.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"asgardeo",
|
|
7
|
+
"react",
|
|
8
|
+
"spa"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/asgardeo/javascript/tree/main/packages/react#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/asgardeo/javascript/issues"
|
|
13
|
+
},
|
|
9
14
|
"author": "WSO2",
|
|
10
15
|
"license": "Apache-2.0",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/cjs/index.js",
|
|
18
|
+
"module": "dist/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/cjs/index.js"
|
|
22
|
+
},
|
|
11
23
|
"files": [
|
|
12
24
|
"dist",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
15
27
|
],
|
|
16
|
-
"
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/asgardeo/web-ui-sdks/issues"
|
|
19
|
-
},
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
20
29
|
"repository": {
|
|
21
30
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/asgardeo/
|
|
31
|
+
"url": "https://github.com/asgardeo/javascript",
|
|
23
32
|
"directory": "packages/react"
|
|
24
33
|
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"asgardeo",
|
|
27
|
-
"identity",
|
|
28
|
-
"ui",
|
|
29
|
-
"react",
|
|
30
|
-
"login",
|
|
31
|
-
"customize"
|
|
32
|
-
],
|
|
33
|
-
"publishConfig": {
|
|
34
|
-
"access": "public"
|
|
35
|
-
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"react
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"sass": "^1.75.0",
|
|
57
|
-
"stylelint": "15.1.0",
|
|
58
|
-
"tslib": "^2.6.2",
|
|
59
|
-
"typescript": "5.1.6"
|
|
35
|
+
"@testing-library/dom": "^10.4.0",
|
|
36
|
+
"@types/node": "^22.15.3",
|
|
37
|
+
"@types/react": "^19.1.4",
|
|
38
|
+
"@vitest/browser": "^3.1.3",
|
|
39
|
+
"@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?a1fc6eb570653c999828aea9f5027cba06af4391",
|
|
40
|
+
"@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?a1fc6eb570653c999828aea9f5027cba06af4391",
|
|
41
|
+
"esbuild-plugin-preserve-directives": "^0.0.11",
|
|
42
|
+
"eslint": "8.57.0",
|
|
43
|
+
"playwright": "^1.52.0",
|
|
44
|
+
"prettier": "^2.6.2",
|
|
45
|
+
"react": "^19.1.0",
|
|
46
|
+
"rimraf": "^6.0.1",
|
|
47
|
+
"typescript": "~5.7.2",
|
|
48
|
+
"vitest": "^3.1.3",
|
|
49
|
+
"vitest-browser-react": "^0.1.1"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@types/react": ">=16.8.0",
|
|
53
|
+
"react": ">=16.8.0"
|
|
60
54
|
},
|
|
61
55
|
"dependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@oxygen-ui/react": "^1.11.0",
|
|
64
|
-
"base64url": "^3.0.1",
|
|
65
|
-
"buffer": "^6.0.3",
|
|
56
|
+
"@types/react-dom": "^19.1.5",
|
|
66
57
|
"clsx": "^2.1.1",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
58
|
+
"esbuild": "^0.25.4",
|
|
59
|
+
"react-dom": "^19.1.0",
|
|
60
|
+
"tslib": "^2.8.1",
|
|
61
|
+
"@asgardeo/browser": "^0.0.1"
|
|
70
62
|
},
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"react-dom": ">=18.0.0"
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
74
65
|
},
|
|
75
66
|
"scripts": {
|
|
76
|
-
"build": "
|
|
77
|
-
"
|
|
78
|
-
"lint
|
|
67
|
+
"build": "pnpm clean && node esbuild.config.mjs && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
|
|
68
|
+
"clean": "rimraf dist",
|
|
69
|
+
"fix:lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
|
|
70
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
|
|
71
|
+
"test": "vitest",
|
|
72
|
+
"test:browser": "vitest --workspace=vitest.workspace.ts",
|
|
73
|
+
"typecheck": "tsc -p tsconfig.lib.json"
|
|
79
74
|
}
|
|
80
75
|
}
|