@fusionauth/typescript-client 1.29.0 → 1.31.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.
@@ -382,6 +382,21 @@ class FusionAuthClient {
382
382
  .withMethod("POST")
383
383
  .go();
384
384
  }
385
+ /**
386
+ * Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
387
+ *
388
+ * @param {UUID} accessControlListId (Optional) The Id for the IP Access Control List. If not provided a secure random UUID will be generated.
389
+ * @param {IPAccessControlListRequest} request The request object that contains all of the information used to create the IP Access Control List.
390
+ * @returns {Promise<ClientResponse<IPAccessControlListResponse>>}
391
+ */
392
+ createIPAccessControlList(accessControlListId, request) {
393
+ return this.start()
394
+ .withUri('/api/ip-acl')
395
+ .withUriSegment(accessControlListId)
396
+ .withJSONBody(request)
397
+ .withMethod("POST")
398
+ .go();
399
+ }
385
400
  /**
386
401
  * Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
387
402
  *
@@ -843,6 +858,19 @@ class FusionAuthClient {
843
858
  .withMethod("DELETE")
844
859
  .go();
845
860
  }
861
+ /**
862
+ * Deletes the IP Access Control List for the given Id.
863
+ *
864
+ * @param {UUID} ipAccessControlListId The Id of the IP Access Control List to delete.
865
+ * @returns {Promise<ClientResponse<void>>}
866
+ */
867
+ deleteIPAccessControlList(ipAccessControlListId) {
868
+ return this.start()
869
+ .withUri('/api/ip-acl')
870
+ .withUriSegment(ipAccessControlListId)
871
+ .withMethod("DELETE")
872
+ .go();
873
+ }
846
874
  /**
847
875
  * Deletes the identity provider for the given Id.
848
876
  *
@@ -924,7 +952,25 @@ class FusionAuthClient {
924
952
  .go();
925
953
  }
926
954
  /**
927
- * Deletes the tenant for the given Id.
955
+ * Deletes the user registration for the given user and application along with the given JSON body that contains the event information.
956
+ *
957
+ * @param {UUID} userId The Id of the user whose registration is being deleted.
958
+ * @param {UUID} applicationId The Id of the application to remove the registration for.
959
+ * @param {RegistrationDeleteRequest} request The request body that contains the event information.
960
+ * @returns {Promise<ClientResponse<void>>}
961
+ */
962
+ deleteRegistrationWithRequest(userId, applicationId, request) {
963
+ return this.start()
964
+ .withUri('/api/user/registration')
965
+ .withUriSegment(userId)
966
+ .withUriSegment(applicationId)
967
+ .withJSONBody(request)
968
+ .withMethod("DELETE")
969
+ .go();
970
+ }
971
+ /**
972
+ * Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated
973
+ * with the tenant and everything under the tenant (applications, users, etc).
928
974
  *
929
975
  * @param {UUID} tenantId The Id of the tenant to delete.
930
976
  * @returns {Promise<ClientResponse<void>>}
@@ -951,6 +997,22 @@ class FusionAuthClient {
951
997
  .withMethod("DELETE")
952
998
  .go();
953
999
  }
1000
+ /**
1001
+ * Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
1002
+ * with the tenant and everything under the tenant (applications, users, etc).
1003
+ *
1004
+ * @param {UUID} tenantId The Id of the tenant to delete.
1005
+ * @param {TenantDeleteRequest} request The request object that contains all of the information used to delete the user.
1006
+ * @returns {Promise<ClientResponse<void>>}
1007
+ */
1008
+ deleteTenantWithRequest(tenantId, request) {
1009
+ return this.start()
1010
+ .withUri('/api/tenant')
1011
+ .withUriSegment(tenantId)
1012
+ .withJSONBody(request)
1013
+ .withMethod("DELETE")
1014
+ .go();
1015
+ }
954
1016
  /**
955
1017
  * Deletes the theme for the given Id.
956
1018
  *
@@ -1024,6 +1086,22 @@ class FusionAuthClient {
1024
1086
  .withMethod("DELETE")
1025
1087
  .go();
1026
1088
  }
1089
+ /**
1090
+ * Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
1091
+ * with the user.
1092
+ *
1093
+ * @param {UUID} userId The Id of the user to delete (required).
1094
+ * @param {UserDeleteSingleRequest} request The request object that contains all of the information used to delete the user.
1095
+ * @returns {Promise<ClientResponse<void>>}
1096
+ */
1097
+ deleteUserWithRequest(userId, request) {
1098
+ return this.start()
1099
+ .withUri('/api/user')
1100
+ .withUriSegment(userId)
1101
+ .withJSONBody(request)
1102
+ .withMethod("DELETE")
1103
+ .go();
1104
+ }
1027
1105
  /**
1028
1106
  * Deletes the users with the given ids, or users matching the provided JSON query or queryString.
1029
1107
  * The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
@@ -1084,12 +1162,27 @@ class FusionAuthClient {
1084
1162
  disableTwoFactor(userId, methodId, code) {
1085
1163
  return this.start()
1086
1164
  .withUri('/api/user/two-factor')
1087
- .withParameter('userId', userId)
1165
+ .withUriSegment(userId)
1088
1166
  .withParameter('methodId', methodId)
1089
1167
  .withParameter('code', code)
1090
1168
  .withMethod("DELETE")
1091
1169
  .go();
1092
1170
  }
1171
+ /**
1172
+ * Disable Two Factor authentication for a user using a JSON body rather than URL parameters.
1173
+ *
1174
+ * @param {UUID} userId The Id of the User for which you're disabling Two Factor authentication.
1175
+ * @param {TwoFactorDisableRequest} request The request information that contains the code and methodId along with any event information.
1176
+ * @returns {Promise<ClientResponse<void>>}
1177
+ */
1178
+ disableTwoFactorWithRequest(userId, request) {
1179
+ return this.start()
1180
+ .withUri('/api/user/two-factor')
1181
+ .withUriSegment(userId)
1182
+ .withJSONBody(request)
1183
+ .withMethod("DELETE")
1184
+ .go();
1185
+ }
1093
1186
  /**
1094
1187
  * Enable Two Factor authentication for a user.
1095
1188
  *
@@ -1486,6 +1579,20 @@ class FusionAuthClient {
1486
1579
  .withMethod("POST")
1487
1580
  .go();
1488
1581
  }
1582
+ /**
1583
+ * The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the
1584
+ * client and revoke the refresh token stored. This API takes the refresh token in the JSON body.
1585
+ *
1586
+ * @param {LogoutRequest} request The request object that contains all of the information used to logout the user.
1587
+ * @returns {Promise<ClientResponse<void>>}
1588
+ */
1589
+ logoutWithRequest(request) {
1590
+ return this.startAnonymous()
1591
+ .withUri('/api/logout')
1592
+ .withJSONBody(request)
1593
+ .withMethod("POST")
1594
+ .go();
1595
+ }
1489
1596
  /**
1490
1597
  * Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
1491
1598
  * by a registered identity provider. A 404 indicates the domain is not managed.
@@ -2409,6 +2516,19 @@ class FusionAuthClient {
2409
2516
  .withMethod("GET")
2410
2517
  .go();
2411
2518
  }
2519
+ /**
2520
+ * Retrieves the IP Access Control List with the given Id.
2521
+ *
2522
+ * @param {UUID} ipAccessControlListId The Id of the IP Access Control List.
2523
+ * @returns {Promise<ClientResponse<IPAccessControlListResponse>>}
2524
+ */
2525
+ retrieveIPAccessControlList(ipAccessControlListId) {
2526
+ return this.start()
2527
+ .withUri('/api/ip-acl')
2528
+ .withUriSegment(ipAccessControlListId)
2529
+ .withMethod("GET")
2530
+ .go();
2531
+ }
2412
2532
  /**
2413
2533
  * Retrieves the identity provider for the given id or all of the identity providers if the id is null.
2414
2534
  *
@@ -2771,6 +2891,17 @@ class FusionAuthClient {
2771
2891
  .withMethod("GET")
2772
2892
  .go();
2773
2893
  }
2894
+ /**
2895
+ * Retrieves the FusionAuth Reactor metrics.
2896
+ *
2897
+ * @returns {Promise<ClientResponse<ReactorMetricsResponse>>}
2898
+ */
2899
+ retrieveReactorMetrics() {
2900
+ return this.start()
2901
+ .withUri('/api/reactor/metrics')
2902
+ .withMethod("GET")
2903
+ .go();
2904
+ }
2774
2905
  /**
2775
2906
  * Retrieves the FusionAuth Reactor status.
2776
2907
  *
@@ -3378,6 +3509,20 @@ class FusionAuthClient {
3378
3509
  .withMethod("DELETE")
3379
3510
  .go();
3380
3511
  }
3512
+ /**
3513
+ * Revokes refresh tokens using the information in the JSON body. The handling for this method is the same as the revokeRefreshToken method
3514
+ * and is based on the information you provide in the RefreshDeleteRequest object. See that method for additional information.
3515
+ *
3516
+ * @param {RefreshTokenRevokeRequest} request The request information used to revoke the refresh tokens.
3517
+ * @returns {Promise<ClientResponse<void>>}
3518
+ */
3519
+ revokeRefreshTokensWithRequest(request) {
3520
+ return this.start()
3521
+ .withUri('/api/jwt/refresh')
3522
+ .withJSONBody(request)
3523
+ .withMethod("DELETE")
3524
+ .go();
3525
+ }
3381
3526
  /**
3382
3527
  * Revokes a single User consent by Id.
3383
3528
  *
@@ -3469,6 +3614,19 @@ class FusionAuthClient {
3469
3614
  .withMethod("POST")
3470
3615
  .go();
3471
3616
  }
3617
+ /**
3618
+ * Searches the IP Access Control Lists with the specified criteria and pagination.
3619
+ *
3620
+ * @param {IPAccessControlListSearchRequest} request The search criteria and pagination information.
3621
+ * @returns {Promise<ClientResponse<IPAccessControlListSearchResponse>>}
3622
+ */
3623
+ searchIPAccessControlLists(request) {
3624
+ return this.start()
3625
+ .withUri('/api/ip-acl/search')
3626
+ .withJSONBody(request)
3627
+ .withMethod("POST")
3628
+ .go();
3629
+ }
3472
3630
  /**
3473
3631
  * Searches the login records with the specified criteria and pagination.
3474
3632
  *
@@ -3886,6 +4044,21 @@ class FusionAuthClient {
3886
4044
  .withMethod("PUT")
3887
4045
  .go();
3888
4046
  }
4047
+ /**
4048
+ * Updates the IP Access Control List with the given Id.
4049
+ *
4050
+ * @param {UUID} accessControlListId The Id of the IP Access Control List to update.
4051
+ * @param {IPAccessControlListRequest} request The request that contains all of the new IP Access Control List information.
4052
+ * @returns {Promise<ClientResponse<IPAccessControlListResponse>>}
4053
+ */
4054
+ updateIPAccessControlList(accessControlListId, request) {
4055
+ return this.start()
4056
+ .withUri('/api/ip-acl')
4057
+ .withUriSegment(accessControlListId)
4058
+ .withJSONBody(request)
4059
+ .withMethod("PUT")
4060
+ .go();
4061
+ }
3889
4062
  /**
3890
4063
  * Updates the identity provider with the given Id.
3891
4064
  *
@@ -4155,6 +4328,27 @@ class FusionAuthClient {
4155
4328
  .withMethod("GET")
4156
4329
  .go();
4157
4330
  }
4331
+ /**
4332
+ * It's a JWT vending machine!
4333
+ *
4334
+ * Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form
4335
+ * token that will contain what claims you provide.
4336
+ * <p>
4337
+ * The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.
4338
+ *
4339
+ * If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either
4340
+ * by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.
4341
+ *
4342
+ * @param {JWTVendRequest} request The request that contains all of the claims for this JWT.
4343
+ * @returns {Promise<ClientResponse<JWTVendResponse>>}
4344
+ */
4345
+ vendJWT(request) {
4346
+ return this.start()
4347
+ .withUri('/api/jwt/vend')
4348
+ .withJSONBody(request)
4349
+ .withMethod("POST")
4350
+ .go();
4351
+ }
4158
4352
  /**
4159
4353
  * Confirms a email verification. The Id given is usually from an email sent to the user.
4160
4354
  *
@@ -4267,6 +4461,13 @@ var Algorithm;
4267
4461
  Algorithm["RS512"] = "RS512";
4268
4462
  Algorithm["none"] = "none";
4269
4463
  })(Algorithm = exports.Algorithm || (exports.Algorithm = {}));
4464
+ /**
4465
+ * @author Brett Pontarelli
4466
+ */
4467
+ var AuthenticationThreats;
4468
+ (function (AuthenticationThreats) {
4469
+ AuthenticationThreats["ImpossibleTravel"] = "ImpossibleTravel";
4470
+ })(AuthenticationThreats = exports.AuthenticationThreats || (exports.AuthenticationThreats = {}));
4270
4471
  var BreachAction;
