@fusionauth/typescript-client 1.62.0 → 1.64.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.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ## FusionAuth TypeScript Client
2
2
  ![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square) [![npm](https://img.shields.io/npm/v/@fusionauth/typescript-client?style=flat-square)](https://www.npmjs.com/package/@fusionauth/typescript-client)
3
3
 
4
+
4
5
  If you're integrating FusionAuth with a Typescript application, this library will speed up your development time. It also works with node and browser applications as well.
5
6
 
6
7
  For additional information and documentation on FusionAuth refer to [https://fusionauth.io](https://fusionauth.io).
@@ -829,6 +829,13 @@ export declare class FusionAuthClient {
829
829
  * @returns {Promise<ClientResponse<void>>}
830
830
  */
831
831
  deleteWebAuthnCredential(id: UUID): Promise<ClientResponse<void>>;
832
+ /**
833
+ * Deletes all of the WebAuthn credentials for the given User Id.
834
+ *
835
+ * @param {UUID} userId The unique Id of the User to delete WebAuthn passkeys for.
836
+ * @returns {Promise<ClientResponse<void>>}
837
+ */
838
+ deleteWebAuthnCredentialsForUser(userId: UUID): Promise<ClientResponse<void>>;
832
839
  /**
833
840
  * Deletes the webhook for the given Id.
834
841
  *
@@ -1173,13 +1180,23 @@ export declare class FusionAuthClient {
1173
1180
  */
1174
1181
  logoutWithRequest(request: LogoutRequest): Promise<ClientResponse<void>>;
1175
1182
  /**
1176
- * Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
1183
+ * Retrieves any global identity providers for the given domain. A 200 response code indicates the domain is managed
1177
1184
  * by a registered identity provider. A 404 indicates the domain is not managed.
1178
1185
  *
1179
1186
  * @param {string} domain The domain or email address to lookup.
1180
1187
  * @returns {Promise<ClientResponse<LookupResponse>>}
1181
1188
  */
1182
1189
  lookupIdentityProvider(domain: string): Promise<ClientResponse<LookupResponse>>;
1190
+ /**
1191
+ * Retrieves the identity provider for the given domain and tenantId. A 200 response code indicates the domain is managed
1192
+ * by a registered identity provider. A 404 indicates the domain is not managed.
1193
+ *
1194
+ * @param {string} domain The domain or email address to lookup.
1195
+ * @param {UUID} tenantId If provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain.
1196
+ * If no result is found, the API then searches for global identity providers.
1197
+ * @returns {Promise<ClientResponse<LookupResponse>>}
1198
+ */
1199
+ lookupIdentityProviderByTenantId(domain: string, tenantId: UUID): Promise<ClientResponse<LookupResponse>>;
1183
1200
  /**
1184
1201
  * Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
1185
1202
  * action.
@@ -2316,13 +2333,6 @@ export declare class FusionAuthClient {
2316
2333
  * @returns {Promise<ClientResponse<RecentLoginResponse>>}
2317
2334
  */
2318
2335
  retrieveUserRecentLogins(userId: UUID, offset: number, limit: number): Promise<ClientResponse<RecentLoginResponse>>;
2319
- /**
2320
- * Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.
2321
- *
2322
- * @param {string} encodedJWT The encoded JWT (access token).
2323
- * @returns {Promise<ClientResponse<UserResponse>>}
2324
- */
2325
- retrieveUserUsingJWT(encodedJWT: string): Promise<ClientResponse<UserResponse>>;
2326
2336
  /**
2327
2337
  * Retrieves the FusionAuth version string.
2328
2338
  *
@@ -3331,6 +3341,8 @@ export interface LoginConfiguration {
3331
3341
  requireAuthentication?: boolean;
3332
3342
  }
3333
3343
  export interface PasswordlessConfiguration extends Enableable {
3344
+ emailLoginStrategy?: PasswordlessStrategy;
3345
+ phoneLoginStrategy?: PasswordlessStrategy;
3334
3346
  }
3335
3347
  export interface RegistrationConfiguration extends Enableable {
3336
3348
  birthDate?: Requirable;
@@ -4123,6 +4135,7 @@ export interface Context {
4123
4135
  action?: MultiFactorAction;
4124
4136
  application?: Application;
4125
4137
  authenticationThreats?: Array<AuthenticationThreats>;
4138
+ authenticationType?: string;
4126
4139
  eventInfo?: EventInfo;
4127
4140
  mfaTrust?: Trust;
4128
4141
  policies?: Policies;
@@ -6014,13 +6027,15 @@ export declare enum KeyAlgorithm {
6014
6027
  RS256 = "RS256",
6015
6028
  RS384 = "RS384",
6016
6029
  RS512 = "RS512",
6017
- Ed25519 = "Ed25519"
6030
+ Ed25519 = "Ed25519",
6031
+ None = "None"
6018
6032
  }
6019
6033
  export declare enum KeyType {
6020
6034
  EC = "EC",
6021
6035
  RSA = "RSA",
6022
6036
  HMAC = "HMAC",
6023
- OKP = "OKP"
6037
+ OKP = "OKP",
6038
+ Secret = "Secret"
6024
6039
  }
6025
6040
  /**
6026
6041
  * Key API request object.
@@ -6758,7 +6773,8 @@ export declare enum OAuthErrorType {
6758
6773
  two_factor_required = "two_factor_required",
6759
6774
  authorization_pending = "authorization_pending",
6760
6775
  expired_token = "expired_token",
6761
- unsupported_token_type = "unsupported_token_type"
6776
+ unsupported_token_type = "unsupported_token_type",
6777
+ invalid_dpop_proof = "invalid_dpop_proof"
6762
6778
  }
6763
6779
  /**
6764
6780
  * @author Daniel DeGroff
@@ -6818,7 +6834,9 @@ export interface OpenIdConfiguration {
6818
6834
  authorization_endpoint?: string;
6819
6835
  backchannel_logout_supported?: boolean;
6820
6836
  claims_supported?: Array<string>;
6837
+ code_challenge_methods_supported?: Array<string>;
6821
6838
  device_authorization_endpoint?: string;
6839
+ dpop_signing_alg_values_supported?: Array<string>;
6822
6840
  end_session_endpoint?: string;
6823
6841
  frontchannel_logout_supported?: boolean;
6824
6842
  grant_types_supported?: Array<string>;
@@ -6886,6 +6904,7 @@ export interface PasswordEncryptionConfiguration {
6886
6904
  */
6887
6905
  export interface PasswordValidationRules {
6888
6906
  breachDetection?: PasswordBreachDetection;
6907
+ disallowUserLoginId?: boolean;
6889
6908
  maxLength?: number;
6890
6909
  minLength?: number;
6891
6910
  rememberPreviousPasswords?: RememberPreviousPasswords;
@@ -7188,8 +7207,10 @@ export interface ReactorStatus {
7188
7207
  applicationThemes?: ReactorFeatureStatus;
7189
7208
  breachedPasswordDetection?: ReactorFeatureStatus;
7190
7209
  connectors?: ReactorFeatureStatus;
7210
+ dPoP?: ReactorFeatureStatus;
7191
7211
  entityManagement?: ReactorFeatureStatus;
7192
7212
  expiration?: string;
7213
+ ipGeoLocation?: ReactorFeatureStatus;
7193
7214
  licenseAttributes?: Record<string, string>;
7194
7215
  licensed?: boolean;
7195
7216
  multiFactorLambdas?: ReactorFeatureStatus;
@@ -8262,13 +8283,15 @@ export interface TimeBasedDeletePolicy extends Enableable {
8262
8283
  * <a href="https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05">
8263
8284
  * Draft RFC on OAuth 2.0 Message Authentication Code (MAC) Tokens</a>
8264
8285
  * </li>
8286
+ * <li>DPoP Token type as defined by <a href="https://datatracker.ietf.org/doc/html/rfc9449">RFC 9449</a></li>
8265
8287
  * </ul>
8266
8288
  *
8267
8289
  * @author Daniel DeGroff
8268
8290
  */
8269
8291
  export declare enum TokenType {
8270
8292
  Bearer = "Bearer",
8271
- MAC = "MAC"
8293
+ MAC = "MAC",
8294
+ DPoP = "DPoP"
8272
8295
  }
8273
8296
  /**
8274
8297
  * The response from the total report. This report stores the total numbers for each application.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019-2025, FusionAuth, All Rights Reserved
3
+ * Copyright (c) 2019-2026, FusionAuth, All Rights Reserved
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1530,6 +1530,19 @@ class FusionAuthClient {
1530
1530
  .withMethod("DELETE")
1531
1531
  .go();
1532
1532
  }
1533
+ /**
1534
+ * Deletes all of the WebAuthn credentials for the given User Id.
1535
+ *
1536
+ * @param {UUID} userId The unique Id of the User to delete WebAuthn passkeys for.
1537
+ * @returns {Promise<ClientResponse<void>>}
1538
+ */
1539
+ deleteWebAuthnCredentialsForUser(userId) {
1540
+ return this.start()
1541
+ .withUri('/api/webauthn')
1542
+ .withParameter('userId', userId)
1543
+ .withMethod("DELETE")
1544
+ .go();
1545
+ }
1533
1546
  /**
1534
1547
  * Deletes the webhook for the given Id.
1535
1548
  *
@@ -2266,7 +2279,7 @@ class FusionAuthClient {
2266
2279
  .go();
2267
2280
  }
2268
2281
  /**
2269
- * Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
2282
+ * Retrieves any global identity providers for the given domain. A 200 response code indicates the domain is managed
2270
2283
  * by a registered identity provider. A 404 indicates the domain is not managed.
2271
2284
  *
2272
2285
  * @param {string} domain The domain or email address to lookup.
@@ -2279,6 +2292,23 @@ class FusionAuthClient {
2279
2292
  .withMethod("GET")
2280
2293
  .go();
2281
2294
  }
2295
+ /**
2296
+ * Retrieves the identity provider for the given domain and tenantId. A 200 response code indicates the domain is managed
2297
+ * by a registered identity provider. A 404 indicates the domain is not managed.
2298
+ *
2299
+ * @param {string} domain The domain or email address to lookup.
2300
+ * @param {UUID} tenantId If provided, the API searches for an identity provider scoped to the corresponding tenant that manages the requested domain.
2301
+ * If no result is found, the API then searches for global identity providers.
2302
+ * @returns {Promise<ClientResponse<LookupResponse>>}
2303
+ */
2304
+ lookupIdentityProviderByTenantId(domain, tenantId) {
2305
+ return this.start()
2306
+ .withUri('/api/identity-provider/lookup')
2307
+ .withParameter('domain', domain)
2308
+ .withParameter('tenantId', tenantId)
2309
+ .withMethod("GET")
2310
+ .go();
2311
+ }
2282
2312
  /**
2283
2313
  * Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
2284
2314
  * action.
@@ -4380,19 +4410,6 @@ class FusionAuthClient {
4380
4410
  .withMethod("GET")
4381
4411
  .go();
4382
4412
  }
4383
- /**
4384
- * Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.
4385
- *
4386
- * @param {string} encodedJWT The encoded JWT (access token).
4387
- * @returns {Promise<ClientResponse<UserResponse>>}
4388
- */
4389
- retrieveUserUsingJWT(encodedJWT) {
4390
- return this.startAnonymous()
4391
- .withUri('/api/user')
4392
- .withAuthorization('Bearer ' + encodedJWT)
4393
- .withMethod("GET")
4394
- .go();
4395
- }
4396
4413
  /**
4397
4414
  * Retrieves the FusionAuth version string.
4398
4415
  *
@@ -6369,6 +6386,7 @@ var KeyAlgorithm;
6369
6386
  KeyAlgorithm["RS384"] = "RS384";
6370
6387
  KeyAlgorithm["RS512"] = "RS512";
6371
6388
  KeyAlgorithm["Ed25519"] = "Ed25519";
6389
+ KeyAlgorithm["None"] = "None";
6372
6390
  })(KeyAlgorithm = exports.KeyAlgorithm || (exports.KeyAlgorithm = {}));
6373
6391
  var KeyType;
6374
6392
  (function (KeyType) {
@@ -6376,6 +6394,7 @@ var KeyType;
6376
6394
  KeyType["RSA"] = "RSA";
6377
6395
  KeyType["HMAC"] = "HMAC";
6378
6396
  KeyType["OKP"] = "OKP";
6397
+ KeyType["Secret"] = "Secret";
6379
6398
  })(KeyType = exports.KeyType || (exports.KeyType = {}));
6380
6399
  /**
6381
6400
  * The use type of a key.
@@ -6590,6 +6609,7 @@ var OAuthErrorType;
6590
6609
  OAuthErrorType["authorization_pending"] = "authorization_pending";
6591
6610
  OAuthErrorType["expired_token"] = "expired_token";
6592
6611
  OAuthErrorType["unsupported_token_type"] = "unsupported_token_type";
6612
+ OAuthErrorType["invalid_dpop_proof"] = "invalid_dpop_proof";
6593
6613
  })(OAuthErrorType = exports.OAuthErrorType || (exports.OAuthErrorType = {}));
6594
6614
  /**
6595
6615
  * Controls the policy for requesting user permission to grant access to requested scopes during an OAuth workflow
@@ -6782,6 +6802,7 @@ var ThemeType;
6782
6802
  * <a href="https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05">
6783
6803
  * Draft RFC on OAuth 2.0 Message Authentication Code (MAC) Tokens</a>
6784
6804
  * </li>
6805
+ * <li>DPoP Token type as defined by <a href="https://datatracker.ietf.org/doc/html/rfc9449">RFC 9449</a></li>
6785
6806
  * </ul>
6786
6807
  *
6787
6808
  * @author Daniel DeGroff
@@ -6790,6 +6811,7 @@ var TokenType;
6790
6811
  (function (TokenType) {
6791
6812
  TokenType["Bearer"] = "Bearer";
6792
6813
  TokenType["MAC"] = "MAC";
6814
+ TokenType["DPoP"] = "DPoP";
6793
6815
  })(TokenType = exports.TokenType || (exports.TokenType = {}));
6794
6816
  /**
6795
6817
  * The transaction types for Webhooks and other event systems within FusionAuth.