@tidecloak/js 0.14.2 → 0.14.7

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 (39) hide show
  1. package/dist/cjs/lib/secureFetchPolicy.js.map +1 -1
  2. package/dist/cjs/lib/tidecloak-dpop.js +2 -1
  3. package/dist/cjs/lib/tidecloak-dpop.js.map +1 -1
  4. package/dist/cjs/lib/tidecloak.js.map +1 -1
  5. package/dist/cjs/src/AdminAPI.js.map +1 -1
  6. package/dist/cjs/src/IAMService.js +7 -4
  7. package/dist/cjs/src/IAMService.js.map +1 -1
  8. package/dist/cjs/src/utils/fetch.js.map +1 -1
  9. package/dist/cjs/src/utils/initOptions.js.map +1 -1
  10. package/dist/cjs/src/utils/pkce.js.map +1 -1
  11. package/dist/cjs/src/utils/silentCheckSso.js.map +1 -1
  12. package/dist/esm/lib/tidecloak-dpop.js +2 -1
  13. package/dist/esm/lib/tidecloak-dpop.js.map +1 -1
  14. package/dist/esm/lib/tidecloak.js.map +1 -1
  15. package/dist/esm/src/AdminAPI.js.map +1 -1
  16. package/dist/esm/src/IAMService.js +7 -4
  17. package/dist/esm/src/IAMService.js.map +1 -1
  18. package/dist/types/AdminAPI.d.ts +17 -10
  19. package/dist/types/IAMService.d.ts +31 -23
  20. package/dist/types/index.d.ts +14 -8
  21. package/dist/types/lib/secureFetchPolicy.d.ts +1 -1
  22. package/dist/types/lib/tidecloak-dpop.d.ts +9 -9
  23. package/dist/types/lib/tidecloak.d.ts +92 -72
  24. package/dist/types/policy-react.d.ts +1 -1
  25. package/dist/types/src/AdminAPI.d.ts +11 -4
  26. package/dist/types/src/IAMService.d.ts +11 -11
  27. package/dist/types/src/index.d.ts +14 -8
  28. package/dist/types/src/policy-react.d.ts +1 -1
  29. package/dist/types/src/utils/fetch.d.ts +1 -1
  30. package/dist/types/src/utils/index.d.ts +4 -4
  31. package/dist/types/src/utils/initOptions.d.ts +1 -1
  32. package/dist/types/src/utils/pkce.d.ts +3 -3
  33. package/dist/types/src/utils/silentCheckSso.d.ts +28 -28
  34. package/dist/types/utils/fetch.d.ts +1 -1
  35. package/dist/types/utils/index.d.ts +4 -4
  36. package/dist/types/utils/initOptions.d.ts +3 -3
  37. package/dist/types/utils/pkce.d.ts +3 -3
  38. package/dist/types/utils/silentCheckSso.d.ts +27 -27
  39. package/package.json +4 -4