4271
4472
  (function (BreachAction) {
4272
4473
  BreachAction["Off"] = "Off";
@@ -4303,6 +4504,16 @@ var CanonicalizationMethod;
4303
4504
  CanonicalizationMethod["inclusive"] = "inclusive";
4304
4505
  CanonicalizationMethod["inclusive_with_comments"] = "inclusive_with_comments";
4305
4506
  })(CanonicalizationMethod = exports.CanonicalizationMethod || (exports.CanonicalizationMethod = {}));
4507
+ /**
4508
+ * @author Brett Pontarelli
4509
+ */
4510
+ var CaptchaMethod;
4511
+ (function (CaptchaMethod) {
4512
+ CaptchaMethod["GoogleRecaptchaV2"] = "GoogleRecaptchaV2";
4513
+ CaptchaMethod["GoogleRecaptchaV3"] = "GoogleRecaptchaV3";
4514
+ CaptchaMethod["HCaptcha"] = "HCaptcha";
4515
+ CaptchaMethod["HCaptchaEnterprise"] = "HCaptchaEnterprise";
4516
+ })(CaptchaMethod = exports.CaptchaMethod || (exports.CaptchaMethod = {}));
4306
4517
  /**
4307
4518
  * @author Trevor Smith
4308
4519
  */
@@ -4396,24 +4607,44 @@ var EventLogType;
4396
4607
  */
