@frontegg/rest-api 7.74.0-alpha.0 → 7.74.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.
- package/auth/index.js +1 -10
- package/auth/interfaces.d.ts +3 -8
- package/index.js +1 -1
- package/node/auth/index.js +1 -9
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/index.js
CHANGED
|
@@ -17,7 +17,6 @@ import { BaseApiClient } from '../BaseApiClient';
|
|
|
17
17
|
import { EntitlementsApi } from '../entitlements';
|
|
18
18
|
import { ContextHolder } from '../ContextHolder';
|
|
19
19
|
import { SecurityPolicyApi } from './secutiry-poilicy';
|
|
20
|
-
import { AuthStrategyEnum } from './enums';
|
|
21
20
|
export class AuthenticationApi extends BaseApiClient {
|
|
22
21
|
constructor(appName) {
|
|
23
22
|
super(appName);
|
|
@@ -563,19 +562,11 @@ export class AuthenticationApi extends BaseApiClient {
|
|
|
563
562
|
});
|
|
564
563
|
};
|
|
565
564
|
this.passwordlessPreLogin = async _ref => {
|
|
566
|
-
var _usernameToTypeMapper;
|
|
567
565
|
let {
|
|
568
566
|
type
|
|
569
567
|
} = _ref,
|
|
570
568
|
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
571
|
-
|
|
572
|
-
[AuthStrategyEnum.UsernameAndCode]: AuthStrategyEnum.Code,
|
|
573
|
-
[AuthStrategyEnum.UsernameAndMagicLink]: AuthStrategyEnum.MagicLink,
|
|
574
|
-
[AuthStrategyEnum.UsernameAndSms]: AuthStrategyEnum.SmsCode,
|
|
575
|
-
[AuthStrategyEnum.UsernameAndPassword]: AuthStrategyEnum.EmailAndPassword
|
|
576
|
-
};
|
|
577
|
-
const mappedType = ((_usernameToTypeMapper = usernameToTypeMapper[type]) == null ? void 0 : _usernameToTypeMapper.toLowerCase()) || type.toLowerCase();
|
|
578
|
-
return this.post(`${urls.identity.auth.v1}/passwordless/${mappedType}/prelogin`, body);
|
|
569
|
+
return this.post(`${urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
|
|
579
570
|
};
|
|
580
571
|
this.passwordlessPostLoginV2 = async _ref2 => {
|
|
581
572
|
let {
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { AuthStrategyEnum, MachineToMachineAuthStrategy, SignUpStrategyEnum, Soc
|
|
|
4
4
|
import { ISamlRolesGroup } from '../teams/interfaces';
|
|
5
5
|
export * from './secutiry-poilicy/interfaces';
|
|
6
6
|
export type IPreLogin = {
|
|
7
|
-
email
|
|
8
|
-
username?: string;
|
|
7
|
+
email: string;
|
|
9
8
|
tenantId?: string;
|
|
10
9
|
};
|
|
11
10
|
export type IPostLogin = {
|
|
@@ -27,8 +26,7 @@ export type IOidcPostLoginV2 = {
|
|
|
27
26
|
redirectUri?: string;
|
|
28
27
|
};
|
|
29
28
|
export type ILogin = {
|
|
30
|
-
email
|
|
31
|
-
username?: string;
|
|
29
|
+
email: string;
|
|
32
30
|
password: string;
|
|
33
31
|
recaptchaToken?: string;
|
|
34
32
|
invitationToken?: string;
|
|
@@ -393,16 +391,13 @@ export interface IBasePasswordlessPreLogin {
|
|
|
393
391
|
export interface IEmailPasswordlessPreLogin extends IBasePasswordlessPreLogin {
|
|
394
392
|
email: string;
|
|
395
393
|
}
|
|
396
|
-
export interface IUsernamePasswordlessPreLogin extends IBasePasswordlessPreLogin {
|
|
397
|
-
username: string;
|
|
398
|
-
}
|
|
399
394
|
export interface IUserIDPasswordlessPreLogin extends IBasePasswordlessPreLogin {
|
|
400
395
|
userId: string;
|
|
401
396
|
}
|
|
402
397
|
export interface IPhoneNumberPasswordlessPreLogin extends IBasePasswordlessPreLogin {
|
|
403
398
|
phoneNumber: string;
|
|
404
399
|
}
|
|
405
|
-
export type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin |
|
|
400
|
+
export type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin | IPhoneNumberPasswordlessPreLogin;
|
|
406
401
|
export interface IPasswordlessPostLogin {
|
|
407
402
|
token: string;
|
|
408
403
|
recaptchaToken?: string;
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -628,19 +628,11 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
|
|
|
628
628
|
});
|
|
629
629
|
};
|
|
630
630
|
this.passwordlessPreLogin = async _ref => {
|
|
631
|
-
var _usernameToTypeMapper;
|
|
632
631
|
let {
|
|
633
632
|
type
|
|
634
633
|
} = _ref,
|
|
635
634
|
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
636
|
-
|
|
637
|
-
[_enums.AuthStrategyEnum.UsernameAndCode]: _enums.AuthStrategyEnum.Code,
|
|
638
|
-
[_enums.AuthStrategyEnum.UsernameAndMagicLink]: _enums.AuthStrategyEnum.MagicLink,
|
|
639
|
-
[_enums.AuthStrategyEnum.UsernameAndSms]: _enums.AuthStrategyEnum.SmsCode,
|
|
640
|
-
[_enums.AuthStrategyEnum.UsernameAndPassword]: _enums.AuthStrategyEnum.EmailAndPassword
|
|
641
|
-
};
|
|
642
|
-
const mappedType = ((_usernameToTypeMapper = usernameToTypeMapper[type]) == null ? void 0 : _usernameToTypeMapper.toLowerCase()) || type.toLowerCase();
|
|
643
|
-
return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${mappedType}/prelogin`, body);
|
|
635
|
+
return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
|
|
644
636
|
};
|
|
645
637
|
this.passwordlessPostLoginV2 = async _ref2 => {
|
|
646
638
|
let {
|
package/node/index.js
CHANGED