@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.
Files changed (59) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +48 -0
  3. package/dist/AsgardeoBrowserClient.d.ts +28 -0
  4. package/dist/__legacy__/client.d.ts +651 -0
  5. package/dist/__legacy__/clients/index.d.ts +19 -0
  6. package/dist/__legacy__/clients/main-thread-client.d.ts +21 -0
  7. package/dist/__legacy__/clients/web-worker-client.d.ts +21 -0
  8. package/dist/__legacy__/constants/errors.d.ts +18 -0
  9. package/dist/__legacy__/constants/hooks.d.ts +29 -0
  10. package/dist/__legacy__/constants/index.d.ts +23 -0
  11. package/dist/__legacy__/constants/messages-types.d.ts +51 -0
  12. package/dist/__legacy__/constants/parameters.d.ts +21 -0
  13. package/dist/__legacy__/constants/session-management.d.ts +25 -0
  14. package/dist/__legacy__/constants/storage.d.ts +18 -0
  15. package/dist/__legacy__/helpers/authentication-helper.d.ts +58 -0
  16. package/dist/__legacy__/helpers/index.d.ts +20 -0
  17. package/dist/__legacy__/helpers/session-management-helper.d.ts +20 -0
  18. package/dist/__legacy__/helpers/spa-helper.d.ts +28 -0
  19. package/dist/__legacy__/http-client/clients/axios-http-client.d.ts +117 -0
  20. package/dist/__legacy__/http-client/clients/index.d.ts +19 -0
  21. package/dist/__legacy__/http-client/helpers/decorators.d.ts +24 -0
  22. package/dist/__legacy__/http-client/helpers/index.d.ts +19 -0
  23. package/dist/__legacy__/http-client/index.d.ts +20 -0
  24. package/dist/__legacy__/http-client/models/axios-http-client.d.ts +34 -0
  25. package/dist/__legacy__/http-client/models/http-client.d.ts +41 -0
  26. package/dist/__legacy__/http-client/models/index.d.ts +20 -0
  27. package/dist/__legacy__/models/client-config.d.ts +54 -0
  28. package/dist/__legacy__/models/client.d.ts +82 -0
  29. package/dist/__legacy__/models/http-client.d.ts +42 -0
  30. package/dist/__legacy__/models/index.d.ts +26 -0
  31. package/dist/__legacy__/models/message.d.ts +45 -0
  32. package/dist/__legacy__/models/request-custom-grant.d.ts +24 -0
  33. package/dist/__legacy__/models/session-management-helper.d.ts +23 -0
  34. package/dist/__legacy__/models/sign-in.d.ts +21 -0
  35. package/dist/__legacy__/models/sign-out-error.d.ts +21 -0
  36. package/dist/__legacy__/models/storage.d.ts +38 -0
  37. package/dist/__legacy__/models/web-worker.d.ts +55 -0
  38. package/dist/__legacy__/stores/index.d.ts +20 -0
  39. package/dist/__legacy__/stores/local-store.d.ts +23 -0
  40. package/dist/__legacy__/stores/memory-store.d.ts +25 -0
  41. package/dist/__legacy__/stores/session-store.d.ts +23 -0
  42. package/dist/__legacy__/utils/crypto-utils.d.ts +31 -0
  43. package/dist/__legacy__/utils/index.d.ts +19 -0
  44. package/dist/__legacy__/utils/message-utils.d.ts +37 -0
  45. package/dist/__legacy__/utils/spa-utils.d.ts +107 -0
  46. package/dist/__legacy__/worker/index.d.ts +19 -0
  47. package/dist/__legacy__/worker/worker-core.d.ts +21 -0
  48. package/dist/__legacy__/worker/worker-receiver.d.ts +21 -0
  49. package/dist/cjs/index.js +5437 -0
  50. package/dist/cjs/index.js.map +7 -0
  51. package/dist/constants/StyleConstants.d.ts +28 -0
  52. package/dist/index.d.ts +37 -0
  53. package/dist/index.js +5459 -0
  54. package/dist/index.js.map +7 -0
  55. package/dist/models/config.d.ts +19 -0
  56. package/dist/utils/hasAuthParamsInUrl.d.ts +25 -0
  57. package/dist/utils/withVendorCSSClassPrefix.d.ts +32 -0
  58. package/dist/worker.d.ts +21 -0
  59. package/package.json +76 -0
