@fusionauth/typescript-client 1.58.1 → 1.59.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/build/src/FusionAuthClient.d.ts +271 -14
- package/build/src/FusionAuthClient.js +132 -13
- package/build/src/FusionAuthClient.js.map +1 -1
- package/dist/fusionauth-typescript-client.js +133 -14
- package/dist/fusionauth-typescript-client.min.js +1 -1
- package/dist/fusionauth-typescript-client.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* language governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.WebhookEventResult = exports.WebhookAttemptResult = exports.WebAuthnWorkflow = exports.VerificationStrategy = exports.UserVerificationRequirement = exports.UserState = exports.UserActionPhase = exports.UnverifiedBehavior = exports.UnknownScopePolicy = exports.TransactionType = exports.TokenType = exports.ThemeType = exports.UniqueUsernameStrategy = exports.SystemTrustedProxyConfigurationPolicy = exports.SteamAPIMode = exports.Sort = exports.SecureGeneratorType = exports.SAMLv2DestinationAssertionPolicy = exports.ResidentKeyRequirement = exports.RefreshTokenUsagePolicy = exports.RefreshTokenExpirationPolicy = exports.ReactorFeatureStatus = exports.
|
|
18
|
+
exports.WebhookEventResult = exports.WebhookAttemptResult = exports.WebAuthnWorkflow = exports.VerificationStrategy = exports.UserVerificationRequirement = exports.UserState = exports.UserActionPhase = exports.UnverifiedBehavior = exports.UnknownScopePolicy = exports.TransactionType = exports.TokenType = exports.ThemeType = exports.UniqueUsernameStrategy = exports.SystemTrustedProxyConfigurationPolicy = exports.SteamAPIMode = exports.Sort = exports.SendSetPasswordIdentityType = exports.SecureGeneratorType = exports.SAMLv2DestinationAssertionPolicy = exports.ResidentKeyRequirement = exports.RefreshTokenUsagePolicy = exports.RefreshTokenExpirationPolicy = exports.ReactorFeatureStatus = exports.PublicKeyCredentialType = exports.ProofKeyForCodeExchangePolicy = exports.PasswordlessStrategy = exports.BreachMatchMode = exports.BreachAction = exports.ObjectState = exports.Oauth2AuthorizedURLValidationPolicy = exports.OAuthScopeHandlingPolicy = exports.OAuthScopeConsentMode = exports.OAuthErrorType = exports.OAuthErrorReason = exports.OAuthApplicationRelationship = exports.MultiFactorLoginPolicy = exports.MessengerType = exports.MessageType = exports.LogoutBehavior = exports.LambdaType = exports.LambdaEngineType = exports.LDAPSecurityMethod = exports.KeyUse = exports.KeyType = exports.KeyAlgorithm = exports.IdentityVerifiedReason = exports.IdentityProviderType = exports.ClientAuthenticationMethod = exports.IdentityProviderLoginMethod = exports.IdentityProviderLinkingStrategy = exports.IPAccessControlEntryAction = exports.HTTPMethod = exports.GrantType = exports.FormType = exports.FormFieldAdminPolicy = exports.FormDataType = exports.FormControl = exports.FamilyRole = exports.ExpiryUnit = exports.EventType = exports.EventLogType = exports.EmailSecurityType = exports.DeviceType = exports.CoseKeyType = exports.CoseEllipticCurve = exports.CoseAlgorithmIdentifier = exports.ContentStatus = exports.ConsentStatus = exports.ConnectorType = exports.ClientAuthenticationPolicy = exports.ChangePasswordReason = exports.CaptchaMethod = exports.CanonicalizationMethod = exports.BreachedPasswordStatus = exports.TOTPAlgorithm = exports.AuthenticatorAttachmentPreference = exports.AuthenticatorAttachment = exports.AuthenticationThreats = exports.AttestationType = exports.AttestationConveyancePreference = exports.ApplicationMultiFactorTrustPolicy = exports.XMLSignatureLocation = exports.SAMLLogoutBehavior = exports.RegistrationType = exports.LoginIdType = exports.Algorithm = exports.FusionAuthClient = void 0;
|
|
19
19
|
const DefaultRESTClientBuilder_1 = require("./DefaultRESTClientBuilder");
|
|
20
20
|
const url_1 = require("url");
|
|
21
21
|
class FusionAuthClient {
|
|
@@ -282,6 +282,19 @@ class FusionAuthClient {
|
|
|
282
282
|
.withMethod("POST")
|
|
283
283
|
.go();
|
|
284
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* Completes verification of an identity using verification codes from the Verify Start API.
|
|
287
|
+
*
|
|
288
|
+
* @param {VerifyCompleteRequest} request The identity verify complete request that contains all the information used to verify the identity.
|
|
289
|
+
* @returns {Promise<ClientResponse<VerifyCompleteResponse>>}
|
|
290
|
+
*/
|
|
291
|
+
completeVerifyIdentity(request) {
|
|
292
|
+
return this.start()
|
|
293
|
+
.withUri('/api/identity/verify/complete')
|
|
294
|
+
.withJSONBody(request)
|
|
295
|
+
.withMethod("POST")
|
|
296
|
+
.go();
|
|
297
|
+
}
|
|
285
298
|
/**
|
|
286
299
|
* Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
|
|
287
300
|
*
|
|
@@ -3653,6 +3666,21 @@ class FusionAuthClient {
|
|
|
3653
3666
|
.withMethod("GET")
|
|
3654
3667
|
.go();
|
|
3655
3668
|
}
|
|
3669
|
+
/**
|
|
3670
|
+
* Retrieves the user for the loginId, using specific loginIdTypes.
|
|
3671
|
+
*
|
|
3672
|
+
* @param {string} loginId The email or username of the user.
|
|
3673
|
+
* @param {Array<String>} loginIdTypes the identity types that FusionAuth will compare the loginId to.
|
|
3674
|
+
* @returns {Promise<ClientResponse<UserResponse>>}
|
|
3675
|
+
*/
|
|
3676
|
+
retrieveUserByLoginIdWithLoginIdTypes(loginId, loginIdTypes) {
|
|
3677
|
+
return this.start()
|
|
3678
|
+
.withUri('/api/user')
|
|
3679
|
+
.withParameter('loginId', loginId)
|
|
3680
|
+
.withParameter('loginIdTypes', loginIdTypes)
|
|
3681
|
+
.withMethod("GET")
|
|
3682
|
+
.go();
|
|
3683
|
+
}
|
|
3656
3684
|
/**
|
|
3657
3685
|
* Retrieves the user for the given username.
|
|
3658
3686
|
*
|
|
@@ -3844,6 +3872,28 @@ class FusionAuthClient {
|
|
|
3844
3872
|
.withMethod("GET")
|
|
3845
3873
|
.go();
|
|
3846
3874
|
}
|
|
3875
|
+
/**
|
|
3876
|
+
* Retrieves the login report between the two instants for a particular user by login Id, using specific loginIdTypes. If you specify an application id, it will only return the
|
|
3877
|
+
* login counts for that application.
|
|
3878
|
+
*
|
|
3879
|
+
* @param {UUID} applicationId (Optional) The application id.
|
|
3880
|
+
* @param {string} loginId The userId id.
|
|
3881
|
+
* @param {number} start The start instant as UTC milliseconds since Epoch.
|
|
3882
|
+
* @param {number} end The end instant as UTC milliseconds since Epoch.
|
|
3883
|
+
* @param {Array<String>} loginIdTypes the identity types that FusionAuth will compare the loginId to.
|
|
3884
|
+
* @returns {Promise<ClientResponse<LoginReportResponse>>}
|
|
3885
|
+
*/
|
|
3886
|
+
retrieveUserLoginReportByLoginIdAndLoginIdTypes(applicationId, loginId, start, end, loginIdTypes) {
|
|
3887
|
+
return this.start()
|
|
3888
|
+
.withUri('/api/report/login')
|
|
3889
|
+
.withParameter('applicationId', applicationId)
|
|
3890
|
+
.withParameter('loginId', loginId)
|
|
3891
|
+
.withParameter('start', start)
|
|
3892
|
+
.withParameter('end', end)
|
|
3893
|
+
.withParameter('loginIdTypes', loginIdTypes)
|
|
3894
|
+
.withMethod("GET")
|
|
3895
|
+
.go();
|
|
3896
|
+
}
|
|
3847
3897
|
/**
|
|
3848
3898
|
* Retrieves the last number of login records for a user.
|
|
3849
3899
|
*
|
|
@@ -4527,6 +4577,19 @@ class FusionAuthClient {
|
|
|
4527
4577
|
.withMethod("POST")
|
|
4528
4578
|
.go();
|
|
4529
4579
|
}
|
|
4580
|
+
/**
|
|
4581
|
+
* Send a verification code using the appropriate transport for the identity type being verified.
|
|
4582
|
+
*
|
|
4583
|
+
* @param {VerifySendRequest} request The identity verify send request that contains all the information used send the code.
|
|
4584
|
+
* @returns {Promise<ClientResponse<void>>}
|
|
4585
|
+
*/
|
|
4586
|
+
sendVerifyIdentity(request) {
|
|
4587
|
+
return this.start()
|
|
4588
|
+
.withUri('/api/identity/verify/send')
|
|
4589
|
+
.withJSONBody(request)
|
|
4590
|
+
.withMethod("POST")
|
|
4591
|
+
.go();
|
|
4592
|
+
}
|
|
4530
4593
|
/**
|
|
4531
4594
|
* Begins a login request for a 3rd party login that requires user interaction such as HYPR.
|
|
4532
4595
|
*
|
|
@@ -4573,6 +4636,20 @@ class FusionAuthClient {
|
|
|
4573
4636
|
.withMethod("POST")
|
|
4574
4637
|
.go();
|
|
4575
4638
|
}
|
|
4639
|
+
/**
|
|
4640
|
+
* Start a verification of an identity by generating a code. This code can be sent to the User using the Verify Send API
|
|
4641
|
+
* Verification Code API or using a mechanism outside of FusionAuth. The verification is completed by using the Verify Complete API with this code.
|
|
4642
|
+
*
|
|
4643
|
+
* @param {VerifyStartRequest} request The identity verify start request that contains all the information used to begin the request.
|
|
4644
|
+
* @returns {Promise<ClientResponse<VerifyStartResponse>>}
|
|
4645
|
+
*/
|
|
4646
|
+
startVerifyIdentity(request) {
|
|
4647
|
+
return this.start()
|
|
4648
|
+
.withUri('/api/identity/verify/start')
|
|
4649
|
+
.withJSONBody(request)
|
|
4650
|
+
.withMethod("POST")
|
|
4651
|
+
.go();
|
|
4652
|
+
}
|
|
4576
4653
|
/**
|
|
4577
4654
|
* Start a WebAuthn authentication ceremony by generating a new challenge for the user
|
|
4578
4655
|
*
|
|
@@ -5198,6 +5275,19 @@ class FusionAuthClient {
|
|
|
5198
5275
|
.withMethod("POST")
|
|
5199
5276
|
.go();
|
|
5200
5277
|
}
|
|
5278
|
+
/**
|
|
5279
|
+
* Administratively verify a user identity.
|
|
5280
|
+
*
|
|
5281
|
+
* @param {VerifyRequest} request The identity verify request that contains information to verify the identity.
|
|
5282
|
+
* @returns {Promise<ClientResponse<void>>}
|
|
5283
|
+
*/
|
|
5284
|
+
verifyIdentity(request) {
|
|
5285
|
+
return this.start()
|
|
5286
|
+
.withUri('/api/identity/verify')
|
|
5287
|
+
.withJSONBody(request)
|
|
5288
|
+
.withMethod("POST")
|
|
5289
|
+
.go();
|
|
5290
|
+
}
|
|
5201
5291
|
/**
|
|
5202
5292
|
* Confirms an application registration. The Id given is usually from an email sent to the user.
|
|
5203
5293
|
*
|
|
@@ -5279,9 +5369,11 @@ var Algorithm;
|
|
|
5279
5369
|
Algorithm["RS512"] = "RS512";
|
|
5280
5370
|
Algorithm["none"] = "none";
|
|
5281
5371
|
})(Algorithm = exports.Algorithm || (exports.Algorithm = {}));
|
|
5372
|
+
// This is separate from IdentityType.
|
|
5282
5373
|
var LoginIdType;
|
|
5283
5374
|
(function (LoginIdType) {
|
|
5284
5375
|
LoginIdType["email"] = "email";
|
|
5376
|
+
LoginIdType["phoneNumber"] = "phoneNumber";
|
|
5285
5377
|
LoginIdType["username"] = "username";
|
|
5286
5378
|
})(LoginIdType = exports.LoginIdType || (exports.LoginIdType = {}));
|
|
5287
5379
|
var RegistrationType;
|
|
@@ -5588,6 +5680,8 @@ var EventType;
|
|
|
5588
5680
|
EventType["UserUpdate"] = "user.update";
|
|
5589
5681
|
EventType["UserUpdateComplete"] = "user.update.complete";
|
|
5590
5682
|
EventType["Test"] = "test";
|
|
5683
|
+
EventType["UserIdentityVerified"] = "user.identity.verified";
|
|
5684
|
+
EventType["UserIdentityUpdate"] = "user.identity.update";
|
|
5591
5685
|
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
5592
5686
|
/**
|
|
5593
5687
|
* @author Brian Pontarelli
|
|
@@ -5630,6 +5724,7 @@ var FormDataType;
|
|
|
5630
5724
|
FormDataType["date"] = "date";
|
|
5631
5725
|
FormDataType["email"] = "email";
|
|
5632
5726
|
FormDataType["number"] = "number";
|
|
5727
|
+
FormDataType["phoneNumber"] = "phoneNumber";
|
|
5633
5728
|
FormDataType["string"] = "string";
|
|
5634
5729
|
})(FormDataType = exports.FormDataType || (exports.FormDataType = {}));
|
|
5635
5730
|
/**
|
|
@@ -5743,6 +5838,23 @@ var IdentityProviderType;
|
|
|
5743
5838
|
IdentityProviderType["Twitter"] = "Twitter";
|
|
5744
5839
|
IdentityProviderType["Xbox"] = "Xbox";
|
|
5745
5840
|
})(IdentityProviderType = exports.IdentityProviderType || (exports.IdentityProviderType = {}));
|
|
5841
|
+
/**
|
|
5842
|
+
* Models the reason that {@link UserIdentity#verified} was set to true or false.
|
|
5843
|
+
*
|
|
5844
|
+
* @author Brady Wied
|
|
5845
|
+
*/
|
|
5846
|
+
var IdentityVerifiedReason;
|
|
5847
|
+
(function (IdentityVerifiedReason) {
|
|
5848
|
+
IdentityVerifiedReason["Skipped"] = "Skipped";
|
|
5849
|
+
IdentityVerifiedReason["Trusted"] = "Trusted";
|
|
5850
|
+
IdentityVerifiedReason["Unverifiable"] = "Unverifiable";
|
|
5851
|
+
IdentityVerifiedReason["Implicit"] = "Implicit";
|
|
5852
|
+
IdentityVerifiedReason["Pending"] = "Pending";
|
|
5853
|
+
IdentityVerifiedReason["Completed"] = "Completed";
|
|
5854
|
+
IdentityVerifiedReason["Disabled"] = "Disabled";
|
|
5855
|
+
IdentityVerifiedReason["Administrative"] = "Administrative";
|
|
5856
|
+
IdentityVerifiedReason["Import"] = "Import";
|
|
5857
|
+
})(IdentityVerifiedReason = exports.IdentityVerifiedReason || (exports.IdentityVerifiedReason = {}));
|
|
5746
5858
|
var KeyAlgorithm;
|
|
5747
5859
|
(function (KeyAlgorithm) {
|
|
5748
5860
|
KeyAlgorithm["ES256"] = "ES256";
|
|
@@ -5876,6 +5988,7 @@ var OAuthErrorReason;
|
|
|
5876
5988
|
OAuthErrorReason["refresh_token_not_found"] = "refresh_token_not_found";
|
|
5877
5989
|
OAuthErrorReason["refresh_token_type_not_supported"] = "refresh_token_type_not_supported";
|
|
5878
5990
|
OAuthErrorReason["invalid_client_id"] = "invalid_client_id";
|
|
5991
|
+
OAuthErrorReason["invalid_expires_in"] = "invalid_expires_in";
|
|
5879
5992
|
OAuthErrorReason["invalid_user_credentials"] = "invalid_user_credentials";
|
|
5880
5993
|
OAuthErrorReason["invalid_grant_type"] = "invalid_grant_type";
|
|
5881
5994
|
OAuthErrorReason["invalid_origin"] = "invalid_origin";
|
|
@@ -6002,6 +6115,14 @@ var BreachMatchMode;
|
|
|
6002
6115
|
BreachMatchMode["Medium"] = "Medium";
|
|
6003
6116
|
BreachMatchMode["High"] = "High";
|
|
6004
6117
|
})(BreachMatchMode = exports.BreachMatchMode || (exports.BreachMatchMode = {}));
|
|
6118
|
+
/**
|
|
6119
|
+
* @author Daniel DeGroff
|
|
6120
|
+
*/
|
|
6121
|
+
var PasswordlessStrategy;
|
|
6122
|
+
(function (PasswordlessStrategy) {
|
|
6123
|
+
PasswordlessStrategy["ClickableLink"] = "ClickableLink";
|
|
6124
|
+
PasswordlessStrategy["FormField"] = "FormField";
|
|
6125
|
+
})(PasswordlessStrategy = exports.PasswordlessStrategy || (exports.PasswordlessStrategy = {}));
|
|
6005
6126
|
/**
|
|
6006
6127
|
* @author Brett Guy
|
|
6007
6128
|
*/
|
|
@@ -6020,18 +6141,6 @@ var PublicKeyCredentialType;
|
|
|
6020
6141
|
(function (PublicKeyCredentialType) {
|
|
6021
6142
|
PublicKeyCredentialType["publicKey"] = "public-key";
|
|
6022
6143
|
})(PublicKeyCredentialType = exports.PublicKeyCredentialType || (exports.PublicKeyCredentialType = {}));
|
|
6023
|
-
/**
|
|
6024
|
-
* @author Daniel DeGroff
|
|
6025
|
-
*/
|
|
6026
|
-
var RateLimitedRequestType;
|
|
6027
|
-
(function (RateLimitedRequestType) {
|
|
6028
|
-
RateLimitedRequestType["FailedLogin"] = "FailedLogin";
|
|
6029
|
-
RateLimitedRequestType["ForgotPassword"] = "ForgotPassword";
|
|
6030
|
-
RateLimitedRequestType["SendEmailVerification"] = "SendEmailVerification";
|
|
6031
|
-
RateLimitedRequestType["SendPasswordless"] = "SendPasswordless";
|
|
6032
|
-
RateLimitedRequestType["SendRegistrationVerification"] = "SendRegistrationVerification";
|
|
6033
|
-
RateLimitedRequestType["SendTwoFactor"] = "SendTwoFactor";
|
|
6034
|
-
})(RateLimitedRequestType = exports.RateLimitedRequestType || (exports.RateLimitedRequestType = {}));
|
|
6035
6144
|
/**
|
|
6036
6145
|
* @author Brian Pontarelli
|
|
6037
6146
|
*/
|
|
@@ -6091,6 +6200,16 @@ var SecureGeneratorType;
|
|
|
6091
6200
|
SecureGeneratorType["randomAlpha"] = "randomAlpha";
|
|
6092
6201
|
SecureGeneratorType["randomAlphaNumeric"] = "randomAlphaNumeric";
|
|
6093
6202
|
})(SecureGeneratorType = exports.SecureGeneratorType || (exports.SecureGeneratorType = {}));
|
|
6203
|
+
/**
|
|
6204
|
+
* Used to indicate which identity type a password "request" might go to. It could be
|
|
6205
|
+
* used for send set passwords or send password resets.
|
|
6206
|
+
*/
|
|
6207
|
+
var SendSetPasswordIdentityType;
|
|
6208
|
+
(function (SendSetPasswordIdentityType) {
|
|
6209
|
+
SendSetPasswordIdentityType["email"] = "email";
|
|
6210
|
+
SendSetPasswordIdentityType["phone"] = "phone";
|
|
6211
|
+
SendSetPasswordIdentityType["doNotSend"] = "doNotSend";
|
|
6212
|
+
})(SendSetPasswordIdentityType = exports.SendSetPasswordIdentityType || (exports.SendSetPasswordIdentityType = {}));
|
|
6094
6213
|
/**
|
|
6095
6214
|
* @author Daniel DeGroff
|
|
6096
6215
|
*/
|