@thunderid/node 0.0.5 → 0.0.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.
Files changed (47) hide show
  1. package/dist/ThunderIDNodeClient.d.ts +18 -8
  2. package/dist/ThunderIDNodeClient.d.ts.map +1 -1
  3. package/dist/cjs/index.cjs +125 -592
  4. package/dist/index.d.ts +9 -6
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +123 -579
  7. package/dist/{__legacy__/constants/logger-config.d.ts → models/AuthURLCallback.d.ts} +9 -15
  8. package/dist/models/AuthURLCallback.d.ts.map +1 -0
  9. package/dist/models/config.d.ts +27 -14
  10. package/dist/models/config.d.ts.map +1 -1
  11. package/dist/{__legacy__/stores/memory-cache-store.d.ts → stores/MemoryCacheStore.d.ts} +7 -2
  12. package/dist/stores/MemoryCacheStore.d.ts.map +1 -0
  13. package/dist/{__legacy__/utils/crypto-utils.d.ts → utils/NodeCryptoUtils.d.ts} +7 -8
  14. package/dist/utils/NodeCryptoUtils.d.ts.map +1 -0
  15. package/dist/{__legacy__/utils/session-utils.d.ts → utils/SessionUtils.d.ts} +21 -2
  16. package/dist/utils/SessionUtils.d.ts.map +1 -0
  17. package/dist/utils/getSessionCookieOptions.d.ts +2 -22
  18. package/dist/utils/getSessionCookieOptions.d.ts.map +1 -1
  19. package/package.json +2 -2
  20. package/dist/__legacy__/client.d.ts +0 -355
  21. package/dist/__legacy__/client.d.ts.map +0 -1
  22. package/dist/__legacy__/constants/index.d.ts +0 -20
  23. package/dist/__legacy__/constants/index.d.ts.map +0 -1
  24. package/dist/__legacy__/constants/logger-config.d.ts.map +0 -1
  25. package/dist/__legacy__/constants/uuid-config.d.ts +0 -19
  26. package/dist/__legacy__/constants/uuid-config.d.ts.map +0 -1
  27. package/dist/__legacy__/core/authentication.d.ts +0 -46
  28. package/dist/__legacy__/core/authentication.d.ts.map +0 -1
  29. package/dist/__legacy__/core/index.d.ts +0 -19
  30. package/dist/__legacy__/core/index.d.ts.map +0 -1
  31. package/dist/__legacy__/models/index.d.ts +0 -20
  32. package/dist/__legacy__/models/index.d.ts.map +0 -1
  33. package/dist/__legacy__/models/session-data.d.ts +0 -23
  34. package/dist/__legacy__/models/session-data.d.ts.map +0 -1
  35. package/dist/__legacy__/models/url-callback.d.ts +0 -19
  36. package/dist/__legacy__/models/url-callback.d.ts.map +0 -1
  37. package/dist/__legacy__/stores/index.d.ts +0 -19
  38. package/dist/__legacy__/stores/index.d.ts.map +0 -1
  39. package/dist/__legacy__/stores/memory-cache-store.d.ts.map +0 -1
  40. package/dist/__legacy__/utils/crypto-utils.d.ts.map +0 -1
  41. package/dist/__legacy__/utils/index.d.ts +0 -20
  42. package/dist/__legacy__/utils/index.d.ts.map +0 -1
  43. package/dist/__legacy__/utils/logger-utils.d.ts +0 -26
  44. package/dist/__legacy__/utils/logger-utils.d.ts.map +0 -1
  45. package/dist/__legacy__/utils/session-utils.d.ts.map +0 -1
  46. package/dist/models/cookies.d.ts +0 -59
  47. package/dist/models/cookies.d.ts.map +0 -1
@@ -15,18 +15,12 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- interface LoggerConfig {
19
- bgGreen: string;
20
- bgRed: string;
21
- bgWhite: string;
22
- bgYellow: string;
23
- fgBlack: string;
24
- fgGreen: string;
25
- fgRed: string;
26
- fgWhite: string;
27
- fgYellow: string;
28
- reset: string;
29
- }
30
- export declare const LOGGER_CONFIG: LoggerConfig;
31
- export {};
32
- //# sourceMappingURL=logger-config.d.ts.map
18
+ /**
19
+ * Callback invoked with the authorization URL when no authorization code is present.
20
+ * The consumer is responsible for redirecting the user to this URL.
21
+ *
22
+ * @param url - The authorization URL to redirect the user to.
23
+ */
24
+ type AuthURLCallback = (url: string) => void;
25
+ export default AuthURLCallback;
26
+ //# sourceMappingURL=AuthURLCallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthURLCallback.d.ts","sourceRoot":"","sources":["../../src/models/AuthURLCallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,KAAK,eAAe,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAE7C,eAAe,eAAe,CAAC"}
@@ -17,29 +17,42 @@
17
17
  */