@@ -0,0 +1,19 @@
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
+ import { Config } from '@asgardeo/javascript';
19
+ export type AsgardeoBrowserConfig = Config;
@@ -0,0 +1,25 @@
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
+ * Utility to check if `code` and `session_state` are available in the URL as search params.
20
+ *
21
+ * @param params - The URL search params to check. Defaults to `window.location.search`.
22
+ * @return `true` if the URL contains `code` and `session_state` search params, otherwise `false`.
23
+ */
24
+ declare const hasAuthParamsInUrl: (params?: string) => boolean;
25
+ export default hasAuthParamsInUrl;
@@ -0,0 +1,32 @@
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
+ * Adds a vendor-specific prefix to a CSS class name.
20
+ *
21
+ * @param className - The original CSS class name to be prefixed
22
+ * @returns A new string with the vendor prefix added to the class name
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Usage with clsx
27
+ * clsx(withVendorCSSClassPrefix('sign-in-button'), className)
28
+ * // Result: "wso2-sign-in-button"
29
+ * ```
30
+ */
31
+ declare const withVendorCSSClassPrefix: (className: string) => string;
32
+ export default withVendorCSSClassPrefix;
@@ -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
+ declare const _default: typeof Worker & {
19
+ new (): Worker;
20
+ };
21
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@asgardeo/browser",
3
+ "version": "0.0.1",
4
+ "description": "Browser-specific implementation of Asgardeo JavaScript SDK.",
5
+ "keywords": [
6
+ "asgardeo",
7
+ "browser",
8
+ "spa"
9
+ ],
10
+ "homepage": "https://github.com/asgardeo/javascript/tree/main/packages/browser#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/asgardeo/javascript/issues"
13
+ },
14
+ "author": "WSO2",
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
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "types": "dist/index.d.ts",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/asgardeo/javascript",
32
+ "directory": "packages/browser"
33
+ },
34
+ "devDependencies": {
35
+ "@testing-library/dom": "^10.4.0",
36
+ "@types/node": "^22.15.3",
37
+ "@vitest/browser": "^3.1.3",
38
+ "@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?a1fc6eb570653c999828aea9f5027cba06af4391",
39
+ "@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?a1fc6eb570653c999828aea9f5027cba06af4391",
40
+ "esbuild": "^0.25.4",
41
+ "esbuild-plugins-node-modules-polyfill": "^1.7.0",
42
+ "eslint": "8.57.0",
43
+ "playwright": "^1.52.0",
44
+ "prettier": "^2.6.2",
45
+ "rimraf": "^6.0.1",
46
+ "typescript": "~5.7.2",
47
+ "vitest": "^3.1.3"
48
+ },
49
+ "dependencies": {
50
+ "axios": "^0.26.0",
51
+ "base64url": "^3.0.1",
52
+ "buffer": "^6.0.3",
53
+ "core-js": "^3.42.0",
54
+ "crypto-browserify": "^3.12.1",
55
+ "esbuild-plugin-polyfill-node": "^0.3.0",
56
+ "fast-sha256": "^1.3.0",
57
+ "jose": "^6.0.11",
58
+ "process": "^0.11.10",
59
+ "randombytes": "^2.1.0",
60
+ "stream-browserify": "^3.0.0",
61
+ "tslib": "^2.8.1",
62
+ "@asgardeo/javascript": "^0.0.1"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "scripts": {
68
+ "build": "pnpm clean && node esbuild.config.mjs && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
69
+ "clean": "rimraf dist",
70
+ "fix:lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
71
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
72
+ "test": "vitest",
73
+ "test:browser": "vitest --workspace=vitest.workspace.ts",
74
+ "typecheck": "tsc -p tsconfig.lib.json"
75
+ }
76
+ }