@asgardeo/browser 0.2.9 → 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.
@@ -0,0 +1,26 @@
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 `state` is available in the URL as a search param and matches the provided instance.
20
+ *
21
+ * @param params - The URL search params to check. Defaults to `window.location.search`.
22
+ * @param instanceId - The instance ID to match against the `state` param.
23
+ * @return `true` if the URL contains a matching `state` search param, otherwise `false`.
24
+ */
25
+ declare const hasCalledForThisInstanceInUrl: (instanceId: number, params?: string) => boolean;
26
+ export default hasCalledForThisInstanceInUrl;
@@ -17,13 +17,34 @@
17
17
  */
18
18
  import { AsgardeoSPAClient } from '../__legacy__/client';
19
19
  /**
20
- * HTTP utility for making requests using the AsgardeoSPAClient instance.
20
+ * Creates an HTTP utility for making requests using a specific AsgardeoSPAClient instance.
21
+ *
22
+ * @param instanceId - Optional instance ID for multi-instance support. Defaults to 0.
23
+ * @returns An object with request and requestAll methods bound to the specified instance.
21
24
  *
22
25
  * @remarks
23
- * This utility provides methods to make single or multiple HTTP requests.
26
+ * This utility provides methods to make single or multiple HTTP requests for a specific instance.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * // Use default instance
31
+ * const httpClient = http();
32
+ *
33
+ * // Use specific instance
34
+ * const httpInstance1 = http(1);
35
+ * const httpInstance2 = http(2);
36
+ * ```
37
+ */
38
+ export declare const http: (instanceId?: number) => {
39
+ request: typeof AsgardeoSPAClient.prototype.httpRequest;
40
+ requestAll: typeof AsgardeoSPAClient.prototype.httpRequestAll;
41
+ };
42
+ /**
43
+ * Default HTTP utility using instance 0.
44
+ * For multi-instance support, use http(instanceId) instead.
24
45
  */
25
- declare const http: {
46
+ declare const _default: {
26
47
  request: typeof AsgardeoSPAClient.prototype.httpRequest;
27
48
  requestAll: typeof AsgardeoSPAClient.prototype.httpRequestAll;
28
49
  };
29
- export default http;
50
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/browser",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "Browser-specific implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -35,8 +35,8 @@
35
35
  "@testing-library/dom": "10.4.0",
36
36
  "@types/node": "22.15.3",
37
37
  "@vitest/browser": "3.1.3",
38
- "@wso2/eslint-plugin": "git+https://github.com/brionmario/wso2-ui-configs.git#a1fc6eb570653c999828aea9f5027cba06af4391&path:packages/eslint-plugin",
39
- "@wso2/prettier-config": "git+https://github.com/brionmario/wso2-ui-configs.git#a1fc6eb570653c999828aea9f5027cba06af4391&path:packages/prettier-config",
38
+ "@wso2/eslint-plugin": "git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/eslint-plugin",
39
+ "@wso2/prettier-config": "git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/prettier-config",
40
40
  "esbuild": "0.25.9",
41
41
  "esbuild-plugin-inline-worker": "0.1.1",
42
42
  "esbuild-plugins-node-modules-polyfill": "1.7.0",
@@ -61,7 +61,7 @@
61
61
  "randombytes": "2.1.0",
62
62
  "stream-browserify": "3.0.0",
63
63
  "tslib": "2.8.1",
64
- "@asgardeo/javascript": "0.7.2"
64
+ "@asgardeo/javascript": "0.8.0"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"