@@ -1,9 +1,65 @@
1
- export { shouldAttachDpopProof } from "./secureFetchPolicy.js";
2
- export default class TideCloak {
1
+ /**
2
+ * @import {Acr, TideCloakAccountOptions, TideCloakAdapter, TideCloakConfig, TideCloakError, TideCloakFlow, TideCloakInitOptions, TideCloakLoginOptions, TideCloakLogoutOptions, TideCloakPkceMethod, TideCloakProfile, TideCloakRegisterOptions, TideCloakResourceAccess, TideCloakResponseMode, TideCloakResponseType, TideCloakRoles, TideCloakTokenParsed, OpenIdProviderMetadata} from "./tidecloak.js"
3
+ */
4
+ import type { TideCloakAccountOptions, TideCloakConfig, TideCloakError, TideCloakFlow, TideCloakInitOptions, TideCloakLoginOptions, TideCloakLogoutOptions, TideCloakPkceMethod, TideCloakProfile, TideCloakRegisterOptions, TideCloakResourceAccess, TideCloakResponseMode, TideCloakResponseType, TideCloakRoles, TideCloakTokenParsed } from "./tidecloak.js";
5
+ export type Endpoints = {
6
+ authorize: () => string;
7
+ token: () => string;
8
+ logout: () => string;
9
+ checkSessionIframe: () => string;
10
+ thirdPartyCookiesIframe?: (() => string) | undefined;
11
+ register: () => string;
12
+ userinfo: () => string;
13
+ };
14
+ export type LoginIframe = {
15
+ enable: boolean;
16
+ callbackList: ((error: Error | null, value?: boolean) => void)[];
17
+ interval: number;
18
+ iframe?: HTMLIFrameElement | undefined;
19
+ iframeOrigin?: string | undefined;
20
+ };
21
+ export { shouldAttachDpopProof } from './secureFetchPolicy.js';
22
+ export { RequestEnclave, ApprovalEnclave, ApprovalEnclaveNew, PolicySignRequest } from "heimdall-tide";
23
+ export { Tools, Models } from "@tideorg/js";
24
+ export type ParsedCallbackParams = {
25
+ paramsString: string;
26
+ oauthParams: Record<string, string | undefined>;
27
+ };
28
+ export type AccessTokenResponse = {
3
29
  /**
4
- * @param {TideCloakConfig} config
30
+ * The access token issued by the authorization server.
5
31
  */
6
- constructor(config: TideCloakConfig);
32
+ access_token: string;
33
+ /**
34
+ * The type of the token issued by the authorization server.
35
+ */
36
+ token_type: string;
37
+ /**
38
+ * The lifetime in seconds of the access token.
39
+ */
40
+ expires_in?: number;
41
+ /**
42
+ * The refresh token issued by the authorization server.
43
+ */
44
+ refresh_token?: string;
45
+ /**
46
+ * The ID token issued by the authorization server, if requested.
47
+ */
48
+ id_token?: string;
49
+ /**
50
+ * The scope of the access token.
51
+ */
52
+ scope?: string;
53
+ /**
54
+ * The Tide doken issued by the authorization server.
55
+ */
56
+ doken?: string;
57
+ };
58
+ export default class TideCloak {
59
+ #private;
60
+ useDPoP: import("./tidecloak.js").DPoPConfig | undefined;
61
+ dpopSigningAlgValuesSupported: string[] | undefined;
62
+ issuer: string | undefined;
7
63
  didInitialize: boolean;
8
64
  authenticated: boolean;
9
65
  loginRequired: boolean;
@@ -34,7 +90,7 @@ export default class TideCloak {
34
90
  pkceMethod: TideCloakPkceMethod;
35
91
  enableLogging: boolean;
36
92
  /** @type {'GET' | 'POST'} */
37
- logoutMethod: "GET" | "POST";
93
+ logoutMethod: 'GET' | 'POST';
38
94
  /** @type {string=} */
39
95
  scope: string | undefined;
40
96
  messageReceiveTimeout: number;
@@ -95,15 +151,16 @@ export default class TideCloak {
95
151
  /** @type {(authenticated: boolean) => void=} */
96
152
  onReady: ((authenticated: boolean) => void) | undefined;
97
153
  /** @type {(status: 'success' | 'cancelled' | 'error', action: string) => void=} */
98
- onActionUpdate: ((status: "success" | "cancelled" | "error", action: string) => void) | undefined;
154
+ onActionUpdate: ((status: 'success' | 'cancelled' | 'error', action: string) => void) | undefined;
155
+ /**
156
+ * @param {TideCloakConfig} config
157
+ */
158
+ constructor(config: TideCloakConfig);
99
159
  /**
100
160
  * @param {TideCloakInitOptions} initOptions
101
161
  * @returns {Promise<boolean>}
102
162
  */
103
163
  init: (initOptions?: TideCloakInitOptions) => Promise<boolean>;
104
- useDPoP: import("./tidecloak.js").DPoPConfig | undefined;
105
- dpopSigningAlgValuesSupported: string[] | undefined;
106
- issuer: string | undefined;
107
164
  /**
108
165
  * @param {TideCloakLoginOptions} [options]
109
166
  * @returns {Promise<void>}
@@ -265,25 +322,19 @@ export default class TideCloak {
265
322
  encrypted: string | Uint8Array;
266
323
  tags: string[];
267
324
  }[], decryption_policy?: Uint8Array): Promise<(string | Uint8Array)[]>;
268
- #private;
269
- }
270
- /**
271
- * @typedef {Object} NetworkErrorOptionsProperties
272
- * @property {Response} response
273
- * @typedef {ErrorOptions & NetworkErrorOptionsProperties} NetworkErrorOptions
274
- */
275
- export class NetworkError extends Error {
276
- /**
277
- * @param {string} message
278
- * @param {NetworkErrorOptions} options
279
- */
280
- constructor(message: string, options: NetworkErrorOptions);
281
- /** @type {Response} */
282
- response: Response;
283
325
  }
284
- /**
285
- * The JSON version of the adapter configuration.
286
- */
326
+ export type CallbackState = {
327
+ state: string;
328
+ nonce: string;
329
+ redirectUri: string;
330
+ loginOptions?: TideCloakLoginOptions;
331
+ prompt?: TideCloakLoginOptions['prompt'];
332
+ pkceCodeVerifier?: string;
333
+ };
334
+ export type CallbackStorage = {
335
+ get: (state?: string) => CallbackState | null;
336
+ add: (state: CallbackState) => void;
337
+ };
287
338
  export type JsonConfig = {
288
339
  /**
289
340
  * The URL of the authentication server.
@@ -298,52 +349,21 @@ export type JsonConfig = {
298
349
  */
299
350
  resource: string;
300
351
  };
301
- export type Endpoints = {
302
- authorize: () => string;
303
- token: () => string;
304
- logout: () => string;
305
- checkSessionIframe: () => string;
306
- thirdPartyCookiesIframe?: (() => string) | undefined;
307
- register: () => string;
308
- userinfo: () => string;
309
- };
310
- export type LoginIframe = {
311
- enable: boolean;
312
- callbackList: ((error: Error | null, value?: boolean) => void)[];
313
- interval: number;
314
- iframe?: HTMLIFrameElement | undefined;
315
- iframeOrigin?: string | undefined;
316
- };
317
- export type CallbackState = {
318
- state: string;
319
- nonce: string;
320
- redirectUri: string;
321
- loginOptions?: TideCloakLoginOptions | undefined;
322
- prompt?: TideCloakLoginOptions["prompt"];
323
- pkceCodeVerifier?: string | undefined;
324
- };
325
- export type CallbackStorage = {
326
- get: (state?: string) => CallbackState | null;
327
- add: (state: CallbackState) => void;
328
- };
329
352
  export type NetworkErrorOptionsProperties = {
330
353
  response: Response;
331
354
  };
332
355
  export type NetworkErrorOptions = ErrorOptions & NetworkErrorOptionsProperties;
333
- import type { TideCloakResponseMode } from "./tidecloak.js";
334
- import type { TideCloakResponseType } from "./tidecloak.js";
335
- import type { TideCloakFlow } from "./tidecloak.js";
336
- import type { TideCloakPkceMethod } from "./tidecloak.js";
337
- import type { TideCloakTokenParsed } from "./tidecloak.js";
338
- import type { TideCloakRoles } from "./tidecloak.js";
339
- import type { TideCloakResourceAccess } from "./tidecloak.js";
340
- import type { TideCloakProfile } from "./tidecloak.js";
341
- import type { TideCloakError } from "./tidecloak.js";
342
- import type { TideCloakInitOptions } from "./tidecloak.js";
343
- import type { TideCloakLoginOptions } from "./tidecloak.js";
344
- import type { TideCloakLogoutOptions } from "./tidecloak.js";
345
- import type { TideCloakRegisterOptions } from "./tidecloak.js";
346
- import type { TideCloakAccountOptions } from "./tidecloak.js";
347
- import type { TideCloakConfig } from "./tidecloak.js";
348
- export { RequestEnclave, ApprovalEnclave, ApprovalEnclaveNew, PolicySignRequest } from "heimdall-tide";
349
- export { Tools, Models } from "@tideorg/js";
356
+ /**
357
+ * @typedef {Object} NetworkErrorOptionsProperties
358
+ * @property {Response} response
359
+ * @typedef {ErrorOptions & NetworkErrorOptionsProperties} NetworkErrorOptions
360
+ */
361
+ export declare class NetworkError extends Error {
362
+ /** @type {Response} */
363
+ response: Response;
364
+ /**
365
+ * @param {string} message
366
+ * @param {NetworkErrorOptions} options
367
+ */
368
+ constructor(message: string, options: NetworkErrorOptions);
369
+ }
@@ -1 +1 @@
1
- export {};
1
+ export * from '@tidecloak/policy/react';
@@ -1,8 +1,12 @@
1
- export default adminAPI;
2
- declare const adminAPI: AdminAPI;
3
- export class AdminAPI {
4
- constructor(realm: any);
1
+ /**
2
+ * AdminAPI - Keycloak Admin REST API client
3
+ *
4
+ * Provides methods to interact with the Keycloak Admin REST API
5
+ * using the IAMService for authentication.
6
+ */
7
+ declare class AdminAPI {
5
8
  realm: any;
9
+ constructor(realm: any);
6
10
  /**
7
11
  * Set the realm for API calls
8
12
  */
@@ -116,3 +120,6 @@ export class AdminAPI {
116
120
  approveChangeSetWithSignature(changeSet: Object, signedRequest: string): Promise<any>;
117
121
  getAccessLogs(params?: {}): Promise<any>;
118
122
  }
123
+ declare const adminAPI: AdminAPI;
124
+ export default adminAPI;
125
+ export { AdminAPI };
@@ -1,6 +1,4 @@
1
- export { IAMServiceInstance as IAMService };
2
- export default IAMServiceInstance;
3
- declare const IAMServiceInstance: IAMService;
1
+ import TideCloak, { RequestEnclave } from "../lib/tidecloak.js";
4
2
  /**
5
3
  * Singleton IAMService wrapping the TideCloak client.
6
4
  *
@@ -111,7 +109,7 @@ declare class IAMService {
111
109
  _hybridAuthenticated: boolean;
112
110
  _hybridReturnUrl: string | null;
113
111
  _hybridCallbackHandled: boolean;
114
- _hybridCallbackPromise: any;
112
+ _hybridCallbackPromise: Promise<boolean> | null;
115
113
  _cachedCallbackData: {
116
114
  isCallback: boolean;
117
115
  code: string;
@@ -136,7 +134,7 @@ declare class IAMService {
136
134
  _nativeTokens: any;
137
135
  _nativeCallbackUnsubscribe: any;
138
136
  _nativeCallbackHandled: boolean;
139
- _nativeCallbackPromise: any;
137
+ _nativeCallbackPromise: Promise<boolean> | null;
140
138
  _nativeCallbackProcessing: boolean;
141
139
  _nativeDoken: any;
142
140
  _nativeDokenParsed: Object | null;
@@ -146,13 +144,14 @@ declare class IAMService {
146
144
  _pendingEncryptionRequests: Map<any, any>;
147
145
  _dpopProvider: import("../lib/tidecloak-dpop.js").DPoPSignatureProvider | null;
148
146
  _frontchannelInitPromise: Promise<boolean> | null;
147
+ constructor();
149
148
  /**
150
149
  * Register an event listener.
151
150
  * @param {'ready'|'initError'|'authSuccess'|'authError'|'authRefreshSuccess'|'authRefreshError'|'logout'|'tokenExpired'} event
152
151
  * @param {Function} handler
153
152
  * @returns {this}
154
153
  */
155
- on(event: "ready" | "initError" | "authSuccess" | "authError" | "authRefreshSuccess" | "authRefreshError" | "logout" | "tokenExpired", handler: Function): this;
154
+ on(event: 'ready' | 'initError' | 'authSuccess' | 'authError' | 'authRefreshSuccess' | 'authRefreshError' | 'logout' | 'tokenExpired', handler: Function): this;
156
155
  /**
157
156
  * Unregister an event listener.
158
157
  * @param {string} event
@@ -457,9 +456,9 @@ declare class IAMService {
457
456
  * }
458
457
  */
459
458
  getHybridCallbackData(opts?: {
460
- clearStorage?: boolean | undefined;
461
- redirectUri?: string | undefined;
462
- provider?: string | undefined;
459
+ clearStorage?: boolean;
460
+ redirectUri?: string;
461
+ provider?: string;
463
462
  }): {
464
463
  isCallback: boolean;
465
464
  code: string;
@@ -601,5 +600,6 @@ declare class IAMService {
601
600
  */
602
601
  destroy(): void;
603
602
  }
604
- import TideCloak from "../lib/tidecloak.js";
605
- import { RequestEnclave } from "../lib/tidecloak.js";
603
+ declare const IAMServiceInstance: IAMService;
604
+ export { IAMServiceInstance as IAMService };
605
+ export default IAMServiceInstance;
@@ -1,9 +1,15 @@
1
- export { default as IAMService } from "./IAMService.js";
2
- export type NativeAdapter = import("./types.js").NativeAdapter;
3
- export type NativeTokenData = import("./types.js").NativeTokenData;
4
- export type NativeAuthCallbackResult = import("./types.js").NativeAuthCallbackResult;
5
- export type NativeEncryptionCallbackResult = import("./types.js").NativeEncryptionCallbackResult;
6
- export type NativeConfig = import("./types.js").NativeConfig;
7
- export { default as TideCloak, RequestEnclave, ApprovalEnclaveNew } from "../lib/tidecloak.js";
1
+ export { default as IAMService } from './IAMService.js';
2
+ export { default as TideCloak } from "../lib/tidecloak.js";
3
+ export { RequestEnclave, ApprovalEnclaveNew } from "../lib/tidecloak.js";
8
4
  export { Tools, Models } from "@tideorg/js";
9
- export { default as AdminAPI, AdminAPI as AdminAPIClass } from "./AdminAPI.js";
5
+ export type NativeAdapter = import('./types.js').NativeAdapter;
6
+ export type NativeTokenData = import('./types.js').NativeTokenData;
7
+ export type NativeAuthCallbackResult = import('./types.js').NativeAuthCallbackResult;
8
+ export type NativeEncryptionCallbackResult = import('./types.js').NativeEncryptionCallbackResult;
9
+ export type NativeConfig = import('./types.js').NativeConfig;
10
+ /** @typedef {import('./types.js').NativeAdapter} NativeAdapter */
11
+ /** @typedef {import('./types.js').NativeTokenData} NativeTokenData */
12
+ /** @typedef {import('./types.js').NativeAuthCallbackResult} NativeAuthCallbackResult */
13
+ /** @typedef {import('./types.js').NativeEncryptionCallbackResult} NativeEncryptionCallbackResult */
14
+ /** @typedef {import('./types.js').NativeConfig} NativeConfig */
15
+ export { default as AdminAPI, AdminAPI as AdminAPIClass } from './AdminAPI.js';
@@ -1 +1 @@
1
- export {};
1
+ export * from '@tidecloak/policy/react';
@@ -8,4 +8,4 @@
8
8
  * @returns {Promise<any>} Parsed JSON response
9
9
  * @throws {Error} If request fails (with status and body properties)
10
10
  */
11
- export function fetchJson(url: string, options?: RequestInit): Promise<any>;
11
+ export declare function fetchJson(url: string, options?: RequestInit): Promise<any>;
@@ -1,4 +1,4 @@
1
- export { fetchJson } from "./fetch.js";
2
- export { buildInitOptions } from "./initOptions.js";
3
- export { makePkce, randomPkceVerifier, base64UrlEncode } from "./pkce.js";
4
- export { resolveSilentCheckSsoRedirectUri, SILENT_CHECK_SSO_FILENAME } from "./silentCheckSso.js";
1
+ export { makePkce, randomPkceVerifier, base64UrlEncode } from './pkce.js';
2
+ export { fetchJson } from './fetch.js';
3
+ export { resolveSilentCheckSsoRedirectUri, SILENT_CHECK_SSO_FILENAME } from './silentCheckSso.js';
4
+ export { buildInitOptions } from './initOptions.js';
@@ -62,7 +62,7 @@
62
62
  * `undefined` when no correct URI could be derived.
63
63
  * @returns {Object} Options for `TideCloak.init()`.
64
64
  */
65
- export function buildInitOptions({ config, setupRequestEnclave, silentCheckSsoRedirectUri, }: {
65
+ export declare function buildInitOptions({ config, setupRequestEnclave, silentCheckSsoRedirectUri, }: {
66
66
  config: Object | null | undefined;
67
67
  setupRequestEnclave: boolean;
68
68
  silentCheckSsoRedirectUri: string | undefined;
@@ -6,18 +6,18 @@
6
6
  * @param {number} len - Length of the verifier (default 96)
7
7
  * @returns {string} Random verifier string
8
8
  */
9
- export function randomPkceVerifier(len?: number): string;
9
+ export declare function randomPkceVerifier(len?: number): string;
10
10
  /**
11
11
  * Base64 URL encode an ArrayBuffer.
12
12
  * @param {ArrayBuffer} arrayBuffer - Buffer to encode
13
13
  * @returns {string} Base64 URL encoded string
14
14
  */
15
- export function base64UrlEncode(arrayBuffer: ArrayBuffer): string;
15
+ export declare function base64UrlEncode(arrayBuffer: ArrayBuffer): string;
16
16
  /**
17
17
  * Generate PKCE verifier and challenge.
18
18
  * @returns {Promise<{verifier: string, challenge: string, method: string}>}
19
19
  */
20
- export function makePkce(): Promise<{
20
+ export declare function makePkce(): Promise<{
21
21
  verifier: string;
22
22
  challenge: string;
23
23
  method: string;
@@ -1,28 +1,3 @@
1
- /**
2
- * @typedef {object} SilentCheckSsoResolution
3
- * @property {string|undefined} uri The resolved URI, or undefined if none could be derived.
4
- * @property {'config'|'base-href'|'redirect-uri-convention'|'redirect-uri'|'origin-root'|'none'} source
5
- * @property {string} [reason] Why resolution failed (only when `uri` is undefined).
6
- */
7
- /**
8
- * Resolve the silent-check-SSO redirect URI.
9
- *
10
- * Pure: every environment input is passed in explicitly, so this is unit-testable
11
- * with no DOM. See the module docblock for the resolution order.
12
- *
13
- * @param {object} params
14
- * @param {string} params.origin The app's origin (`window.location.origin`).
15
- * @param {string} [params.configured] Caller-supplied `silentCheckSsoRedirectUri`.
16
- * @param {string} [params.baseHref] `document.baseURI`, but ONLY when a `<base href>` element exists.
17
- * @param {string} [params.redirectUri] Caller-supplied OIDC `redirectUri`.
18
- * @returns {SilentCheckSsoResolution}
19
- */
20
- export function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref, redirectUri }?: {
21
- origin: string;
22
- configured?: string | undefined;
23
- baseHref?: string | undefined;
24
- redirectUri?: string | undefined;
25
- }): SilentCheckSsoResolution;
26
1
  /**
27
2
  * Resolution of the silent-check-SSO redirect URI.
28
3
  *
@@ -68,15 +43,40 @@ export function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref,
68
43
  * SKIP the silent check rather than emit a URI that will 400.
69
44
  */
70
45
  /** Filename the SDK ships and that hosting providers are expected to serve. */
71
- export const SILENT_CHECK_SSO_FILENAME: "silent-check-sso.html";
46
+ export declare const SILENT_CHECK_SSO_FILENAME = "silent-check-sso.html";
72
47
  export type SilentCheckSsoResolution = {
73
48
  /**
74
49
  * The resolved URI, or undefined if none could be derived.
75
50
  */
76
51
  uri: string | undefined;
77
- source: "config" | "base-href" | "redirect-uri-convention" | "redirect-uri" | "origin-root" | "none";
52
+ source: 'config' | 'base-href' | 'redirect-uri-convention' | 'redirect-uri' | 'origin-root' | 'none';
78
53
  /**
79
54
  * Why resolution failed (only when `uri` is undefined).
80
55
  */
81
- reason?: string | undefined;
56
+ reason?: string;
82
57
  };
58
+ /**
59
+ * @typedef {object} SilentCheckSsoResolution
60
+ * @property {string|undefined} uri The resolved URI, or undefined if none could be derived.
61
+ * @property {'config'|'base-href'|'redirect-uri-convention'|'redirect-uri'|'origin-root'|'none'} source
62
+ * @property {string} [reason] Why resolution failed (only when `uri` is undefined).
63
+ */
64
+ /**
65
+ * Resolve the silent-check-SSO redirect URI.
66
+ *
67
+ * Pure: every environment input is passed in explicitly, so this is unit-testable
68
+ * with no DOM. See the module docblock for the resolution order.
69
+ *
70
+ * @param {object} params
71
+ * @param {string} params.origin The app's origin (`window.location.origin`).
72
+ * @param {string} [params.configured] Caller-supplied `silentCheckSsoRedirectUri`.
73
+ * @param {string} [params.baseHref] `document.baseURI`, but ONLY when a `<base href>` element exists.
74
+ * @param {string} [params.redirectUri] Caller-supplied OIDC `redirectUri`.
75
+ * @returns {SilentCheckSsoResolution}
76
+ */
77
+ export declare function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref, redirectUri }?: {
78
+ origin: string;
79
+ configured?: string;
80
+ baseHref?: string;
81
+ redirectUri?: string;
82
+ }): SilentCheckSsoResolution;
@@ -8,4 +8,4 @@
8
8
  * @returns {Promise<any>} Parsed JSON response
9
9
  * @throws {Error} If request fails (with status and body properties)
10
10
  */
11
- export function fetchJson(url: string, options?: RequestInit): Promise<any>;
11
+ export declare function fetchJson(url: string, options?: RequestInit): Promise<any>;
@@ -1,4 +1,4 @@
1
- export { fetchJson } from "./fetch.js";
2
- export { buildInitOptions } from "./initOptions.js";
3
- export { makePkce, randomPkceVerifier, base64UrlEncode } from "./pkce.js";
4
- export { resolveSilentCheckSsoRedirectUri, SILENT_CHECK_SSO_FILENAME } from "./silentCheckSso.js";
1
+ export { makePkce, randomPkceVerifier, base64UrlEncode } from './pkce.js';
2
+ export { fetchJson } from './fetch.js';
3
+ export { resolveSilentCheckSsoRedirectUri, SILENT_CHECK_SSO_FILENAME } from './silentCheckSso.js';
4
+ export { buildInitOptions } from './initOptions.js';
@@ -62,8 +62,8 @@
62
62
  * `undefined` when no correct URI could be derived.
63
63
  * @returns {Object} Options for `TideCloak.init()`.
64
64
  */
65
- export function buildInitOptions({ config, setupRequestEnclave, silentCheckSsoRedirectUri, }: {
66
- config: any | null | undefined;
65
+ export declare function buildInitOptions({ config, setupRequestEnclave, silentCheckSsoRedirectUri, }: {
66
+ config: Object | null | undefined;
67
67
  setupRequestEnclave: boolean;
68
68
  silentCheckSsoRedirectUri: string | undefined;
69
- }): any;
69
+ }): Object;
@@ -6,18 +6,18 @@
6
6
  * @param {number} len - Length of the verifier (default 96)
7
7
  * @returns {string} Random verifier string
8
8
  */
9
- export function randomPkceVerifier(len?: number): string;
9
+ export declare function randomPkceVerifier(len?: number): string;
10
10
  /**
11
11
  * Base64 URL encode an ArrayBuffer.
12
12
  * @param {ArrayBuffer} arrayBuffer - Buffer to encode
13
13
  * @returns {string} Base64 URL encoded string
14
14
  */
15
- export function base64UrlEncode(arrayBuffer: ArrayBuffer): string;
15
+ export declare function base64UrlEncode(arrayBuffer: ArrayBuffer): string;
16
16
  /**
17
17
  * Generate PKCE verifier and challenge.
18
18
  * @returns {Promise<{verifier: string, challenge: string, method: string}>}
19
19
  */
20
- export function makePkce(): Promise<{
20
+ export declare function makePkce(): Promise<{
21
21
  verifier: string;
22
22
  challenge: string;
23
23
  method: string;
@@ -1,28 +1,3 @@
1
- /**
2
- * @typedef {object} SilentCheckSsoResolution
3
- * @property {string|undefined} uri The resolved URI, or undefined if none could be derived.
4
- * @property {'config'|'base-href'|'redirect-uri-convention'|'redirect-uri'|'origin-root'|'none'} source
5
- * @property {string} [reason] Why resolution failed (only when `uri` is undefined).
6
- */
7
- /**
8
- * Resolve the silent-check-SSO redirect URI.
9
- *
10
- * Pure: every environment input is passed in explicitly, so this is unit-testable
11
- * with no DOM. See the module docblock for the resolution order.
12
- *
13
- * @param {object} params
14
- * @param {string} params.origin The app's origin (`window.location.origin`).
15
- * @param {string} [params.configured] Caller-supplied `silentCheckSsoRedirectUri`.
16
- * @param {string} [params.baseHref] `document.baseURI`, but ONLY when a `<base href>` element exists.
17
- * @param {string} [params.redirectUri] Caller-supplied OIDC `redirectUri`.
18
- * @returns {SilentCheckSsoResolution}
19
- */
20
- export function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref, redirectUri }?: {
21
- origin: string;
22
- configured?: string;
23
- baseHref?: string;
24
- redirectUri?: string;
25
- }): SilentCheckSsoResolution;
26
1
  /**
27
2
  * Resolution of the silent-check-SSO redirect URI.
28
3
  *
@@ -68,15 +43,40 @@ export function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref,
68
43
  * SKIP the silent check rather than emit a URI that will 400.
69
44
  */
70
45
  /** Filename the SDK ships and that hosting providers are expected to serve. */
71
- export const SILENT_CHECK_SSO_FILENAME: "silent-check-sso.html";
46
+ export declare const SILENT_CHECK_SSO_FILENAME = "silent-check-sso.html";
72
47
  export type SilentCheckSsoResolution = {
73
48
  /**
74
49
  * The resolved URI, or undefined if none could be derived.
75
50
  */
76
51
  uri: string | undefined;
77
- source: "config" | "base-href" | "redirect-uri-convention" | "redirect-uri" | "origin-root" | "none";
52
+ source: 'config' | 'base-href' | 'redirect-uri-convention' | 'redirect-uri' | 'origin-root' | 'none';
78
53
  /**
79
54
  * Why resolution failed (only when `uri` is undefined).
80
55
  */
81
56
  reason?: string;
82
57
  };
58
+ /**
59
+ * @typedef {object} SilentCheckSsoResolution
60
+ * @property {string|undefined} uri The resolved URI, or undefined if none could be derived.
61
+ * @property {'config'|'base-href'|'redirect-uri-convention'|'redirect-uri'|'origin-root'|'none'} source
62
+ * @property {string} [reason] Why resolution failed (only when `uri` is undefined).
63
+ */
64
+ /**
65
+ * Resolve the silent-check-SSO redirect URI.
66
+ *
67
+ * Pure: every environment input is passed in explicitly, so this is unit-testable
68
+ * with no DOM. See the module docblock for the resolution order.
69
+ *
70
+ * @param {object} params
71
+ * @param {string} params.origin The app's origin (`window.location.origin`).
72
+ * @param {string} [params.configured] Caller-supplied `silentCheckSsoRedirectUri`.
73
+ * @param {string} [params.baseHref] `document.baseURI`, but ONLY when a `<base href>` element exists.
74
+ * @param {string} [params.redirectUri] Caller-supplied OIDC `redirectUri`.
75
+ * @returns {SilentCheckSsoResolution}
76
+ */
77
+ export declare function resolveSilentCheckSsoRedirectUri({ origin, configured, baseHref, redirectUri }?: {
78
+ origin: string;
79
+ configured?: string;
80
+ baseHref?: string;
81
+ redirectUri?: string;
82
+ }): SilentCheckSsoResolution;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidecloak/js",
3
- "version": "0.14.2",
3
+ "version": "0.14.7",
4
4
  "description": "Vanilla JavaScript/browser SDK for TideCloak with an IAMService singleton and low-level client.",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/src/index.js",
@@ -57,11 +57,11 @@
57
57
  "authorization"
58
58
  ],
59
59
  "dependencies": {
60
- "heimdall-tide": "^0.14.2",
61
- "@tideorg/js": "^0.14.2"
60
+ "heimdall-tide": "^0.14.7",
61
+ "@tideorg/js": "^0.14.7"
62
62
  },
63
63
  "peerDependencies": {
64
- "@tidecloak/policy": "^0.14.2"
64
+ "@tidecloak/policy": "^0.14.7"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@tidecloak/policy": {