@gandalan/weblibs 1.3.5 → 1.3.6

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/api/fluentApi.js CHANGED
@@ -3,13 +3,13 @@ import { restClient } from "./fluentRestClient";
3
3
  /**
4
4
  * @typedef {Object} FluentApi
5
5
  * @property {string} baseUrl - The base URL for API requests.
6
- * @property {FluentAuthManager} authManager - The authentication manager.
6
+ * @property {import("./fluentAuthManager").FluentAuthManager} authManager - The authentication manager.
7
7
  * @property {function(string) : FluentApi} useBaseUrl - Sets the base URL for API requests and returns the FluentApi object.
8
- * @property {function(FluentAuthManager) : FluentApi} useAuthManager - Sets the auth manager and returns the FluentApi object.
9
- * @property {function(string) : object|Array<any>} get - Async function to perform GET requests.
10
- * @property {function(string, object|null) : object|Array<any>} put - Async function to perform PUT requests with a payload.
11
- * @property {function(string, object|null) : object|Array<any>} post - Async function to perform POST requests with a payload.
12
- * @property {function(string) : object|Array<any>} delete - Async function to perform DELETE requests.
8
+ * @property {function(fluentAuthManager) : FluentApi} useAuthManager - Sets the auth manager and returns the FluentApi object.
9
+ * @property {function(string) : Promise<object|Array<any>>} get - Async function to perform GET requests.
10
+ * @property {function(string, object|null) : Promise<object|Array<any>>} put - Async function to perform PUT requests with a payload.
11
+ * @property {function(string, object|null) : Promise<object|Array<any>>} post - Async function to perform POST requests with a payload.
12
+ * @property {function(string) : Promise<object|Array<any>>} delete - Async function to perform DELETE requests.
13
13
  */
14
14
 
15
15
  /**
@@ -102,7 +102,7 @@ export function createApi() {
102
102
  * Creates the REST client instance with the current configuration.
103
103
  *
104
104
  * @private
105
- * @returns {FluentRestClient}
105
+ * @returns {import("./fluentRestClient").FluentRESTClient}
106
106
  */
107
107
  createRestClient() {
108
108
  return restClient().useBaseUrl(this.baseUrl).useToken(this.authManager?.token);
@@ -20,6 +20,8 @@ import { popRefreshTokenFromUrl } from "./fluentAuthUtils";
20
20
  * @property {function} tryRefreshToken - Attempts to refresh the authentication token using the refresh token.
21
21
  * @property {function} updateUserSession - Updates the user session with the new token.
22
22
  * @property {function} redirectToLogin - Redirects to the login page.
23
+ * @property {function(string) : boolean} hasRight - Checks if the user has the specific right.
24
+ * @property {function(string) : boolean} hasRole - Checks if the user has the specific role.
23
25
  */
24
26
 
25
27
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gandalan/weblibs",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "WebLibs for Gandalan JS/TS/Svelte projects",
5
5
  "keywords": [
6
6
  "gandalan"