18
18
  import { Config } from '@thunderid/javascript';
19
19
  /**
20
- * Configuration type for the ThunderID Node.js SDK.
21
- * Extends the base Config type from @thunderid/javascript with Node.js specific settings.
20
+ * Session cookie configuration options shared across all server-side SDKs.
22
21
  *
23
- * @remarks
24
- * This type is used to configure the Node.js SDK with settings like:
25
- * - Server endpoints
26
- * - Authentication parameters
27
- * - Session management options
22
+ * All fields are optional; unset fields fall back to the defaults defined in
23
+ * each framework SDK's `CookieConfig` constants.
28
24
  */
29
- export type ThunderIDNodeConfig = Config & {
25
+ export interface SessionCookieConfig {
30
26
  /**
31
- * Session cookie lifetime in seconds. Determines how long the session cookie
32
- * remains valid in the browser after sign-in.
27
+ * Session lifetime in seconds. Controls both the server-side session validation
28
+ * window and the browser cookie max-age (multiplied by 1000 for ms).
33
29
  *
34
30
  * Resolution order (first defined value wins):
35
31
  * 1. This field — set programmatically at SDK initialisation.
36
- * 2. `ASGARDEO_SESSION_COOKIE_EXPIRY_TIME` environment variable.
32
+ * 2. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable.
37
33
  * 3. Built-in default of 86400 seconds (24 hours).
38
34
  *
39
35
  * @example
40
- * // 8-hour session cookie
41
- * { sessionCookieExpiryTime: 28800 }
36
+ * // 8-hour session
37
+ * { sessionCookie: { expiryTime: 28800 } }
38
+ */
39
+ expiryTime?: number;
40
+ /** Whether the cookie is inaccessible to JavaScript. Default: `true`. */
41
+ httpOnly?: boolean;
42
+ /** SameSite policy. Default: `'lax'`. */
43
+ sameSite?: 'lax' | 'strict' | 'none';
44
+ /** Whether the cookie requires HTTPS. Default: `false` (dev-friendly). */
45
+ secure?: boolean;
46
+ }
47
+ /**
48
+ * Configuration type for the ThunderID Node.js SDK.
49
+ * Extends the base Config type from @thunderid/javascript with Node.js specific settings.
50
+ */
51
+ export type ThunderIDNodeConfig = Config & {
52
+ /**
53
+ * Session cookie settings. Groups all cookie-related configuration in one place
54
+ * so that any server SDK (Node, Express, Next.js, …) inherits the same shape.
42
55
  */
43
- sessionCookieExpiryTime?: number;
56
+ sessionCookie?: SessionCookieConfig;
44
57
  };
45
58
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/models/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG;IACzC;;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/models/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrC,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC,CAAC"}
@@ -16,9 +16,14 @@
16
16
  * under the License.
17
17
  */
18
18
  import { Storage } from '@thunderid/javascript';
19
- export declare class MemoryCacheStore implements Storage {
19
+ /**
20
+ * In-memory key-value store backed by `memory-cache`.
21
+ * Used as the default storage when no custom store is provided to `ThunderIDNodeClient`.
22
+ */
23
+ declare class MemoryCacheStore implements Storage {
20
24
  setData(key: string, value: string): Promise<void>;
21
25
  getData(key: string): Promise<string>;
22
26
  removeData(key: string): Promise<void>;
23
27
  }
24
- //# sourceMappingURL=memory-cache-store.d.ts.map
28
+ export default MemoryCacheStore;
29
+ //# sourceMappingURL=MemoryCacheStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemoryCacheStore.d.ts","sourceRoot":"","sources":["../../src/stores/MemoryCacheStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAG9C;;;GAGG;AACH,cAAM,gBAAiB,YAAW,OAAO;IAC1B,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpD;AAED,eAAe,gBAAgB,CAAC"}
@@ -16,17 +16,16 @@
16
16
  * under the License.
17
17
  */
18
18
  import { Crypto, JWKInterface } from '@thunderid/javascript';
19
- export declare class NodeCryptoUtils implements Crypto<Buffer | string> {
20
- constructor();
21
- /**
22
- * Get URL encoded string.
23
- *
24
- * @returns {string} base 64 url encoded value.
25
- */
19
+ /**
20
+ * Node.js crypto utilities implementing the `Crypto` interface.
21
+ * Uses `jose`, `base64url`, `fast-sha256`, and `secure-random-bytes`.
22
+ */
23
+ declare class NodeCryptoUtils implements Crypto<Buffer | string> {
26
24
  base64URLEncode(value: Buffer | string): string;
27
25
  base64URLDecode(value: string): string;
28
26
  hashSha256(data: string): string | Buffer;
29
27
  generateRandomBytes(length: number): string | Buffer;
30
28
  verifyJwt(idToken: string, jwk: Partial<JWKInterface>, algorithms: string[], clientId: string, issuer: string, subject: string, clockTolerance?: number): Promise<boolean>;
31
29
  }
32
- //# sourceMappingURL=crypto-utils.d.ts.map
30
+ export default NodeCryptoUtils;
31
+ //# sourceMappingURL=NodeCryptoUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeCryptoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/NodeCryptoUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAM3D;;;GAGG;AACH,cAAM,eAAgB,YAAW,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IAC/C,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAI/C,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAItC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAIzC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAI9C,SAAS,CACpB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,EAC1B,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC;CAYpB;AAED,eAAe,eAAe,CAAC"}
@@ -16,10 +16,29 @@
16
16
  * under the License.
17
17
  */
18
18
  import { SessionData } from '@thunderid/javascript';
19
- export declare class SessionUtils {
19
+ /**
20
+ * Utility class for session validation and UUID management.
21
+ */
22
+ declare class SessionUtils {
20
23
  private constructor();
24
+ /**
25
+ * Generates a new UUID v4 string.
26
+ *
27
+ * @returns A new UUID string.
28
+ */
21
29
  static createUUID(): string;
30
+ /**
31
+ * Returns `true` if the given string is a valid UUID v4.
32
+ *
33
+ * @param uuid - The UUID string to validate.
34
+ */
22
35
  static validateUUID(uuid: string): Promise<boolean>;
36
+ /**
37
+ * Returns `true` if the session token is still within its validity window.
38
+ *
39
+ * @param sessionData - The session data to check.
40
+ */
23
41
  static validateSession(sessionData: SessionData): Promise<boolean>;
24
42
  }
25
- //# sourceMappingURL=session-utils.d.ts.map
43
+ export default SessionUtils;
44
+ //# sourceMappingURL=SessionUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/SessionUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAKlD;;GAEG;AACH,cAAM,YAAY;IAChB,OAAO;IAEP;;;;OAIG;WACW,UAAU,IAAI,MAAM;IAIlC;;;;OAIG;WACW,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO1D;;;;OAIG;WACW,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAK1E;AAED,eAAe,YAAY,CAAC"}
@@ -15,27 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { CookieOptions } from '../models/cookies';
19
- /**
20
- * Creates a complete set of cookie options by merging provided options with defaults
21
- *
22
- * @param options - Partial cookie options to override defaults
23
- *
24
- * @returns Complete cookie options with all required fields
25
- *
26
- * @example
27
- * ```ts
28
- * // Use defaults with only maxAge override
29
- * const options = getSessionCookieOptions({ maxAge: 3600 });
30
- *
31
- * // Override multiple defaults
32
- * const options = getSessionCookieOptions({
33
- * maxAge: 3600,
34
- * secure: true,
35
- * sameSite: 'strict'
36
- * });
37
- * ```
38
- */
39
- declare const getSessionCookieOptions: (options: Partial<CookieOptions>) => CookieOptions;
18
+ import { SessionCookieConfig } from '../models/config';
19
+ declare const getSessionCookieOptions: (options: Partial<SessionCookieConfig>) => Omit<SessionCookieConfig, "expiryTime">;
40
20
  export default getSessionCookieOptions;
41
21
  //# sourceMappingURL=getSessionCookieOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSessionCookieOptions.d.ts","sourceRoot":"","sources":["../../src/utils/getSessionCookieOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,uBAAuB,GAAI,SAAS,OAAO,CAAC,aAAa,CAAC,KAAG,aAMjE,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"getSessionCookieOptions.d.ts","sourceRoot":"","sources":["../../src/utils/getSessionCookieOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErD,QAAA,MAAM,uBAAuB,GAAI,SAAS,OAAO,CAAC,mBAAmB,CAAC,KAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAI7G,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunderid/node",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Node.js runtime SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
@@ -52,7 +52,7 @@
52
52
  "secure-random-bytes": "5.0.1",
53
53
  "tslib": "2.8.1",
54
54
  "uuid": "11.1.0",
55
- "@thunderid/javascript": "^0.0.4"
55
+ "@thunderid/javascript": "^0.0.5"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"
@@ -1,355 +0,0 @@
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 { AuthClientConfig, TokenExchangeRequestConfig, StorageManager, IdToken, OIDCEndpoints, Storage, TokenResponse, User, ExtendedAuthorizeRequestUrlParams } from '@thunderid/javascript';
19
- import { AuthURLCallback } from './models';
20
- /**
21
- * This class provides the necessary methods needed to implement authentication.
22
- *
23
- * @export
24
- * @class ThunderIDNodeClient
25
- */
26
- export declare class ThunderIDNodeClient<T> {
27
- private authCore;
28
- /**
29
- * This is the constructor method that returns an instance of the `ThunderIDNodeClient` class.
30
- *
31
- * @param {AuthClientConfig<T>} config - The configuration object.
32
- * @param {Storage} store - The store object.
33
- *
34
- * @example
35
- * ```
36
- * const _store: Storage = new DataStore();
37
- * const _config = {
38
- afterSignInUrl: "http://localhost:3000/sign-in",
39
- afterSignOutUrl: "http://localhost:3000/dashboard",
40
- clientId: "client ID",
41
- serverOrigin: "https://api.asgardeo.io/t/<org_name>"
42
- };
43
- * const auth = new ThunderIDNodeClient(_config,_store);
44
- * ```
45
- *
46
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#constructor
47
- * @preserve
48
- */
49
- constructor();
50
- initialize(config: AuthClientConfig<T>, store?: Storage): Promise<boolean>;
51
- /**
52
- * This method logs in a user. If the authorization code is not available it will resolve with the
53
- * authorization URL to authorize the user.
54
- * @param {string} authorizationCode - The authorization code obtained from ThunderID after a user signs in.
55
- * @param {String} sessionState - The session state obtained from ThunderID after a user signs in.
56
- * @param {string} userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
57
- * scenarios where each user should be uniquely identified.
58
- * @param {string} state - The state parameter in the redirect URL.
59
- *
60
- * @return {Promise<URLResponse | NodeTokenResponse>} - A Promise that resolves with the
61
- * [`URLResponse`](#URLResponse) object or a Promise that resolves with
62
- * the [`NodeTokenResponse`](#NodeTokenResponse) object.
63
- *
64
- * @example
65
- * ```
66
- * authClient.signIn(req.query.code, req.query.session_state).then(response => {
67
- * //URL property will available if the user has not been authenticated already
68
- * if (response.hasOwnProperty('url')) {
69
- * res.redirect(response.url)
70
- * } else {
71
- * //Set the cookie
72
- * res.cookie('ASGARDEO_SESSION_ID', response.session, { maxAge: 900000, httpOnly: true, SameSite: true });
73
- * res.status(200).send(response)
74
- * }
75
- *});
76
- * ```
77
- *
78
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signIn
79
- *
80
- * @memberof ThunderIDNodeClient
81
- *
82
- */
83
- signIn(authURLCallback: AuthURLCallback, userId: string, authorizationCode?: string, sessionState?: string, state?: string, signInConfig?: Record<string, string | boolean>): Promise<TokenResponse>;
84
- /**
85
- * Method to get the configuration data.
86
- *
87
- * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.
88
- */
89
- getConfigData(): Promise<AuthClientConfig<T>>;
90
- /**
91
- * This method clears all session data and returns the sign-out URL.
92
- * @param {string} userId - The userId of the user. (If you are using ExpressJS,
93
- * you may get this from the request cookies)
94
- *
95
- * @return {Promise<string>} - A Promise that resolves with the sign-out URL.
96
- *
97
- * @example
98
- * ```
99
- * const signOutUrl = await auth.signOut(userId);
100
- * ```
101
- *
102
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signOut
103
- *
104
- * @memberof ThunderIDNodeClient
105
- *
106
- */
107
- signOut(userId: string): Promise<string>;
108
- /**
109
- * This method returns a boolean value indicating if the user is authenticated or not.
110
- * @param {string} userId - The userId of the user.
111
- * (If you are using ExpressJS, you may get this from the request cookies)
112
- *
113
- * @return { Promise<boolean>} -A boolean value that indicates of the user is authenticated or not.
114
- *
115
- * @example
116
- * ```
117
- * const isAuth = await authClient.isSignedIn("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
118
- * ```
119
- *
120
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignedIn
121
- *
122
- * @memberof ThunderIDNodeClient
123
- *
124
- */
125
- isSignedIn(userId: string): Promise<boolean>;
126
- /**
127
- * This method returns the id token.
128
- * @param {string} userId - The userId of the user.
129
- * (If you are using ExpressJS, you may get this from the request cookies)
130
- *
131
- * @return {Promise<string>} -A Promise that resolves with the ID Token.
132
- *
133
- * @example
134
- * ```
135
- * const isAuth = await authClient.getIdToken("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
136
- * ```
137
- *
138
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getIdToken
139
- *
140
- * @memberof ThunderIDNodeClient
141
- *
142
- */
143
- getIdToken(userId: string): Promise<string>;
144
- /**
145
- * This method returns an object containing basic user information obtained from the id token.
146
- * @param {string} userId - The userId of the user.
147
- * (If you are using ExpressJS, you may get this from the request cookies)
148
- *
149
- * @return {Promise<string>} -A Promise that resolves with the
150
- * An object containing basic user information obtained from the id token.
151
- *
152
- * @example
153
- * ```
154
- * const basicInfo = await authClient.getUser("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
155
- * ```
156
- *
157
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getUser
158
- *
159
- * @memberof ThunderIDNodeClient
160
- *
161
- */
162
- getUser(userId: string): Promise<User>;
163
- /**
164
- * This method returns an object containing the OIDC service endpoints returned by the `.well-known` endpoint.
165
- * @return {Promise<OIDCEndpoints>} -A Promise that resolves with
166
- * an object containing the OIDC service endpoints returned by the `.well-known` endpoint.
167
- *
168
- * @example
169
- * ```
170
- * const oidcEndpoints = await auth.getOpenIDProviderEndpoints();
171
- * ```
172
- *
173
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getOpenIDProviderEndpoints
174
- *
175
- * @memberof ThunderIDNodeClient
176
- *
177
- */
178
- getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
179
- /**
180
- * This method returns the decoded ID token payload.
181
- * @param {string} userId - The userId of the user.
182
- * (If you are using ExpressJS, you may get this from the request cookies)
183
- *
184
- * @return {Promise<IdToken>} -A Promise that resolves with
185
- * an object containing the decoded ID token payload.
186
- *
187
- * @example
188
- * ```
189
- * const decodedIDTokenPayload = await auth.getDecodedIdToken("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
190
- * ```
191
- *
192
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDecodedIdToken
193
- *
194
- * @memberof ThunderIDNodeClient
195
- *
196
- */
197
- getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken>;
198
- /**
199
- * This method returns the access token.
200
- * @param {string} userId - The userId of the user.
201
- * (If you are using ExpressJS, you may get this from the request cookies)
202
- *
203
- * @return {Promise<string>} -A Promise that resolves with
204
- * the access token stored in the store
205
- *
206
- * @example
207
- * ```
208
- *const accessToken = await auth.getAccessToken("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
209
- * ```
210
- *
211
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAccessToken
212
- *
213
- * @memberof ThunderIDNodeClient
214
- *
215
- */
216
- getAccessToken(userId?: string): Promise<string>;
217
- /**
218
- * This method returns Promise that resolves with the token information
219
- * or the response returned by the server depending on the configuration passed.
220
- * @param {TokenExchangeRequestConfig} config - The config object contains attributes that would be used
221
- * to configure the custom grant request.
222
- *
223
- * @param {string} userId - The userId of the user.
224
- * (If you are using ExpressJS, you may get this from the request cookies)
225
- *
226
- * @return {Promise<TokenResponse | Response>} -A Promise that resolves with the token information
227
- * or the response returned by the server depending on the configuration passed.
228
- *
229
- * @example
230
- * ```
231
- * const config = {
232
- * attachToken: false,
233
- * data: {
234
- * client_id: "{{clientId}}",
235
- * grant_type: "account_switch",
236
- * scope: "{{scope}}",
237
- * token: "{{token}}",
238
- * },
239
- * id: "account-switch",
240
- * returnResponse: true,
241
- * returnsSession: true,
242
- * signInRequired: true
243
- * }
244
-
245
- * auth.exchangeToken(config).then((response)=>{
246
- * console.log(response);
247
- * }).catch((error)=>{
248
- * console.error(error);
249
- * });
250
- * ```
251
- *
252
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#exchangeToken
253
- *
254
- * @memberof ThunderIDNodeClient
255
- *
256
- */
257
- exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response>;
258
- /**
259
- * This method can be used to update the configurations passed into the constructor of the ThunderIDAuthClient.
260
- * @param {AuthClientConfig<T>} config - The config object containing the attributes
261
- * that can be used to configure the SDK
262
- *
263
- * @return {Promise<void>} -A Promise that resolves with a void.
264
- *
265
- * @example
266
- * ```
267
- * const reInitialize = await auth.reInitialize({
268
- * afterSignOutUrl: "http://localhost:3000/sign-out"
269
- * });
270
- * ```
271
- *
272
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#reInitialize
273
- *
274
- * @memberof ThunderIDNodeClient
275
- *
276
- */
277
- reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void>;
278
- getSignInUrl(requestConfig?: ExtendedAuthorizeRequestUrlParams, userId?: string): Promise<string>;
279
- /**
280
- * This method returns a Promise that resolves with the response returned by the server.
281
- * @param {string} userId - The userId of the user.
282
- * (If you are using ExpressJS, you may get this from the request cookies)
283
- *
284
- * @return {Promise<Response>} -A Promise that resolves with the response returned by the server.
285
- *
286
- * @example
287
- * ```
288
- * const revokeToken = await auth.revokeAccessToken("a2a2972c-51cd-5e9d-a9ae-058fae9f7927");
289
- * ```
290
- *
291
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#revokeAccessToken
292
- *
293
- * @memberof ThunderIDNodeClient
294
- *
295
- */
296
- revokeAccessToken(userId?: string): Promise<Response>;
297
- /**
298
- * This method refreshes the access token and returns a Promise that resolves with the new access
299
- * token and other relevant data.
300
- *
301
- * @param {string} userId - A unique ID of the user to be authenticated. This is useful in multi-user
302
- * scenarios where each user should be uniquely identified.
303
- *
304
- * @returns {Promise<TokenResponse>} - A Promise that resolves with the token response.
305
- *
306
- * @example
307
- * ```
308
- * const tokenResponse = await auth.refreshAccessToken("a2a2972c-51cd-5e9d-a9ae-058fae9f7927")
309
- * ```
310
- *
311
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#refreshAccessToken
312
- *
313
- * @memberof ThunderIDNodeClient
314
- */
315
- refreshAccessToken(userId?: string): Promise<TokenResponse>;
316
- /**
317
- * This method returns if the user has been successfully signed out or not.
318
- * @param {string} afterSignOutUrl - The URL to which the user is redirected to
319
- * after signing out from the server.
320
- *
321
- * @return {boolean} - A boolean value indicating if the user has been signed out or not.
322
- *
323
- * @example
324
- * ```
325
- * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);;
326
- * ```
327
- *
328
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignOutSuccessful
329
- *
330
- * @memberof ThunderIDNodeClient
331
- *
332
- */
333
- static isSignOutSuccessful(afterSignOutUrl: string): boolean;
334
- /**
335
- * This method returns if sign-out failed or not
336
- * @param {string} afterSignOutUrl - The URL to which the user is redirected to
337
- * after signing out from the server.
338
- *
339
- * @return {boolean} - A boolean value indicating if sign-out failed or not.
340
- *
341
- * @example
342
- * ```
343
- * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);
344
- * ```
345
- *
346
- * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#didSignOutFail
347
- *
348
- * @memberof ThunderIDNodeClient
349
- *
350
- */
351
- static didSignOutFail(afterSignOutUrl: string): boolean;
352
- getStorageManager(): Promise<StorageManager<T>>;
353
- decodeJwtToken<K = Record<string, unknown>>(token: string): Promise<K>;
354
- }
355
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/__legacy__/client.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AC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAGpF"}
@@ -1,20 +0,0 @@
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
- export * from './uuid-config';
19
- export * from './logger-config';
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/constants/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger-config.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/constants/logger-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,YAW3B,CAAC"}
@@ -1,19 +0,0 @@
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
- export declare const UUID_VERSION = 4;
19
- //# sourceMappingURL=uuid-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uuid-config.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/constants/uuid-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,YAAY,IAAI,CAAC"}