@sisense/sdk-rest-client 1.15.1 → 1.17.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.
@@ -3,8 +3,8 @@ declare type AuthenticatorConfig = {
3
3
  url: string;
4
4
  username?: string;
5
5
  password?: string;
6
- token?: string;
7
- wat?: string;
6
+ token?: string | null;
7
+ wat?: string | null;
8
8
  ssoEnabled?: boolean;
9
9
  enableSilentPreAuth?: boolean;
10
10
  };
package/dist/helpers.d.ts CHANGED
@@ -4,3 +4,10 @@ export declare const appendHeaders: (existingHeaders: HeadersInit, additionalHea
4
4
  export declare const addQueryParamsToUrl: (url: string, params: {
5
5
  [key: string]: string;
6
6
  }) => string;
7
+ /**
8
+ * Checks if API token or WAT token is pending (e.g., being generated)
9
+ * @param token - API token
10
+ * @param wat - WAT token
11
+ * @returns true if the token is pending
12
+ */
13
+ export declare const isAuthTokenPending: (token?: string | null, wat?: string | null) => boolean;
package/dist/helpers.js CHANGED
@@ -21,3 +21,12 @@ export const addQueryParamsToUrl = (url, params) => {
21
21
  // replace the trailing slash if there is one
22
22
  return urlObject.toString().replace(/\/([?&])/, '$1');
23
23
  };
24
+ /**
25
+ * Checks if API token or WAT token is pending (e.g., being generated)
26
+ * @param token - API token
27
+ * @param wat - WAT token
28
+ * @returns true if the token is pending
29
+ */
30
+ export const isAuthTokenPending = (token, wat) => {
31
+ return token === null || wat === null;
32
+ };
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export { SsoAuthenticator, isSsoAuthenticator } from './sso-authenticator.js';
5
5
  export { BearerAuthenticator, isBearerAuthenticator } from './bearer-authenticator.js';
6
6
  export { WatAuthenticator, isWatAuthenticator } from './wat-authenticator.js';
7
7
  export { getAuthenticator } from './authenticator.js';
8
+ export { isAuthTokenPending } from './helpers.js';
8
9
  export { HttpClient } from './http-client.js';
package/dist/index.js CHANGED
@@ -5,4 +5,5 @@ export { SsoAuthenticator, isSsoAuthenticator } from './sso-authenticator.js';
5
5
  export { BearerAuthenticator, isBearerAuthenticator } from './bearer-authenticator.js';
6
6
  export { WatAuthenticator, isWatAuthenticator } from './wat-authenticator.js';
7
7
  export { getAuthenticator } from './authenticator.js';
8
+ export { isAuthTokenPending } from './helpers.js';
8
9
  export { HttpClient } from './http-client.js';
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.15.1",
14
+ "version": "1.17.0",
15
15
  "type": "module",
16
16
  "exports": "./dist/index.js",
17
17
  "main": "./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "author": "Sisense",
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@sisense/sdk-common": "^1.15.1",
23
+ "@sisense/sdk-common": "^1.17.0",
24
24
  "fetch-intercept": "^2.4.0"
25
25
  },
26
26
  "scripts": {