4397
4608
  var EventType;
4398
4609
  (function (EventType) {
4399
- EventType["UserDelete"] = "user.delete";
4400
- EventType["UserCreate"] = "user.create";
4401
- EventType["UserUpdate"] = "user.update";
4402
- EventType["UserDeactivate"] = "user.deactivate";
4403
- EventType["UserBulkCreate"] = "user.bulk.create";
4404
- EventType["UserReactivate"] = "user.reactivate";
4405
- EventType["UserAction"] = "user.action";
4610
+ EventType["JWTPublicKeyUpdate"] = "jwt.public-key.update";
4406
4611
  EventType["JWTRefreshTokenRevoke"] = "jwt.refresh-token.revoke";
4407
4612
  EventType["JWTRefresh"] = "jwt.refresh";
4408
- EventType["JWTPublicKeyUpdate"] = "jwt.public-key.update";
4409
- EventType["UserLoginSuccess"] = "user.login.success";
4613
+ EventType["AuditLogCreate"] = "audit-log.create";
4614
+ EventType["EventLogCreate"] = "event-log.create";
4615
+ EventType["KickstartSuccess"] = "kickstart.success";
4616
+ EventType["UserAction"] = "user.action";
4617
+ EventType["UserBulkCreate"] = "user.bulk.create";
4618
+ EventType["UserCreate"] = "user.create";
4619
+ EventType["UserCreateComplete"] = "user.create.complete";
4620
+ EventType["UserDeactivate"] = "user.deactivate";
4621
+ EventType["UserDelete"] = "user.delete";
4622
+ EventType["UserDeleteComplete"] = "user.delete.complete";
4623
+ EventType["UserLoginIdDuplicateOnCreate"] = "user.loginId.duplicate.create";
4624
+ EventType["UserLoginIdDuplicateOnUpdate"] = "user.loginId.duplicate.update";
4625
+ EventType["UserEmailUpdate"] = "user.email.update";
4626
+ EventType["UserEmailVerified"] = "user.email.verified";
4410
4627
  EventType["UserLoginFailed"] = "user.login.failed";
4628
+ EventType["UserLoginNewDevice"] = "user.login.new-device";
4629
+ EventType["UserLoginSuccess"] = "user.login.success";
4630
+ EventType["UserLoginSuspicious"] = "user.login.suspicious";
4631
+ EventType["UserPasswordBreach"] = "user.password.breach";
4632
+ EventType["UserPasswordResetSend"] = "user.password.reset.send";
4633
+ EventType["UserPasswordResetStart"] = "user.password.reset.start";
4634
+ EventType["UserPasswordResetSuccess"] = "user.password.reset.success";
4635
+ EventType["UserPasswordUpdate"] = "user.password.update";
4636
+ EventType["UserReactivate"] = "user.reactivate";
4411
4637
  EventType["UserRegistrationCreate"] = "user.registration.create";
4412
- EventType["UserRegistrationUpdate"] = "user.registration.update";
4638
+ EventType["UserRegistrationCreateComplete"] = "user.registration.create.complete";
4413
4639
  EventType["UserRegistrationDelete"] = "user.registration.delete";
4640
+ EventType["UserRegistrationDeleteComplete"] = "user.registration.delete.complete";
4641
+ EventType["UserRegistrationUpdate"] = "user.registration.update";
4642
+ EventType["UserRegistrationUpdateComplete"] = "user.registration.update.complete";
4414
4643
  EventType["UserRegistrationVerified"] = "user.registration.verified";
4415
- EventType["UserEmailVerified"] = "user.email.verified";
4416
- EventType["UserPasswordBreach"] = "user.password.breach";
4644
+ EventType["UserTwoFactorMethodAdd"] = "user.two-factor.method.add";
4645
+ EventType["UserTwoFactorMethodRemove"] = "user.two-factor.method.remove";
4646
+ EventType["UserUpdate"] = "user.update";
4647
+ EventType["UserUpdateComplete"] = "user.update.complete";
4417
4648
  EventType["Test"] = "test";
4418
4649
  })(EventType = exports.EventType || (exports.EventType = {}));
4419
4650
  /**
@@ -4554,6 +4785,14 @@ var IdentityProviderType;
4554
4785
  IdentityProviderType["Twitter"] = "Twitter";
4555
4786
  IdentityProviderType["Xbox"] = "Xbox";
4556
4787
  })(IdentityProviderType = exports.IdentityProviderType || (exports.IdentityProviderType = {}));
4788
+ /**
4789
+ * @author Brett Guy
4790
+ */
4791
+ var IPAccessControlEntryAction;
4792
+ (function (IPAccessControlEntryAction) {
4793
+ IPAccessControlEntryAction["Allow"] = "Allow";
4794
+ IPAccessControlEntryAction["Block"] = "Block";
4795
+ })(IPAccessControlEntryAction = exports.IPAccessControlEntryAction || (exports.IPAccessControlEntryAction = {}));
4557
4796
  var KeyAlgorithm;
4558
4797
  (function (KeyAlgorithm) {
4559
4798
  KeyAlgorithm["ES256"] = "ES256";
@@ -4738,6 +4977,18 @@ var ProofKeyForCodeExchangePolicy;
4738
4977
  ProofKeyForCodeExchangePolicy["NotRequired"] = "NotRequired";
4739
4978
  ProofKeyForCodeExchangePolicy["NotRequiredWhenUsingClientAuthentication"] = "NotRequiredWhenUsingClientAuthentication";
4740
4979
  })(ProofKeyForCodeExchangePolicy = exports.ProofKeyForCodeExchangePolicy || (exports.ProofKeyForCodeExchangePolicy = {}));
