Skip to content

Commit cdd71af

Browse files
committed
squash bpontarelli/themes-and-registrations into master
1 parent 438f1b9 commit cdd71af

File tree

4 files changed

+168
-8
lines changed

4 files changed

+168
-8
lines changed

build.savant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
savantVersion = "1.0.0"
1717

18-
project(group: "io.fusionauth", name: "fusionauth-typescript-client", version: "1.26.1", licenses: ["ApacheV2_0"]) {
18+
project(group: "io.fusionauth", name: "fusionauth-typescript-client", version: "1.27.0", licenses: ["ApacheV2_0"]) {
1919
workflow {
2020
standard()
2121
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fusionauth/typescript-client",
3-
"version": "1.26.1",
3+
"version": "1.27.0",
44
"description": "A typescript implementation of the FusionAuth client.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/FusionAuthClient.ts

Lines changed: 165 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,10 +1530,10 @@ export class FusionAuthClient {
15301530
* @param {UUID} applicationId The Id of the application that they logged into.
15311531
* @param {string} callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided
15321532
* 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>>}
15341534
*/
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>()
15371537
.withUri('/api/login')
15381538
.withUriSegment(userId)
15391539
.withUriSegment(applicationId)
@@ -3376,6 +3376,18 @@ export class FusionAuthClient {
33763376
.go();
33773377
}
33783378

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+
33793391
/**
33803392
* Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
33813393
*
@@ -4350,6 +4362,8 @@ export class FusionAuthClient {
43504362
*
43514363
* @param {string} verificationId The email verification id sent to the user.
43524364
* @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.
43534367
*/
43544368
verifyEmail(verificationId: string): Promise<ClientResponse<void>> {
43554369
return this.startAnonymous<void, Errors>()
@@ -4360,11 +4374,32 @@ export class FusionAuthClient {
43604374
.go();
43614375
}
43624376

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+
43634396
/**
43644397
* Confirms an application registration. The Id given is usually from an email sent to the user.
43654398
*
43664399
* @param {string} verificationId The registration verification Id sent to the user.
43674400
* @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.
43684403
*/
43694404
verifyRegistration(verificationId: string): Promise<ClientResponse<void>> {
43704405
return this.startAnonymous<void, Errors>()
@@ -4375,6 +4410,25 @@ export class FusionAuthClient {
43754410
.go();
43764411
}
43774412

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+
43784432

43794433
/* ===================================================================================================================
43804434
* Private methods
@@ -4569,7 +4623,10 @@ export interface Application {
45694623
samlv2Configuration?: SAMLv2Configuration;
45704624
state?: ObjectState;
45714625
tenantId?: UUID;
4626+
themeId?: UUID;
4627+
unverified?: RegistrationUnverifiedOptions;
45724628
verificationEmailTemplateId?: UUID;
4629+
verificationStrategy?: VerificationStrategy;
45734630
verifyRegistration?: boolean;
45744631
}
45754632

@@ -4650,6 +4707,15 @@ export interface ApplicationRole {
46504707
name?: string;
46514708
}
46524709

4710+
/**
4711+
* @author Daniel DeGroff
4712+
*/
4713+
export interface ApplicationUnverifiedConfiguration {
4714+
registration?: UnverifiedBehavior;
4715+
verificationStrategy?: VerificationStrategy;
4716+
whenGated?: RegistrationUnverifiedOptions;
4717+
}
4718+
46534719
/**
46544720
* This class is a simple attachment with a byte array, name and MIME type.
46554721
*
@@ -5169,8 +5235,10 @@ export interface EmailConfiguration {
51695235
properties?: string;
51705236
security?: EmailSecurityType;
51715237
setPasswordEmailTemplateId?: UUID;
5238+
unverified?: EmailUnverifiedOptions;
51725239
username?: string;
51735240
verificationEmailTemplateId?: UUID;
5241+
verificationStrategy?: VerificationStrategy;
51745242
verifyEmail?: boolean;
51755243
verifyEmailWhenChanged?: boolean;
51765244
}
@@ -5232,6 +5300,14 @@ export interface EmailTemplateResponse {
52325300
emailTemplates?: Array<EmailTemplate>;
52335301
}
52345302

5303+
/**
5304+
* @author Daniel DeGroff
5305+
*/
5306+
export interface EmailUnverifiedOptions {
5307+
allowEmailChangeWhenGated?: boolean;
5308+
behavior?: UnverifiedBehavior;
5309+
}
5310+
52355311
/**
52365312
* Something that can be enabled and thus also disabled.
52375313
*
@@ -5611,12 +5687,14 @@ export interface ExternalIdentifierConfiguration {
56115687
deviceUserCodeIdGenerator?: SecureGeneratorConfiguration;
56125688
emailVerificationIdGenerator?: SecureGeneratorConfiguration;
56135689
emailVerificationIdTimeToLiveInSeconds?: number;
5690+
emailVerificationOneTimeCodeGenerator?: SecureGeneratorConfiguration;
56145691
externalAuthenticationIdTimeToLiveInSeconds?: number;
56155692
oneTimePasswordTimeToLiveInSeconds?: number;
56165693
passwordlessLoginGenerator?: SecureGeneratorConfiguration;
56175694
passwordlessLoginTimeToLiveInSeconds?: number;
56185695
registrationVerificationIdGenerator?: SecureGeneratorConfiguration;
56195696
registrationVerificationIdTimeToLiveInSeconds?: number;
5697+
registrationVerificationOneTimeCodeGenerator?: SecureGeneratorConfiguration;
56205698
samlv2AuthNRequestIdTimeToLiveInSeconds?: number;
56215699
setupPasswordIdGenerator?: SecureGeneratorConfiguration;
56225700
setupPasswordIdTimeToLiveInSeconds?: number;
@@ -6687,8 +6765,10 @@ export interface LoginResponse {
66876765
actions?: Array<LoginPreventedResponse>;
66886766
changePasswordId?: string;
66896767
changePasswordReason?: ChangePasswordReason;
6768+
emailVerificationId?: string;
66906769
methods?: Array<TwoFactorMethod>;
66916770
refreshToken?: string;
6771+
registrationVerificationId?: string;
66926772
state?: Record<string, any>;
66936773
token?: string;
66946774
twoFactorId?: string;
@@ -7225,7 +7305,8 @@ export interface ReactorResponse {
72257305
export interface ReactorStatus {
72267306
advancedIdentityProviders?: ReactorFeatureStatus;
72277307
advancedMultiFactorAuthentication?: ReactorFeatureStatus;
7228-
advancedRegistrationForms?: ReactorFeatureStatus;
7308+
advancedRegistration?: ReactorFeatureStatus;
7309+
applicationThemes?: ReactorFeatureStatus;
72297310
breachedPasswordDetection?: ReactorFeatureStatus;
72307311
connectors?: ReactorFeatureStatus;
72317312
entityManagement?: ReactorFeatureStatus;
@@ -7360,6 +7441,7 @@ export interface RegistrationRequest {
73607441
export interface RegistrationResponse {
73617442
refreshToken?: string;
73627443
registration?: UserRegistration;
7444+
registrationVerificationId?: string;
73637445
token?: string;
73647446
user?: User;
73657447
}
@@ -7369,6 +7451,13 @@ export enum RegistrationType {
73697451
advanced = "advanced"
73707452
}
73717453

7454+
/**
7455+
* @author Daniel DeGroff
7456+
*/
7457+
export interface RegistrationUnverifiedOptions {
7458+
behavior?: UnverifiedBehavior;
7459+
}
7460+
73727461
/**
73737462
* @author Daniel DeGroff
73747463
*/
@@ -7554,6 +7643,7 @@ export interface SecureIdentity {
75547643
passwordChangeRequired?: boolean;
75557644
passwordLastUpdateInstant?: number;
75567645
salt?: string;
7646+
uniqueUsername?: string;
75577647
username?: string;
75587648
usernameStatus?: ContentStatus;
75597649
verified?: boolean;
@@ -7665,6 +7755,8 @@ export interface Templates {
76657755
accountTwoFactorIndex?: string;
76667756
emailComplete?: string;
76677757
emailSend?: string;
7758+
emailSent?: string;
7759+
emailVerificationRequired?: string;
76687760
emailVerify?: string;
76697761
helpers?: string;
76707762
index?: string;
@@ -7687,6 +7779,8 @@ export interface Templates {
76877779
passwordSent?: string;
76887780
registrationComplete?: string;
76897781
registrationSend?: string;
7782+
registrationSent?: string;
7783+
registrationVerificationRequired?: string;
76907784
registrationVerify?: string;
76917785
samlv2Logout?: string;
76927786
}
@@ -7721,6 +7815,7 @@ export interface Tenant {
77217815
state?: ObjectState;
77227816
themeId?: UUID;
77237817
userDeletePolicy?: TenantUserDeletePolicy;
7818+
usernameConfiguration?: TenantUsernameConfiguration;
77247819
}
77257820

77267821
/**
@@ -7768,6 +7863,14 @@ export interface TenantResponse {
77687863
tenants?: Array<Tenant>;
77697864
}
77707865

7866+
/**
7867+
* @author Daniel DeGroff
7868+
*/
7869+
export interface TenantUnverifiedConfiguration {
7870+
email?: UnverifiedBehavior;
7871+
whenGated?: RegistrationUnverifiedOptions;
7872+
}
7873+
77717874
/**
77727875
* A Tenant-level policy for deleting Users.
77737876
*
@@ -7777,6 +7880,13 @@ export interface TenantUserDeletePolicy {
77777880
unverified?: TimeBasedDeletePolicy;
77787881
}
77797882

7883+
/**
7884+
* @author Daniel DeGroff
7885+
*/
7886+
export interface TenantUsernameConfiguration {
7887+
unique?: UniqueUsernameConfiguration;
7888+
}
7889+
77807890
/**
77817891
* @author Daniel DeGroff
77827892
*/
@@ -8016,6 +8126,19 @@ export interface UIConfiguration {
80168126
menuFontColor?: string;
80178127
}
80188128

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+
80198142
/**
80208143
* The global view of a User. This object contains all global information about the user including birth date, registration information
80218144
* preferred languages, global attributes, etc.
@@ -8477,6 +8600,8 @@ export interface UserRequest {
84778600
* @author Brian Pontarelli
84788601
*/
84798602
export interface UserResponse {
8603+
emailVerificationId?: string;
8604+
registrationVerificationIds?: Record<UUID, string>;
84808605
token?: string;
84818606
user?: User;
84828607
}
@@ -8494,7 +8619,9 @@ export interface UserSearchCriteria extends BaseElasticSearchCriteria {
84948619
*/
84958620
export enum UserState {
84968621
Authenticated = "Authenticated",
8497-
AuthenticatedNotRegistered = "AuthenticatedNotRegistered"
8622+
AuthenticatedNotRegistered = "AuthenticatedNotRegistered",
8623+
AuthenticatedNotVerified = "AuthenticatedNotVerified",
8624+
AuthenticatedRegistrationNotVerified = "AuthenticatedRegistrationNotVerified"
84988625
}
84998626

85008627
/**
@@ -8522,20 +8649,53 @@ export interface ValidateResponse {
85228649
jwt?: JWT;
85238650
}
85248651

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+
85258668
/**
85268669
* @author Daniel DeGroff
85278670
*/
85288671
export interface VerifyEmailResponse {
8672+
oneTimeCode?: string;
8673+
verificationId?: string;
8674+
}
8675+
8676+
/**
8677+
* @author Daniel DeGroff
8678+
*/
8679+
export interface VerifyRegistrationRequest {
8680+
oneTimeCode?: string;
85298681
verificationId?: string;
85308682
}
85318683

85328684
/**
85338685
* @author Daniel DeGroff
85348686
*/
85358687
export interface VerifyRegistrationResponse {
8688+
oneTimeCode?: string;
85368689
verificationId?: string;
85378690
}
85388691

8692+
/**
8693+
* @author Daniel DeGroff
8694+
*/
8695+
export interface VersionResponse {
8696+
version?: string;
8697+
}
8698+
85398699
/**
85408700
* A server where events are sent. This includes user action events and any other events sent by FusionAuth.
85418701
*

0 commit comments

Comments
 (0)