@@ -1530,10 +1530,10 @@ export class FusionAuthClient {
1530
1530
* @param {UUID } applicationId The Id of the application that they logged into.
1531
1531
* @param {string } callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided
1532
1532
* the IP address will be that of the client or last proxy that sent the request.
1533
- * @returns {Promise<ClientResponse<void >> }
1533
+ * @returns {Promise<ClientResponse<LoginResponse >> }
1534
1534
*/
1535
- loginPing ( userId : UUID , applicationId : UUID , callerIPAddress : string ) : Promise < ClientResponse < void > > {
1536
- return this . start < void , Errors > ( )
1535
+ loginPing ( userId : UUID , applicationId : UUID , callerIPAddress : string ) : Promise < ClientResponse < LoginResponse > > {
1536
+ return this . start < LoginResponse , Errors > ( )
1537
1537
. withUri ( '/api/login' )
1538
1538
. withUriSegment ( userId )
1539
1539
. withUriSegment ( applicationId )
@@ -3376,6 +3376,18 @@ export class FusionAuthClient {
3376
3376
. go ( ) ;
3377
3377
}
3378
3378
3379
+ /**
3380
+ * Retrieves the FusionAuth version string.
3381
+ *
3382
+ * @returns {Promise<ClientResponse<VersionResponse>> }
3383
+ */
3384
+ retrieveVersion ( ) : Promise < ClientResponse < VersionResponse > > {
3385
+ return this . start < VersionResponse , Errors > ( )
3386
+ . withUri ( '/api/system/version' )
3387
+ . withMethod ( "GET" )
3388
+ . go ( ) ;
3389
+ }
3390
+
3379
3391
/**
3380
3392
* Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
3381
3393
*
@@ -4350,6 +4362,8 @@ export class FusionAuthClient {
4350
4362
*
4351
4363
* @param {string } verificationId The email verification id sent to the user.
4352
4364
* @returns {Promise<ClientResponse<void>> }
4365
+ *
4366
+ * @deprecated This method has been renamed to verifyEmailAddress and changed to take a JSON request body, use that method instead.
4353
4367
*/
4354
4368
verifyEmail ( verificationId : string ) : Promise < ClientResponse < void > > {
4355
4369
return this . startAnonymous < void , Errors > ( )
@@ -4360,11 +4374,32 @@ export class FusionAuthClient {
4360
4374
. go ( ) ;
4361
4375
}
4362
4376
4377
+ /**
4378
+ * Confirms a user's email address.
4379
+ *
4380
+ * The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
4381
+ * the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.
4382
+ * The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
4383
+ * two values together are able to confirm a user's email address and mark the user's email address as verified.
4384
+ *
4385
+ * @param {VerifyEmailRequest } request The request that contains the verificationId and optional one-time use code paired with the verificationId.
4386
+ * @returns {Promise<ClientResponse<void>> }
4387
+ */
4388
+ verifyEmailAddress ( request : VerifyEmailRequest ) : Promise < ClientResponse < void > > {
4389
+ return this . startAnonymous < void , Errors > ( )
4390
+ . withUri ( '/api/user/verify-email' )
4391
+ . withJSONBody ( request )
4392
+ . withMethod ( "POST" )
4393
+ . go ( ) ;
4394
+ }
4395
+
4363
4396
/**
4364
4397
* Confirms an application registration. The Id given is usually from an email sent to the user.
4365
4398
*
4366
4399
* @param {string } verificationId The registration verification Id sent to the user.
4367
4400
* @returns {Promise<ClientResponse<void>> }
4401
+ *
4402
+ * @deprecated This method has been renamed to verifyUserRegistration and changed to take a JSON request body, use that method instead.
4368
4403
*/
4369
4404
verifyRegistration ( verificationId : string ) : Promise < ClientResponse < void > > {
4370
4405
return this . startAnonymous < void , Errors > ( )
@@ -4375,6 +4410,25 @@ export class FusionAuthClient {
4375
4410
. go ( ) ;
4376
4411
}
4377
4412
4413
+ /**
4414
+ * Confirms a user's registration.
4415
+ *
4416
+ * The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
4417
+ * the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.
4418
+ * The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
4419
+ * two values together are able to confirm a user's registration and mark the user's registration as verified.
4420
+ *
4421
+ * @param {VerifyRegistrationRequest } request The request that contains the verificationId and optional one-time use code paired with the verificationId.
4422
+ * @returns {Promise<ClientResponse<void>> }
4423
+ */
4424
+ verifyUserRegistration ( request : VerifyRegistrationRequest ) : Promise < ClientResponse < void > > {
4425
+ return this . startAnonymous < void , Errors > ( )
4426
+ . withUri ( '/api/user/verify-registration' )
4427
+ . withJSONBody ( request )
4428
+ . withMethod ( "POST" )
4429
+ . go ( ) ;
4430
+ }
4431
+
4378
4432
4379
4433
/* ===================================================================================================================
4380
4434
* Private methods
@@ -4569,7 +4623,10 @@ export interface Application {
4569
4623
samlv2Configuration ?: SAMLv2Configuration ;
4570
4624
state ?: ObjectState ;
4571
4625
tenantId ?: UUID ;
4626
+ themeId ?: UUID ;
4627
+ unverified ?: RegistrationUnverifiedOptions ;
4572
4628
verificationEmailTemplateId ?: UUID ;
4629
+ verificationStrategy ?: VerificationStrategy ;
4573
4630
verifyRegistration ?: boolean ;
4574
4631
}
4575
4632
@@ -4650,6 +4707,15 @@ export interface ApplicationRole {
4650
4707
name ?: string ;
4651
4708
}
4652
4709
4710
+ /**
4711
+ * @author Daniel DeGroff
4712
+ */
4713
+ export interface ApplicationUnverifiedConfiguration {
4714
+ registration ?: UnverifiedBehavior ;
4715
+ verificationStrategy ?: VerificationStrategy ;
4716
+ whenGated ?: RegistrationUnverifiedOptions ;
4717
+ }
4718
+
4653
4719
/**
4654
4720
* This class is a simple attachment with a byte array, name and MIME type.
4655
4721
*
@@ -5169,8 +5235,10 @@ export interface EmailConfiguration {
5169
5235
properties ?: string ;
5170
5236
security ?: EmailSecurityType ;
5171
5237
setPasswordEmailTemplateId ?: UUID ;
5238
+ unverified ?: EmailUnverifiedOptions ;
5172
5239
username ?: string ;
5173
5240
verificationEmailTemplateId ?: UUID ;
5241
+ verificationStrategy ?: VerificationStrategy ;
5174
5242
verifyEmail ?: boolean ;
5175
5243
verifyEmailWhenChanged ?: boolean ;
5176
5244
}
@@ -5232,6 +5300,14 @@ export interface EmailTemplateResponse {
5232
5300
emailTemplates ?: Array < EmailTemplate > ;
5233
5301
}
5234
5302
5303
+ /**
5304
+ * @author Daniel DeGroff
5305
+ */
5306
+ export interface EmailUnverifiedOptions {
5307
+ allowEmailChangeWhenGated ?: boolean ;
5308
+ behavior ?: UnverifiedBehavior ;
5309
+ }
5310
+
5235
5311
/**
5236
5312
* Something that can be enabled and thus also disabled.
5237
5313
*
@@ -5611,12 +5687,14 @@ export interface ExternalIdentifierConfiguration {
5611
5687
deviceUserCodeIdGenerator ?: SecureGeneratorConfiguration ;
5612
5688
emailVerificationIdGenerator ?: SecureGeneratorConfiguration ;
5613
5689
emailVerificationIdTimeToLiveInSeconds ?: number ;
5690
+ emailVerificationOneTimeCodeGenerator ?: SecureGeneratorConfiguration ;
5614
5691
externalAuthenticationIdTimeToLiveInSeconds ?: number ;
5615
5692
oneTimePasswordTimeToLiveInSeconds ?: number ;
5616
5693
passwordlessLoginGenerator ?: SecureGeneratorConfiguration ;
5617
5694
passwordlessLoginTimeToLiveInSeconds ?: number ;
5618
5695
registrationVerificationIdGenerator ?: SecureGeneratorConfiguration ;
5619
5696
registrationVerificationIdTimeToLiveInSeconds ?: number ;
5697
+ registrationVerificationOneTimeCodeGenerator ?: SecureGeneratorConfiguration ;
5620
5698
samlv2AuthNRequestIdTimeToLiveInSeconds ?: number ;
5621
5699
setupPasswordIdGenerator ?: SecureGeneratorConfiguration ;
5622
5700
setupPasswordIdTimeToLiveInSeconds ?: number ;
@@ -6687,8 +6765,10 @@ export interface LoginResponse {
6687
6765
actions ?: Array < LoginPreventedResponse > ;
6688
6766
changePasswordId ?: string ;
6689
6767
changePasswordReason ?: ChangePasswordReason ;
6768
+ emailVerificationId ?: string ;
6690
6769
methods ?: Array < TwoFactorMethod > ;
6691
6770
refreshToken ?: string ;
6771
+ registrationVerificationId ?: string ;
6692
6772
state ?: Record < string , any > ;
6693
6773
token ?: string ;
6694
6774
twoFactorId ?: string ;
@@ -7225,7 +7305,8 @@ export interface ReactorResponse {
7225
7305
export interface ReactorStatus {
7226
7306
advancedIdentityProviders ?: ReactorFeatureStatus ;
7227
7307
advancedMultiFactorAuthentication ?: ReactorFeatureStatus ;
7228
- advancedRegistrationForms ?: ReactorFeatureStatus ;
7308
+ advancedRegistration ?: ReactorFeatureStatus ;
7309
+ applicationThemes ?: ReactorFeatureStatus ;
7229
7310
breachedPasswordDetection ?: ReactorFeatureStatus ;
7230
7311
connectors ?: ReactorFeatureStatus ;
7231
7312
entityManagement ?: ReactorFeatureStatus ;
@@ -7360,6 +7441,7 @@ export interface RegistrationRequest {
7360
7441
export interface RegistrationResponse {
7361
7442
refreshToken ?: string ;
7362
7443
registration ?: UserRegistration ;
7444
+ registrationVerificationId ?: string ;
7363
7445
token ?: string ;
7364
7446
user ?: User ;
7365
7447
}
@@ -7369,6 +7451,13 @@ export enum RegistrationType {
7369
7451
advanced = "advanced"
7370
7452
}
7371
7453
7454
+ /**
7455
+ * @author Daniel DeGroff
7456
+ */
7457
+ export interface RegistrationUnverifiedOptions {
7458
+ behavior ?: UnverifiedBehavior ;
7459
+ }
7460
+
7372
7461
/**
7373
7462
* @author Daniel DeGroff
7374
7463
*/
@@ -7554,6 +7643,7 @@ export interface SecureIdentity {
7554
7643
passwordChangeRequired ?: boolean ;
7555
7644
passwordLastUpdateInstant ?: number ;
7556
7645
salt ?: string ;
7646
+ uniqueUsername ?: string ;
7557
7647
username ?: string ;
7558
7648
usernameStatus ?: ContentStatus ;
7559
7649
verified ?: boolean ;
@@ -7665,6 +7755,8 @@ export interface Templates {
7665
7755
accountTwoFactorIndex ?: string ;
7666
7756
emailComplete ?: string ;
7667
7757
emailSend ?: string ;
7758
+ emailSent ?: string ;
7759
+ emailVerificationRequired ?: string ;
7668
7760
emailVerify ?: string ;
7669
7761
helpers ?: string ;
7670
7762
index ?: string ;
@@ -7687,6 +7779,8 @@ export interface Templates {
7687
7779
passwordSent ?: string ;
7688
7780
registrationComplete ?: string ;
7689
7781
registrationSend ?: string ;
7782
+ registrationSent ?: string ;
7783
+ registrationVerificationRequired ?: string ;
7690
7784
registrationVerify ?: string ;
7691
7785
samlv2Logout ?: string ;
7692
7786
}
@@ -7721,6 +7815,7 @@ export interface Tenant {
7721
7815
state ?: ObjectState ;
7722
7816
themeId ?: UUID ;
7723
7817
userDeletePolicy ?: TenantUserDeletePolicy ;
7818
+ usernameConfiguration ?: TenantUsernameConfiguration ;
7724
7819
}
7725
7820
7726
7821
/**
@@ -7768,6 +7863,14 @@ export interface TenantResponse {
7768
7863
tenants ?: Array < Tenant > ;
7769
7864
}
7770
7865
7866
+ /**
7867
+ * @author Daniel DeGroff
7868
+ */
7869
+ export interface TenantUnverifiedConfiguration {
7870
+ email ?: UnverifiedBehavior ;
7871
+ whenGated ?: RegistrationUnverifiedOptions ;
7872
+ }
7873
+
7771
7874
/**
7772
7875
* A Tenant-level policy for deleting Users.
7773
7876
*
@@ -7777,6 +7880,13 @@ export interface TenantUserDeletePolicy {
7777
7880
unverified ?: TimeBasedDeletePolicy ;
7778
7881
}
7779
7882
7883
+ /**
7884
+ * @author Daniel DeGroff
7885
+ */
7886
+ export interface TenantUsernameConfiguration {
7887
+ unique ?: UniqueUsernameConfiguration ;
7888
+ }
7889
+
7780
7890
/**
7781
7891
* @author Daniel DeGroff
7782
7892
*/
@@ -8016,6 +8126,19 @@ export interface UIConfiguration {
8016
8126
menuFontColor ?: string ;
8017
8127
}
8018
8128
8129
+ export interface UniqueUsernameConfiguration extends Enableable {
8130
+ numberOfDigits ?: number ;
8131
+ separator ?: string ;
8132
+ }
8133
+
8134
+ /**
8135
+ * @author Daniel DeGroff
8136
+ */
8137
+ export enum UnverifiedBehavior {
8138
+ Allow = "Allow" ,
8139
+ Gated = "Gated"
8140
+ }
8141
+
8019
8142
/**
8020
8143
* The global view of a User. This object contains all global information about the user including birth date, registration information
8021
8144
* preferred languages, global attributes, etc.
@@ -8477,6 +8600,8 @@ export interface UserRequest {
8477
8600
* @author Brian Pontarelli
8478
8601
*/
8479
8602
export interface UserResponse {
8603
+ emailVerificationId ?: string ;
8604
+ registrationVerificationIds ?: Record < UUID , string > ;
8480
8605
token ?: string ;
8481
8606
user ?: User ;
8482
8607
}
@@ -8494,7 +8619,9 @@ export interface UserSearchCriteria extends BaseElasticSearchCriteria {
8494
8619
*/
8495
8620
export enum UserState {
8496
8621
Authenticated = "Authenticated" ,
8497
- AuthenticatedNotRegistered = "AuthenticatedNotRegistered"
8622
+ AuthenticatedNotRegistered = "AuthenticatedNotRegistered" ,
8623
+ AuthenticatedNotVerified = "AuthenticatedNotVerified" ,
8624
+ AuthenticatedRegistrationNotVerified = "AuthenticatedRegistrationNotVerified"
8498
8625
}
8499
8626
8500
8627
/**
@@ -8522,20 +8649,53 @@ export interface ValidateResponse {
8522
8649
jwt ?: JWT ;
8523
8650
}
8524
8651
8652
+ /**
8653
+ * @author Daniel DeGroff
8654
+ */
8655
+ export enum VerificationStrategy {
8656
+ ClickableLink = "ClickableLink" ,
8657
+ FormField = "FormField"
8658
+ }
8659
+
8660
+ /**
8661
+ * @author Daniel DeGroff
8662
+ */
8663
+ export interface VerifyEmailRequest {
8664
+ oneTimeCode ?: string ;
8665
+ verificationId ?: string ;
8666
+ }
8667
+
8525
8668
/**
8526
8669
* @author Daniel DeGroff
8527
8670
*/
8528
8671
export interface VerifyEmailResponse {
8672
+ oneTimeCode ?: string ;
8673
+ verificationId ?: string ;
8674
+ }
8675
+
8676
+ /**
8677
+ * @author Daniel DeGroff
8678
+ */
8679
+ export interface VerifyRegistrationRequest {
8680
+ oneTimeCode ?: string ;
8529
8681
verificationId ?: string ;
8530
8682
}
8531
8683
8532
8684
/**
8533
8685
* @author Daniel DeGroff
8534
8686
*/
8535
8687
export interface VerifyRegistrationResponse {
8688
+ oneTimeCode ?: string ;
8536
8689
verificationId ?: string ;
8537
8690
}
8538
8691
8692
+ /**
8693
+ * @author Daniel DeGroff
8694
+ */
8695
+ export interface VersionResponse {
8696
+ version ?: string ;
8697
+ }
8698
+
8539
8699
/**
8540
8700
* A server where events are sent. This includes user action events and any other events sent by FusionAuth.
8541
8701
*
0 commit comments