4980
+ /**
4981
+ * @author Daniel DeGroff
4982
+ */
4983
+ var RateLimitedRequestType;
4984
+ (function (RateLimitedRequestType) {
4985
+ RateLimitedRequestType["FailedLogin"] = "FailedLogin";
4986
+ RateLimitedRequestType["ForgotPassword"] = "ForgotPassword";
4987
+ RateLimitedRequestType["SendEmailVerification"] = "SendEmailVerification";
4988
+ RateLimitedRequestType["SendPasswordless"] = "SendPasswordless";
4989
+ RateLimitedRequestType["SendRegistrationVerification"] = "SendRegistrationVerification";
4990
+ RateLimitedRequestType["SendTwoFactor"] = "SendTwoFactor";
4991
+ })(RateLimitedRequestType = exports.RateLimitedRequestType || (exports.RateLimitedRequestType = {}));
4741
4992
  /**
4742
4993
  * @author Brian Pontarelli
4743
4994
  */
@@ -4746,6 +4997,7 @@ var ReactorFeatureStatus;
4746
4997
  ReactorFeatureStatus["ACTIVE"] = "ACTIVE";
4747
4998
  ReactorFeatureStatus["DISCONNECTED"] = "DISCONNECTED";
4748
4999
  ReactorFeatureStatus["PENDING"] = "PENDING";
5000
+ ReactorFeatureStatus["DISABLED"] = "DISABLED";
4749
5001
  ReactorFeatureStatus["UNKNOWN"] = "UNKNOWN";
4750
5002
  })(ReactorFeatureStatus = exports.ReactorFeatureStatus || (exports.ReactorFeatureStatus = {}));
4751
5003
  /**