@frontegg/rest-api 3.0.52 → 3.0.54

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/auth/enums.d.ts CHANGED
@@ -4,7 +4,8 @@ export declare enum SocialLoginProviders {
4
4
  Google = "google",
5
5
  Github = "github",
6
6
  Slack = "slack",
7
- Apple = "apple"
7
+ Apple = "apple",
8
+ Linkedin = "linkedin"
8
9
  }
9
10
  export declare enum AuthStrategyEnum {
10
11
  EmailAndPassword = "EmailAndPassword",
package/auth/enums.js CHANGED
@@ -7,6 +7,7 @@ export let SocialLoginProviders;
7
7
  SocialLoginProviders["Github"] = "github";
8
8
  SocialLoginProviders["Slack"] = "slack";
9
9
  SocialLoginProviders["Apple"] = "apple";
10
+ SocialLoginProviders["Linkedin"] = "linkedin";
10
11
  })(SocialLoginProviders || (SocialLoginProviders = {}));
11
12
 
12
13
  export let AuthStrategyEnum;
package/auth/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './secutiry-poilicy';
2
2
  export * from './enums';
3
3
  import { ISamlRolesGroup } from '../teams/interfaces';
4
- import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse } from "./interfaces";
4
+ import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout } from "./interfaces";
5
5
  /*****************************************
6
6
  * Authentication
7
7
  *****************************************/
@@ -94,6 +94,10 @@ export declare function refreshTokenV2(): Promise<ILoginResponseV2>;
94
94
  * logout from server, invalidate access and refresh token, remove it from cookies.
95
95
  */
96
96
  export declare function logout(): Promise<void>;
97
+ /**
98
+ * logout from server on Hosted Login, invalidate access and refresh token, remove it from cookies.
99
+ */
100
+ export declare function OAuthLogout(params?: IOAuthLogout): Promise<void>;
97
101
  /**
98
102
  * calling forgot password request will send email with link to reset user's password.
99
103
  *
@@ -367,7 +371,7 @@ export declare function getSocialLoginProvidersV2(): Promise<ISocialLoginProvide
367
371
  * Login using social login
368
372
  * @return cookie with refresh token
369
373
  */
370
- export declare function loginViaSocialLogin({ provider, code, redirectUri, codeVerifier, metadata, invitationToken, state, }: ILoginViaSocialLogin): Promise<ILoginViaSocialLoginResponse>;
374
+ export declare function loginViaSocialLogin({ provider, code, idToken, redirectUri, codeVerifier, metadata, invitationToken, state, }: ILoginViaSocialLogin): Promise<ILoginViaSocialLoginResponse>;
371
375
  /**
372
376
  * Get vendor secure access configuration
373
377
  */
package/auth/index.js CHANGED
@@ -113,6 +113,9 @@ export async function refreshTokenV2() {
113
113
  export async function logout() {
114
114
  return Post(`${urls.identity.auth.v1}/logout`);
115
115
  }
116
+ export async function OAuthLogout(params) {
117
+ return Get(`${urls.oauth.v1}/logout`, params);
118
+ }
116
119
  export async function forgotPassword(body) {
117
120
  return Post(`${urls.identity.users.v1}/passwords/reset`, body);
118
121
  }
@@ -270,15 +273,22 @@ export async function getSocialLoginProvidersV2() {
270
273
  export async function loginViaSocialLogin({
271
274
  provider,
272
275
  code,
276
+ idToken,
273
277
  redirectUri,
274
278
  codeVerifier,
275
279
  metadata,
276
280
  invitationToken,
277
281
  state
278
282
  }) {
279
- const params = {
280
- code
281
- };
283
+ const params = {};
284
+
285
+ if (code) {
286
+ params.code = code;
287
+ }
288
+
289
+ if (idToken) {
290
+ params.id_token = idToken;
291
+ }
282
292
 
283
293
  if (redirectUri) {
284
294
  params.redirectUri = redirectUri;
@@ -148,7 +148,8 @@ export interface ISocialLoginProviderConfigurationV2 {
148
148
  customised: boolean;
149
149
  }
150
150
  export interface ILoginViaSocialLogin {
151
- code: string;
151
+ code?: string;
152
+ idToken?: string;
152
153
  redirectUri?: string;
153
154
  provider: SocialLoginProviders;
154
155
  afterAuthRedirectUrl?: string;
@@ -345,6 +346,11 @@ export interface IOAuthTokenResponse {
345
346
  id_token: string;
346
347
  refresh_token: string;
347
348
  }
349
+ export interface IOAuthLogout {
350
+ id_token_hint?: string;
351
+ post_logout_redirect_uri?: string;
352
+ state?: string;
353
+ }
348
354
  export declare type IUpdateSSOConfiguration = Partial<Omit<ISSOConfiguration, "id" | "createdAt" | "updatedAt" | "domains">>;
349
355
  export interface IResetPhoneNumber {
350
356
  email: string;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.52
1
+ /** @license Frontegg v3.0.54
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -14,6 +14,7 @@ exports.SocialLoginProviders = SocialLoginProviders;
14
14
  SocialLoginProviders["Github"] = "github";
15
15
  SocialLoginProviders["Slack"] = "slack";
16
16
  SocialLoginProviders["Apple"] = "apple";
17
+ SocialLoginProviders["Linkedin"] = "linkedin";
17
18
  })(SocialLoginProviders || (exports.SocialLoginProviders = SocialLoginProviders = {}));
18
19
 
19
20
  let AuthStrategyEnum;
@@ -23,6 +23,7 @@ var _exportNames = {
23
23
  refreshToken: true,
24
24
  refreshTokenV2: true,
25
25
  logout: true,
26
+ OAuthLogout: true,
26
27
  forgotPassword: true,
27
28
  resetPassword: true,
28
29
  loadPasswordConfig: true,
@@ -120,6 +121,7 @@ var _exportNames = {
120
121
  getVendorPublicAuthStrategiesConfig: true,
121
122
  getMFAStrategiesConfig: true
122
123
  };
124
+ exports.OAuthLogout = OAuthLogout;
123
125
  exports.acceptInvitation = acceptInvitation;
124
126
  exports.activateAccount = activateAccount;
125
127
  exports.changePhoneNumber = changePhoneNumber;
@@ -403,6 +405,10 @@ async function logout() {
403
405
  return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/logout`);
404
406
  }
405
407
 
408
+ async function OAuthLogout(params) {
409
+ return (0, _fetch.Get)(`${_constants.urls.oauth.v1}/logout`, params);
410
+ }
411
+
406
412
  async function forgotPassword(body) {
407
413
  return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/passwords/reset`, body);
408
414
  }
@@ -605,15 +611,22 @@ async function getSocialLoginProvidersV2() {
605
611
  async function loginViaSocialLogin({
606
612
  provider,
607
613
  code,
614
+ idToken,
608
615
  redirectUri,
609
616
  codeVerifier,
610
617
  metadata,
611
618
  invitationToken,
612
619
  state
613
620
  }) {
614
- const params = {
615
- code
616
- };
621
+ const params = {};
622
+
623
+ if (code) {
624
+ params.code = code;
625
+ }
626
+
627
+ if (idToken) {
628
+ params.id_token = idToken;
629
+ }
617
630
 
618
631
  if (redirectUri) {
619
632
  params.redirectUri = redirectUri;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.52
1
+ /** @license Frontegg v3.0.54
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.52",
3
+ "version": "3.0.54",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {