@axinom/mosaic-user-auth 0.6.0 → 0.6.1-rc.1
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/dist/UserServiceClient/UserServiceClient.d.ts +206 -206
- package/dist/UserServiceClient/UserServiceClient.d.ts.map +1 -1
- package/dist/UserServiceProvider/UserServiceProvider.d.ts +27 -27
- package/dist/UserServiceProvider/UserServiceProvider.d.ts.map +1 -1
- package/dist/common/assertError.d.ts +13 -13
- package/dist/common/enums.d.ts +11 -11
- package/dist/common/stringify-gql-query.d.ts +10 -10
- package/dist/common/types.d.ts +145 -145
- package/dist/generated/ax-auth-management-graphql.types.d.ts +1339 -1339
- package/dist/generated/user-service-end-user-graphql.types.d.ts +907 -907
- package/dist/generated/user-service-management-graphql.types.d.ts +2754 -2754
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1784 -1784
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1798 -1798
- package/dist/index.js.map +1 -1
- package/dist/util/endUserApplication.d.ts +10 -10
- package/dist/util/endUserApplication.spec.d.ts +1 -1
- package/dist/util/userAuth.d.ts +110 -110
- package/dist/util/userAuth.spec.d.ts +1 -1
- package/dist/util/userProfile.d.ts +12 -12
- package/dist/util/userProfile.spec.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
import { CheckPasswordResetOtpResponse, CheckUserSignUpOtpResponse, CompletePasswordResetResponse, CompleteUserSignUpResponse, DecryptNativeCookieResponse, IdpConfiguration, InitiatePasswordResetResponse, SignInResponse, UserSignUpResponse } from '@axinom/mosaic-user-auth-utils';
|
|
2
|
-
import { CheckEndUserPasswordResetOtpInput, CheckEndUserSignUpOtpInput, CompleteEndUserPasswordResetInput, CompleteEndUserSignUpInput, InitiateEndUserSignUpInput } from 'generated/ax-auth-management-graphql.types';
|
|
3
|
-
import { AuthenticateEndUserApplicationInput } from 'generated/user-service-management-graphql.types';
|
|
4
|
-
import { TokenRenewalMethod } from '../common/enums';
|
|
5
|
-
import { AuthenticateEndUserApplicationResponse, SignInRequest, TokenChangedCallback, TokenResponse, UserAuthConfig, UserProfileActivateResponse, UserProfileCreateResponse, UserProfileDeleteResponse, UserProfileResponse,
|
|
6
|
-
export interface IUserServiceClient {
|
|
7
|
-
isDirectSignInConfigured(): Promise<boolean>;
|
|
8
|
-
signInWithCredentials(signInRequest: SignInRequest): Promise<SignInResponse>;
|
|
9
|
-
initiateUserSignUp(userSignUpRequest: Omit<InitiateEndUserSignUpInput, 'oAuthClientId'>): Promise<UserSignUpResponse>;
|
|
10
|
-
checkUserSignUpOTP(checkUserSignUpOtpRequest: CheckEndUserSignUpOtpInput): Promise<CheckUserSignUpOtpResponse>;
|
|
11
|
-
completeUserSignUp(completeUserSignUpRequest: CompleteEndUserSignUpInput): Promise<CompleteUserSignUpResponse>;
|
|
12
|
-
initiateResetPassword(email: string, customData?: Record<string, unknown>): Promise<InitiatePasswordResetResponse>;
|
|
13
|
-
checkResetPasswordOTP(checkPasswordResetOtpRequest: CheckEndUserPasswordResetOtpInput): Promise<CheckPasswordResetOtpResponse>;
|
|
14
|
-
completeResetPassword(completePasswordResetRequest: CompleteEndUserPasswordResetInput): Promise<CompletePasswordResetResponse>;
|
|
15
|
-
getToken(): Promise<TokenResponse>;
|
|
16
|
-
addTokenChangedHandler(callback: TokenChangedCallback): void;
|
|
17
|
-
removeTokenChangedHandler(callback: TokenChangedCallback): void;
|
|
18
|
-
getIdpConfigurations(): Promise<IdpConfiguration[]>;
|
|
19
|
-
logoutUser(): Promise<boolean>;
|
|
20
|
-
setActiveProfile(endUserAccessToken: string, profileId: string): Promise<UserProfileActivateResponse>;
|
|
21
|
-
getUserProfile(endUserAccessToken: string, profileId: string): Promise<UserProfileResponse>;
|
|
22
|
-
getUserProfiles(endUserAccessToken: string): Promise<UserProfilesResponse>;
|
|
23
|
-
createUserProfile(endUserAccessToken: string, displayName: string, profilePictureUrl?: string): Promise<UserProfileCreateResponse>;
|
|
24
|
-
updateUserProfile(endUserAccessToken: string, userProfileToUpdate: UserProfileUpdateInput): Promise<UserProfileUpdateResponse>;
|
|
25
|
-
deleteUserProfile(endUserAccessToken: string, userProfileId: string): Promise<UserProfileDeleteResponse>;
|
|
26
|
-
authenticateEndUserApplication(authenticateEndUserApplicationRequest: AuthenticateEndUserApplicationInput): Promise<AuthenticateEndUserApplicationResponse>;
|
|
27
|
-
decryptNativeCookie(encryptedCookie: string, key: string): Promise<DecryptNativeCookieResponse>;
|
|
28
|
-
getAuthUrl(idpConnectionId: string, redirectUrl: string): URL;
|
|
29
|
-
getNativeAuthUrl(idpConnectionId: string, redirectUri: string, encryptionKey: string): URL;
|
|
30
|
-
}
|
|
31
|
-
export declare class UserServiceClient implements IUserServiceClient {
|
|
32
|
-
private userAuthConfig;
|
|
33
|
-
private userServiceConfig;
|
|
34
|
-
private tokenRenewalMethod;
|
|
35
|
-
private _tokenChangedHandlers;
|
|
36
|
-
private _tokenResponse;
|
|
37
|
-
private _signInWithCredentialsEndpointResponse;
|
|
38
|
-
private _axAuthIdpConfig;
|
|
39
|
-
/**
|
|
40
|
-
* Creates a user service client. For performance reasons there should only be a single client instance created by an application
|
|
41
|
-
* @param userAuthConfig Configuration values for the user service auth API
|
|
42
|
-
* @param userServiceConfig Configuration values for the user service API
|
|
43
|
-
* @param tokenRenewalMethod Token renewal method to use
|
|
44
|
-
*/
|
|
45
|
-
constructor(userAuthConfig: UserAuthConfig, userServiceConfig: UserServiceConfig, tokenRenewalMethod?: TokenRenewalMethod);
|
|
46
|
-
private get tokenResponse();
|
|
47
|
-
private set tokenResponse(value);
|
|
48
|
-
private emitTokenChanged;
|
|
49
|
-
private getAxAuthIdpConfig;
|
|
50
|
-
private getSignInWithCredentialsEndpoints;
|
|
51
|
-
/**
|
|
52
|
-
* Returns a new token by invoking the User API
|
|
53
|
-
*/
|
|
54
|
-
private fetchToken;
|
|
55
|
-
private _recursiveRefreshActive;
|
|
56
|
-
/**
|
|
57
|
-
* Renews the token pre-emptively by recursively refreshing the cached token just before it's expiry
|
|
58
|
-
*/
|
|
59
|
-
private recursivelyRefreshToken;
|
|
60
|
-
/**
|
|
61
|
-
* A utility function which can be used to determine if there exists an `AxAuth` IDP configured for the Mosaic application.
|
|
62
|
-
* Based on the outcome of this function, an end-user application can conditionally offer the option to Sign-In directly
|
|
63
|
-
* via email & password.
|
|
64
|
-
*
|
|
65
|
-
* @see {@link signInWithCredentials}
|
|
66
|
-
*
|
|
67
|
-
* @returns a boolean indicating if the Mosaic application has an AxAuth IDP provider configured and it is enabled.
|
|
68
|
-
*/
|
|
69
|
-
isDirectSignInConfigured: () => Promise<boolean>;
|
|
70
|
-
/**
|
|
71
|
-
* Starts a SignInWithCredentials flow using the AX_AUTH IDP configured for the application.
|
|
72
|
-
*
|
|
73
|
-
* @param signInRequest
|
|
74
|
-
* @returns `SignInResponse`
|
|
75
|
-
*/
|
|
76
|
-
signInWithCredentials: (signInRequest: SignInRequest) => Promise<SignInResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* Registers a new user in the AX_AUTH IDP configured for the application.
|
|
79
|
-
*
|
|
80
|
-
* @param userSignUpRequest
|
|
81
|
-
* @returns `UserSignUpResponse`
|
|
82
|
-
*/
|
|
83
|
-
initiateUserSignUp: (userSignUpRequest: Omit<InitiateEndUserSignUpInput, 'oAuthClientId'>) => Promise<UserSignUpResponse>;
|
|
84
|
-
/**
|
|
85
|
-
* Checks if a given User Sign-Up OTP Code is valid
|
|
86
|
-
*
|
|
87
|
-
* @param checkUserSignUpOtpRequest
|
|
88
|
-
* @returns `CheckUserSignUpOtpResponse`
|
|
89
|
-
*/
|
|
90
|
-
checkUserSignUpOTP: (checkUserSignUpOtpRequest: CheckEndUserSignUpOtpInput) => Promise<CheckUserSignUpOtpResponse>;
|
|
91
|
-
/**
|
|
92
|
-
* Completes a user sign up process using the AX_AUTH IDP.
|
|
93
|
-
* The user needs to input the OTP along with a password (if not provided earlier) to finish the process.
|
|
94
|
-
*
|
|
95
|
-
* @param originUrl
|
|
96
|
-
* @param completeUserSignUpRequest
|
|
97
|
-
* @returns
|
|
98
|
-
*/
|
|
99
|
-
completeUserSignUp: (completeUserSignUpRequest: CompleteEndUserSignUpInput) => Promise<CompleteUserSignUpResponse>;
|
|
100
|
-
/**
|
|
101
|
-
* Starts the process of resetting a password for a user registered using the AX_AUTH IDP.
|
|
102
|
-
* This will initiate the call to the webhook configured in AX_AUTH to send the generated OTP
|
|
103
|
-
* to the user.
|
|
104
|
-
*
|
|
105
|
-
* @param email
|
|
106
|
-
* @param customData An optional arbitrary JSON object. When used, this customData will be submitted to the Forgot Password Webhook via the HTTP POST request body, and can be used to transfer some needed context to the Webhook.
|
|
107
|
-
* @returns `InitiatePasswordResetResponse`
|
|
108
|
-
*/
|
|
109
|
-
initiateResetPassword: (email: string, customData?: Record<string, unknown>) => Promise<InitiatePasswordResetResponse>;
|
|
110
|
-
/**
|
|
111
|
-
* Checks if a given Reset Password OTP Code is valid
|
|
112
|
-
*
|
|
113
|
-
* @param checkPasswordResetOtpRequest
|
|
114
|
-
* @returns `CheckPasswordResetOtpResponse`
|
|
115
|
-
*/
|
|
116
|
-
checkResetPasswordOTP: (checkPasswordResetOtpRequest: CheckEndUserPasswordResetOtpInput) => Promise<CheckPasswordResetOtpResponse>;
|
|
117
|
-
/**
|
|
118
|
-
* Completes the password reset flow for a user registered using the AX_AUTH IDP.
|
|
119
|
-
* The user needs to input the OTP along with a new password to finish the process.
|
|
120
|
-
*
|
|
121
|
-
* @param completePasswordResetRequest
|
|
122
|
-
* @returns
|
|
123
|
-
*/
|
|
124
|
-
completeResetPassword: (completePasswordResetRequest: CompleteEndUserPasswordResetInput) => Promise<CompletePasswordResetResponse>;
|
|
125
|
-
/**
|
|
126
|
-
* Returns a token. The method will ensure to avoid unnecessary API calls by caching valid tokens.
|
|
127
|
-
*
|
|
128
|
-
* It is not recommended to remember the token for later use.
|
|
129
|
-
* When in need of a token, please call this method to get a new token.
|
|
130
|
-
*/
|
|
131
|
-
getToken: () => Promise<TokenResponse>;
|
|
132
|
-
/**
|
|
133
|
-
* Adds an event handler that will be invoked whenever a new token response is loaded from the backend
|
|
134
|
-
*
|
|
135
|
-
*/
|
|
136
|
-
addTokenChangedHandler: (callback: TokenChangedCallback) => void;
|
|
137
|
-
/**
|
|
138
|
-
* Removes an event handler for the TokenChanged event
|
|
139
|
-
*/
|
|
140
|
-
removeTokenChangedHandler: (callback: TokenChangedCallback) => void;
|
|
141
|
-
/**
|
|
142
|
-
* Returns an array of IDP Configurations that are configured for the application
|
|
143
|
-
* This list will exclude connections for provider id AX_AUTH as it is used for a user sign-up and SignInWithCredentials flows.
|
|
144
|
-
*
|
|
145
|
-
*/
|
|
146
|
-
getIdpConfigurations: () => Promise<IdpConfiguration[]>;
|
|
147
|
-
/**
|
|
148
|
-
* Logs out the user
|
|
149
|
-
*/
|
|
150
|
-
logoutUser: () => Promise<boolean>;
|
|
151
|
-
/**
|
|
152
|
-
* Sets a given Profile ID as the active profile
|
|
153
|
-
*/
|
|
154
|
-
setActiveProfile: (endUserAccessToken: string, profileId: string) => Promise<UserProfileActivateResponse>;
|
|
155
|
-
/**
|
|
156
|
-
* Returns a user profile
|
|
157
|
-
*/
|
|
158
|
-
getUserProfile: (endUserAccessToken: string, profileId: string) => Promise<UserProfileResponse>;
|
|
159
|
-
/**
|
|
160
|
-
* Returns an array of all user profiles
|
|
161
|
-
*/
|
|
162
|
-
getUserProfiles: (endUserAccessToken: string) => Promise<UserProfilesResponse>;
|
|
163
|
-
/**
|
|
164
|
-
* Creates a new user profile
|
|
165
|
-
*/
|
|
166
|
-
createUserProfile: (endUserAccessToken: string, displayName: string, profilePictureUrl: string) => Promise<UserProfileCreateResponse>;
|
|
167
|
-
/**
|
|
168
|
-
* Updates a user profile
|
|
169
|
-
* @param userProfileToUpdate User Profile object with required updates. This should be based on the current user profile object, with the required changes done on top of it.
|
|
170
|
-
*/
|
|
171
|
-
updateUserProfile: (endUserAccessToken: string, userProfileToUpdate: UserProfileUpdateInput) => Promise<UserProfileUpdateResponse>;
|
|
172
|
-
/**
|
|
173
|
-
* Deletes a user profile
|
|
174
|
-
*/
|
|
175
|
-
deleteUserProfile: (endUserAccessToken: string, userProfileId: string) => Promise<UserProfileDeleteResponse>;
|
|
176
|
-
/**
|
|
177
|
-
* Authenticate an end-user application and receive an Application Token
|
|
178
|
-
* @param authenticateEndUserApplicationRequest an object containing the tenantId/environmentId/applicationId/applicationKey info.
|
|
179
|
-
* @returns AuthenticateEndUserApplicationResponse
|
|
180
|
-
*/
|
|
181
|
-
authenticateEndUserApplication: (authenticateEndUserApplicationRequest: AuthenticateEndUserApplicationInput) => Promise<AuthenticateEndUserApplicationResponse>;
|
|
182
|
-
/**
|
|
183
|
-
* Decrypt an User Token Cookie used in Native Apps.
|
|
184
|
-
* @param encryptedCookie
|
|
185
|
-
* @param key
|
|
186
|
-
* @returns
|
|
187
|
-
*/
|
|
188
|
-
decryptNativeCookie: (encryptedCookie: string, key: string) => Promise<DecryptNativeCookieResponse>;
|
|
189
|
-
/**
|
|
190
|
-
* Returns the authentication URL for web based applications.
|
|
191
|
-
*
|
|
192
|
-
* @param idpConnectionId The ID of the User Service IDP Connection used for authentication.
|
|
193
|
-
* @param returnUrl Redirect URL which the IDP will redirect to after the authentication flow is finished.
|
|
194
|
-
* @returns a URL object with the Authentication URL
|
|
195
|
-
*/
|
|
196
|
-
getAuthUrl: (idpConnectionId: string, returnUrl: string) => URL;
|
|
197
|
-
/**
|
|
198
|
-
* Returns the authentication URL for native applications.
|
|
199
|
-
*
|
|
200
|
-
* @param idpConnectionId The ID of the User Service IDP Connection used for authentication.
|
|
201
|
-
* @param returnUrl Redirect URL which the IDP will redirect to after the authentication flow is finished.
|
|
202
|
-
* @param encryptionKey A hex string with the length of 32 bytes that is used as the encryption key to encrypt the authorization Cookie.
|
|
203
|
-
* @returns a URL object with the Authentication URL
|
|
204
|
-
*/
|
|
205
|
-
getNativeAuthUrl: (idpConnectionId: string, returnUrl: string, encryptionKey: string) => URL;
|
|
206
|
-
}
|
|
1
|
+
import { CheckPasswordResetOtpResponse, CheckUserSignUpOtpResponse, CompletePasswordResetResponse, CompleteUserSignUpResponse, DecryptNativeCookieResponse, IdpConfiguration, InitiatePasswordResetResponse, SignInResponse, UserSignUpResponse } from '@axinom/mosaic-user-auth-utils';
|
|
2
|
+
import { CheckEndUserPasswordResetOtpInput, CheckEndUserSignUpOtpInput, CompleteEndUserPasswordResetInput, CompleteEndUserSignUpInput, InitiateEndUserSignUpInput } from 'generated/ax-auth-management-graphql.types';
|
|
3
|
+
import { AuthenticateEndUserApplicationInput } from 'generated/user-service-management-graphql.types';
|
|
4
|
+
import { TokenRenewalMethod } from '../common/enums';
|
|
5
|
+
import { AuthenticateEndUserApplicationResponse, SignInRequest, TokenChangedCallback, TokenResponse, UserAuthConfig, UserProfileActivateResponse, UserProfileCreateResponse, UserProfileDeleteResponse, UserProfileResponse, UserProfileUpdateInput, UserProfileUpdateResponse, UserProfilesResponse, UserServiceConfig } from '../common/types';
|
|
6
|
+
export interface IUserServiceClient {
|
|
7
|
+
isDirectSignInConfigured(): Promise<boolean>;
|
|
8
|
+
signInWithCredentials(signInRequest: SignInRequest): Promise<SignInResponse>;
|
|
9
|
+
initiateUserSignUp(userSignUpRequest: Omit<InitiateEndUserSignUpInput, 'oAuthClientId'>): Promise<UserSignUpResponse>;
|
|
10
|
+
checkUserSignUpOTP(checkUserSignUpOtpRequest: CheckEndUserSignUpOtpInput): Promise<CheckUserSignUpOtpResponse>;
|
|
11
|
+
completeUserSignUp(completeUserSignUpRequest: CompleteEndUserSignUpInput): Promise<CompleteUserSignUpResponse>;
|
|
12
|
+
initiateResetPassword(email: string, customData?: Record<string, unknown>): Promise<InitiatePasswordResetResponse>;
|
|
13
|
+
checkResetPasswordOTP(checkPasswordResetOtpRequest: CheckEndUserPasswordResetOtpInput): Promise<CheckPasswordResetOtpResponse>;
|
|
14
|
+
completeResetPassword(completePasswordResetRequest: CompleteEndUserPasswordResetInput): Promise<CompletePasswordResetResponse>;
|
|
15
|
+
getToken(): Promise<TokenResponse>;
|
|
16
|
+
addTokenChangedHandler(callback: TokenChangedCallback): void;
|
|
17
|
+
removeTokenChangedHandler(callback: TokenChangedCallback): void;
|
|
18
|
+
getIdpConfigurations(): Promise<IdpConfiguration[]>;
|
|
19
|
+
logoutUser(): Promise<boolean>;
|
|
20
|
+
setActiveProfile(endUserAccessToken: string, profileId: string): Promise<UserProfileActivateResponse>;
|
|
21
|
+
getUserProfile(endUserAccessToken: string, profileId: string): Promise<UserProfileResponse>;
|
|
22
|
+
getUserProfiles(endUserAccessToken: string): Promise<UserProfilesResponse>;
|
|
23
|
+
createUserProfile(endUserAccessToken: string, displayName: string, profilePictureUrl?: string): Promise<UserProfileCreateResponse>;
|
|
24
|
+
updateUserProfile(endUserAccessToken: string, userProfileToUpdate: UserProfileUpdateInput): Promise<UserProfileUpdateResponse>;
|
|
25
|
+
deleteUserProfile(endUserAccessToken: string, userProfileId: string): Promise<UserProfileDeleteResponse>;
|
|
26
|
+
authenticateEndUserApplication(authenticateEndUserApplicationRequest: AuthenticateEndUserApplicationInput): Promise<AuthenticateEndUserApplicationResponse>;
|
|
27
|
+
decryptNativeCookie(encryptedCookie: string, key: string): Promise<DecryptNativeCookieResponse>;
|
|
28
|
+
getAuthUrl(idpConnectionId: string, redirectUrl: string): URL;
|
|
29
|
+
getNativeAuthUrl(idpConnectionId: string, redirectUri: string, encryptionKey: string): URL;
|
|
30
|
+
}
|
|
31
|
+
export declare class UserServiceClient implements IUserServiceClient {
|
|
32
|
+
private userAuthConfig;
|
|
33
|
+
private userServiceConfig;
|
|
34
|
+
private tokenRenewalMethod;
|
|
35
|
+
private _tokenChangedHandlers;
|
|
36
|
+
private _tokenResponse;
|
|
37
|
+
private _signInWithCredentialsEndpointResponse;
|
|
38
|
+
private _axAuthIdpConfig;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a user service client. For performance reasons there should only be a single client instance created by an application
|
|
41
|
+
* @param userAuthConfig Configuration values for the user service auth API
|
|
42
|
+
* @param userServiceConfig Configuration values for the user service API
|
|
43
|
+
* @param tokenRenewalMethod Token renewal method to use
|
|
44
|
+
*/
|
|
45
|
+
constructor(userAuthConfig: UserAuthConfig, userServiceConfig: UserServiceConfig, tokenRenewalMethod?: TokenRenewalMethod);
|
|
46
|
+
private get tokenResponse();
|
|
47
|
+
private set tokenResponse(value);
|
|
48
|
+
private emitTokenChanged;
|
|
49
|
+
private getAxAuthIdpConfig;
|
|
50
|
+
private getSignInWithCredentialsEndpoints;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a new token by invoking the User API
|
|
53
|
+
*/
|
|
54
|
+
private fetchToken;
|
|
55
|
+
private _recursiveRefreshActive;
|
|
56
|
+
/**
|
|
57
|
+
* Renews the token pre-emptively by recursively refreshing the cached token just before it's expiry
|
|
58
|
+
*/
|
|
59
|
+
private recursivelyRefreshToken;
|
|
60
|
+
/**
|
|
61
|
+
* A utility function which can be used to determine if there exists an `AxAuth` IDP configured for the Mosaic application.
|
|
62
|
+
* Based on the outcome of this function, an end-user application can conditionally offer the option to Sign-In directly
|
|
63
|
+
* via email & password.
|
|
64
|
+
*
|
|
65
|
+
* @see {@link signInWithCredentials}
|
|
66
|
+
*
|
|
67
|
+
* @returns a boolean indicating if the Mosaic application has an AxAuth IDP provider configured and it is enabled.
|
|
68
|
+
*/
|
|
69
|
+
isDirectSignInConfigured: () => Promise<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Starts a SignInWithCredentials flow using the AX_AUTH IDP configured for the application.
|
|
72
|
+
*
|
|
73
|
+
* @param signInRequest
|
|
74
|
+
* @returns `SignInResponse`
|
|
75
|
+
*/
|
|
76
|
+
signInWithCredentials: (signInRequest: SignInRequest) => Promise<SignInResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Registers a new user in the AX_AUTH IDP configured for the application.
|
|
79
|
+
*
|
|
80
|
+
* @param userSignUpRequest
|
|
81
|
+
* @returns `UserSignUpResponse`
|
|
82
|
+
*/
|
|
83
|
+
initiateUserSignUp: (userSignUpRequest: Omit<InitiateEndUserSignUpInput, 'oAuthClientId'>) => Promise<UserSignUpResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if a given User Sign-Up OTP Code is valid
|
|
86
|
+
*
|
|
87
|
+
* @param checkUserSignUpOtpRequest
|
|
88
|
+
* @returns `CheckUserSignUpOtpResponse`
|
|
89
|
+
*/
|
|
90
|
+
checkUserSignUpOTP: (checkUserSignUpOtpRequest: CheckEndUserSignUpOtpInput) => Promise<CheckUserSignUpOtpResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Completes a user sign up process using the AX_AUTH IDP.
|
|
93
|
+
* The user needs to input the OTP along with a password (if not provided earlier) to finish the process.
|
|
94
|
+
*
|
|
95
|
+
* @param originUrl
|
|
96
|
+
* @param completeUserSignUpRequest
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
completeUserSignUp: (completeUserSignUpRequest: CompleteEndUserSignUpInput) => Promise<CompleteUserSignUpResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Starts the process of resetting a password for a user registered using the AX_AUTH IDP.
|
|
102
|
+
* This will initiate the call to the webhook configured in AX_AUTH to send the generated OTP
|
|
103
|
+
* to the user.
|
|
104
|
+
*
|
|
105
|
+
* @param email
|
|
106
|
+
* @param customData An optional arbitrary JSON object. When used, this customData will be submitted to the Forgot Password Webhook via the HTTP POST request body, and can be used to transfer some needed context to the Webhook.
|
|
107
|
+
* @returns `InitiatePasswordResetResponse`
|
|
108
|
+
*/
|
|
109
|
+
initiateResetPassword: (email: string, customData?: Record<string, unknown>) => Promise<InitiatePasswordResetResponse>;
|
|
110
|
+
/**
|
|
111
|
+
* Checks if a given Reset Password OTP Code is valid
|
|
112
|
+
*
|
|
113
|
+
* @param checkPasswordResetOtpRequest
|
|
114
|
+
* @returns `CheckPasswordResetOtpResponse`
|
|
115
|
+
*/
|
|
116
|
+
checkResetPasswordOTP: (checkPasswordResetOtpRequest: CheckEndUserPasswordResetOtpInput) => Promise<CheckPasswordResetOtpResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Completes the password reset flow for a user registered using the AX_AUTH IDP.
|
|
119
|
+
* The user needs to input the OTP along with a new password to finish the process.
|
|
120
|
+
*
|
|
121
|
+
* @param completePasswordResetRequest
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
completeResetPassword: (completePasswordResetRequest: CompleteEndUserPasswordResetInput) => Promise<CompletePasswordResetResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Returns a token. The method will ensure to avoid unnecessary API calls by caching valid tokens.
|
|
127
|
+
*
|
|
128
|
+
* It is not recommended to remember the token for later use.
|
|
129
|
+
* When in need of a token, please call this method to get a new token.
|
|
130
|
+
*/
|
|
131
|
+
getToken: () => Promise<TokenResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* Adds an event handler that will be invoked whenever a new token response is loaded from the backend
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
addTokenChangedHandler: (callback: TokenChangedCallback) => void;
|
|
137
|
+
/**
|
|
138
|
+
* Removes an event handler for the TokenChanged event
|
|
139
|
+
*/
|
|
140
|
+
removeTokenChangedHandler: (callback: TokenChangedCallback) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Returns an array of IDP Configurations that are configured for the application
|
|
143
|
+
* This list will exclude connections for provider id AX_AUTH as it is used for a user sign-up and SignInWithCredentials flows.
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
getIdpConfigurations: () => Promise<IdpConfiguration[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Logs out the user
|
|
149
|
+
*/
|
|
150
|
+
logoutUser: () => Promise<boolean>;
|
|
151
|
+
/**
|
|
152
|
+
* Sets a given Profile ID as the active profile
|
|
153
|
+
*/
|
|
154
|
+
setActiveProfile: (endUserAccessToken: string, profileId: string) => Promise<UserProfileActivateResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* Returns a user profile
|
|
157
|
+
*/
|
|
158
|
+
getUserProfile: (endUserAccessToken: string, profileId: string) => Promise<UserProfileResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Returns an array of all user profiles
|
|
161
|
+
*/
|
|
162
|
+
getUserProfiles: (endUserAccessToken: string) => Promise<UserProfilesResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* Creates a new user profile
|
|
165
|
+
*/
|
|
166
|
+
createUserProfile: (endUserAccessToken: string, displayName: string, profilePictureUrl: string) => Promise<UserProfileCreateResponse>;
|
|
167
|
+
/**
|
|
168
|
+
* Updates a user profile
|
|
169
|
+
* @param userProfileToUpdate User Profile object with required updates. This should be based on the current user profile object, with the required changes done on top of it.
|
|
170
|
+
*/
|
|
171
|
+
updateUserProfile: (endUserAccessToken: string, userProfileToUpdate: UserProfileUpdateInput) => Promise<UserProfileUpdateResponse>;
|
|
172
|
+
/**
|
|
173
|
+
* Deletes a user profile
|
|
174
|
+
*/
|
|
175
|
+
deleteUserProfile: (endUserAccessToken: string, userProfileId: string) => Promise<UserProfileDeleteResponse>;
|
|
176
|
+
/**
|
|
177
|
+
* Authenticate an end-user application and receive an Application Token
|
|
178
|
+
* @param authenticateEndUserApplicationRequest an object containing the tenantId/environmentId/applicationId/applicationKey info.
|
|
179
|
+
* @returns AuthenticateEndUserApplicationResponse
|
|
180
|
+
*/
|
|
181
|
+
authenticateEndUserApplication: (authenticateEndUserApplicationRequest: AuthenticateEndUserApplicationInput) => Promise<AuthenticateEndUserApplicationResponse>;
|
|
182
|
+
/**
|
|
183
|
+
* Decrypt an User Token Cookie used in Native Apps.
|
|
184
|
+
* @param encryptedCookie
|
|
185
|
+
* @param key
|
|
186
|
+
* @returns
|
|
187
|
+
*/
|
|
188
|
+
decryptNativeCookie: (encryptedCookie: string, key: string) => Promise<DecryptNativeCookieResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* Returns the authentication URL for web based applications.
|
|
191
|
+
*
|
|
192
|
+
* @param idpConnectionId The ID of the User Service IDP Connection used for authentication.
|
|
193
|
+
* @param returnUrl Redirect URL which the IDP will redirect to after the authentication flow is finished.
|
|
194
|
+
* @returns a URL object with the Authentication URL
|
|
195
|
+
*/
|
|
196
|
+
getAuthUrl: (idpConnectionId: string, returnUrl: string) => URL;
|
|
197
|
+
/**
|
|
198
|
+
* Returns the authentication URL for native applications.
|
|
199
|
+
*
|
|
200
|
+
* @param idpConnectionId The ID of the User Service IDP Connection used for authentication.
|
|
201
|
+
* @param returnUrl Redirect URL which the IDP will redirect to after the authentication flow is finished.
|
|
202
|
+
* @param encryptionKey A hex string with the length of 32 bytes that is used as the encryption key to encrypt the authorization Cookie.
|
|
203
|
+
* @returns a URL object with the Authentication URL
|
|
204
|
+
*/
|
|
205
|
+
getNativeAuthUrl: (idpConnectionId: string, returnUrl: string, encryptionKey: string) => URL;
|
|
206
|
+
}
|
|
207
207
|
//# sourceMappingURL=UserServiceClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserServiceClient.d.ts","sourceRoot":"","sources":["../../src/UserServiceClient/UserServiceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAC7B,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAE1B,2BAA2B,EAC3B,gBAAgB,EAChB,6BAA6B,EAE7B,cAAc,EAGd,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AAEtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,sCAAsC,EACtC,aAAa,EAEb,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"UserServiceClient.d.ts","sourceRoot":"","sources":["../../src/UserServiceClient/UserServiceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAC7B,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAE1B,2BAA2B,EAC3B,gBAAgB,EAChB,6BAA6B,EAE7B,cAAc,EAGd,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mCAAmC,EAAE,MAAM,iDAAiD,CAAC;AAEtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,sCAAsC,EACtC,aAAa,EAEb,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAkBzB,MAAM,WAAW,kBAAkB;IACjC,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7C,qBAAqB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE7E,kBAAkB,CAChB,iBAAiB,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,GACnE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/B,kBAAkB,CAChB,yBAAyB,EAAE,0BAA0B,GACpD,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,kBAAkB,CAChB,yBAAyB,EAAE,0BAA0B,GACpD,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAA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;IACH,8BAA8B,0CACW,mCAAmC,KACzE,QAAQ,sCAAsC,CAAC,CAKhD;IAEF;;;;;OAKG;IACH,mBAAmB,oBACA,MAAM,OAClB,MAAM,KACV,QAAQ,2BAA2B,CAAC,CAMrC;IAEF;;;;;;OAMG;IACH,UAAU,oBAAqB,MAAM,aAAa,MAAM,KAAG,GAAG,CAE5D;IAEF;;;;;;;OAOG;IACH,gBAAgB,oBACG,MAAM,aACZ,MAAM,iBACF,MAAM,KACpB,GAAG,CAQJ;CACH"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare const UserServiceContext: React.Context<IUserServiceClient | null>;
|
|
6
|
-
export interface UserServiceProviderProps {
|
|
7
|
-
/**
|
|
8
|
-
* Configuration values for the user service auth API
|
|
9
|
-
*/
|
|
10
|
-
userAuthConfig: UserAuthConfig;
|
|
11
|
-
/**
|
|
12
|
-
* Configuration values for the user service API
|
|
13
|
-
*/
|
|
14
|
-
userServiceConfig: UserServiceConfig;
|
|
15
|
-
/**
|
|
16
|
-
* Token renewal method to use. Tokens can be renewed pre-emptively or on demand. Default token renewal method is on demand.
|
|
17
|
-
*/
|
|
18
|
-
tokenRenewalMethod?: TokenRenewalMethod;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Provides the User Service Client that can be retrieved using the `useUserService` hook
|
|
22
|
-
*/
|
|
23
|
-
export declare const UserServiceProvider: React.FC<React.PropsWithChildren<UserServiceProviderProps>>;
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves the User Service Client
|
|
26
|
-
*/
|
|
27
|
-
export declare const useUserService: () => IUserServiceClient;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IUserServiceClient } from '../UserServiceClient/UserServiceClient';
|
|
3
|
+
import { TokenRenewalMethod } from '../common/enums';
|
|
4
|
+
import { UserAuthConfig, UserServiceConfig } from '../common/types';
|
|
5
|
+
export declare const UserServiceContext: React.Context<IUserServiceClient | null>;
|
|
6
|
+
export interface UserServiceProviderProps {
|
|
7
|
+
/**
|
|
8
|
+
* Configuration values for the user service auth API
|
|
9
|
+
*/
|
|
10
|
+
userAuthConfig: UserAuthConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Configuration values for the user service API
|
|
13
|
+
*/
|
|
14
|
+
userServiceConfig: UserServiceConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Token renewal method to use. Tokens can be renewed pre-emptively or on demand. Default token renewal method is on demand.
|
|
17
|
+
*/
|
|
18
|
+
tokenRenewalMethod?: TokenRenewalMethod;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Provides the User Service Client that can be retrieved using the `useUserService` hook
|
|
22
|
+
*/
|
|
23
|
+
export declare const UserServiceProvider: React.FC<React.PropsWithChildren<UserServiceProviderProps>>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the User Service Client
|
|
26
|
+
*/
|
|
27
|
+
export declare const useUserService: () => IUserServiceClient;
|
|
28
28
|
//# sourceMappingURL=UserServiceProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserServiceProvider.d.ts","sourceRoot":"","sources":["../../src/UserServiceProvider/UserServiceProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"UserServiceProvider.d.ts","sourceRoot":"","sources":["../../src/UserServiceProvider/UserServiceProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAEnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,eAAO,MAAM,kBAAkB,0CAE9B,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CACxC,KAAK,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,CAkBlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,QAAO,kBAUjC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class mimicking the minimal structure of a MosaicError.
|
|
3
|
-
* This class is defined here to avoid the @axinom/service-common dependency.
|
|
4
|
-
*/
|
|
5
|
-
export declare class UserAuthError extends Error {
|
|
6
|
-
code: string;
|
|
7
|
-
constructor(message: string | undefined, code: string);
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Type assertion function that throws an error if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.
|
|
11
|
-
* This is a copy of assertError() in @axinom/service-common to avoid dependencies.
|
|
12
|
-
*/
|
|
13
|
-
export declare const assertError: (error: unknown) => asserts error is Error;
|
|
1
|
+
/**
|
|
2
|
+
* Class mimicking the minimal structure of a MosaicError.
|
|
3
|
+
* This class is defined here to avoid the @axinom/service-common dependency.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UserAuthError extends Error {
|
|
6
|
+
code: string;
|
|
7
|
+
constructor(message: string | undefined, code: string);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Type assertion function that throws an error if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.
|
|
11
|
+
* This is a copy of assertError() in @axinom/service-common to avoid dependencies.
|
|
12
|
+
*/
|
|
13
|
+
export declare const assertError: (error: unknown) => asserts error is Error;
|
|
14
14
|
//# sourceMappingURL=assertError.d.ts.map
|
package/dist/common/enums.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare enum TokenRenewalMethod {
|
|
2
|
-
/**
|
|
3
|
-
* The token is continuously renewed just before expiry.
|
|
4
|
-
* A `TokenChangedCallback` can be registered using `addTokenChangedHandler` method to get notified when the token changes.
|
|
5
|
-
*/
|
|
6
|
-
PRE_EMPTIVE = 0,
|
|
7
|
-
/**
|
|
8
|
-
* The token is renewed only if needed upon calling `getToken` method.
|
|
9
|
-
*/
|
|
10
|
-
ON_DEMAND = 1
|
|
11
|
-
}
|
|
1
|
+
export declare enum TokenRenewalMethod {
|
|
2
|
+
/**
|
|
3
|
+
* The token is continuously renewed just before expiry.
|
|
4
|
+
* A `TokenChangedCallback` can be registered using `addTokenChangedHandler` method to get notified when the token changes.
|
|
5
|
+
*/
|
|
6
|
+
PRE_EMPTIVE = 0,
|
|
7
|
+
/**
|
|
8
|
+
* The token is renewed only if needed upon calling `getToken` method.
|
|
9
|
+
*/
|
|
10
|
+
ON_DEMAND = 1
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
-
/**
|
|
3
|
-
* Takes a GQL DocumentNode and a set of variables
|
|
4
|
-
* and compiles the body for a GQL request, stringifies and returns.
|
|
5
|
-
*
|
|
6
|
-
* @param gqlDocument
|
|
7
|
-
* @param variables
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare const stringifyGqlQuery: <TResult, TVariables>(gqlDocument: DocumentNode<TResult, TVariables>, variables?: Record<string, unknown>) => string;
|
|
1
|
+
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
/**
|
|
3
|
+
* Takes a GQL DocumentNode and a set of variables
|
|
4
|
+
* and compiles the body for a GQL request, stringifies and returns.
|
|
5
|
+
*
|
|
6
|
+
* @param gqlDocument
|
|
7
|
+
* @param variables
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const stringifyGqlQuery: <TResult, TVariables>(gqlDocument: DocumentNode<TResult, TVariables>, variables?: Record<string, unknown>) => string;
|
|
11
11
|
//# sourceMappingURL=stringify-gql-query.d.ts.map
|