@frontegg/rest-api 7.82.0 → 7.83.0-alpha.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/enums.d.ts CHANGED
@@ -25,7 +25,8 @@ export declare enum MachineToMachineAuthStrategy {
25
25
  }
26
26
  export declare enum SignUpStrategyEnum {
27
27
  Email = "email",
28
- PhoneNumber = "phoneNumber"
28
+ PhoneNumber = "phoneNumber",
29
+ Username = "username"
29
30
  }
30
31
  export declare enum EIdentifierType {
31
32
  email = "email",
package/auth/enums.js CHANGED
@@ -30,6 +30,7 @@ export let SignUpStrategyEnum;
30
30
  (function (SignUpStrategyEnum) {
31
31
  SignUpStrategyEnum["Email"] = "email";
32
32
  SignUpStrategyEnum["PhoneNumber"] = "phoneNumber";
33
+ SignUpStrategyEnum["Username"] = "username";
33
34
  })(SignUpStrategyEnum || (SignUpStrategyEnum = {}));
34
35
  export let EIdentifierType;
35
36
  (function (EIdentifierType) {
package/auth/index.d.ts CHANGED
@@ -485,6 +485,7 @@ export declare class AuthenticationApi extends BaseApiClient {
485
485
  * Get vendor secure access configuration.
486
486
  */
487
487
  getVendorConfig: () => Promise<IVendorConfig>;
488
+ private signUp;
488
489
  /**
489
490
  * Sign up a new user and create a new tenant.
490
491
  *
@@ -497,6 +498,12 @@ export declare class AuthenticationApi extends BaseApiClient {
497
498
  * @param body - The sign-up data
498
499
  */
499
500
  signUpUserWithPhoneNumber: (body: ISignUpUser) => Promise<ISignUpResponse>;
501
+ /**
502
+ * Sign up a new user and create a new tenant.
503
+ *
504
+ * @param body - The sign-up data
505
+ */
506
+ signUpUserWithUsername: (body: ISignUpUser) => Promise<ISignUpResponse>;
500
507
  /**
501
508
  * Get all current user active sessions.
502
509
  */
package/auth/index.js CHANGED
@@ -439,14 +439,14 @@ export class AuthenticationApi extends BaseApiClient {
439
439
  this.getVendorConfig = async () => {
440
440
  return this.get(`${urls.identity.configurations.v1}/public`);
441
441
  };
442
- this.signUpUser = async body => {
442
+ this.signUp = async (signUpUrl, body) => {
443
443
  const {
444
444
  shouldActivate,
445
445
  authResponse,
446
446
  userId,
447
447
  tenantId,
448
448
  activationToken
449
- } = await this.post(`${urls.identity.users.v1}/signUp`, body);
449
+ } = await this.post(signUpUrl, body);
450
450
  const response = {
451
451
  shouldActivate,
452
452
  userId,
@@ -468,34 +468,14 @@ export class AuthenticationApi extends BaseApiClient {
468
468
  activationToken
469
469
  });
470
470
  };
471
+ this.signUpUser = async body => {
472
+ return this.signUp(`${urls.identity.users.v1}/signUp`, body);
473
+ };
471
474
  this.signUpUserWithPhoneNumber = async body => {
472
- const {
473
- shouldActivate,
474
- authResponse,
475
- userId,
476
- tenantId,
477
- activationToken
478
- } = await this.post(`${urls.identity.users.v1}/signUp/phoneNumber`, body);
479
- const response = {
480
- shouldActivate,
481
- userId,
482
- tenantId
483
- };
484
- if (!shouldActivate && authResponse) {
485
- const {
486
- user,
487
- tenants,
488
- activeTenant
489
- } = await this.generateLoginResponseV3(authResponse);
490
- return _extends({}, response, {
491
- user,
492
- tenants,
493
- activeTenant
494
- });
495
- }
496
- return _extends({}, response, {
497
- activationToken
498
- });
475
+ return this.signUp(`${urls.identity.users.v1}/signUp/phoneNumber`, body);
476
+ };
477
+ this.signUpUserWithUsername = async body => {
478
+ return this.signUp(`${urls.identity.users.v1}/signUp/username`, body);
499
479
  };
500
480
  this.getCurrentUserSessions = async () => {
501
481
  return this.get(urls.identity.users.sessions.currentUser.v1);
@@ -256,6 +256,7 @@ export interface ISignUpUser {
256
256
  metadata?: string /** JSON */;
257
257
  roleIds?: string[];
258
258
  invitationToken?: string;
259
+ username?: string;
259
260
  }
260
261
  export interface ISignUpResponse {
261
262
  shouldActivate: boolean;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.82.0
1
+ /** @license Frontegg v7.83.0-alpha.0
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.
@@ -40,6 +40,7 @@ exports.SignUpStrategyEnum = SignUpStrategyEnum;
40
40
  (function (SignUpStrategyEnum) {
41
41
  SignUpStrategyEnum["Email"] = "email";
42
42
  SignUpStrategyEnum["PhoneNumber"] = "phoneNumber";
43
+ SignUpStrategyEnum["Username"] = "username";
43
44
  })(SignUpStrategyEnum || (exports.SignUpStrategyEnum = SignUpStrategyEnum = {}));
44
45
  let EIdentifierType;
45
46
  exports.EIdentifierType = EIdentifierType;
@@ -504,14 +504,14 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
504
504
  this.getVendorConfig = async () => {
505
505
  return this.get(`${_constants2.urls.identity.configurations.v1}/public`);
506
506
  };
507
- this.signUpUser = async body => {
507
+ this.signUp = async (signUpUrl, body) => {
508
508
  const {
509
509
  shouldActivate,
510
510
  authResponse,
511
511
  userId,
512
512
  tenantId,
513
513
  activationToken
514
- } = await this.post(`${_constants2.urls.identity.users.v1}/signUp`, body);
514
+ } = await this.post(signUpUrl, body);
515
515
  const response = {
516
516
  shouldActivate,
517
517
  userId,
@@ -533,34 +533,14 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
533
533
  activationToken
534
534
  });
535
535
  };
536
+ this.signUpUser = async body => {
537
+ return this.signUp(`${_constants2.urls.identity.users.v1}/signUp`, body);
538
+ };
536
539
  this.signUpUserWithPhoneNumber = async body => {
537
- const {
538
- shouldActivate,
539
- authResponse,
540
- userId,
541
- tenantId,
542
- activationToken
543
- } = await this.post(`${_constants2.urls.identity.users.v1}/signUp/phoneNumber`, body);
544
- const response = {
545
- shouldActivate,
546
- userId,
547
- tenantId
548
- };
549
- if (!shouldActivate && authResponse) {
550
- const {
551
- user,
552
- tenants,
553
- activeTenant
554
- } = await this.generateLoginResponseV3(authResponse);
555
- return (0, _extends2.default)({}, response, {
556
- user,
557
- tenants,
558
- activeTenant
559
- });
560
- }
561
- return (0, _extends2.default)({}, response, {
562
- activationToken
563
- });
540
+ return this.signUp(`${_constants2.urls.identity.users.v1}/signUp/phoneNumber`, body);
541
+ };
542
+ this.signUpUserWithUsername = async body => {
543
+ return this.signUp(`${_constants2.urls.identity.users.v1}/signUp/username`, body);
564
544
  };
565
545
  this.getCurrentUserSessions = async () => {
566
546
  return this.get(_constants2.urls.identity.users.sessions.currentUser.v1);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.82.0
1
+ /** @license Frontegg v7.83.0-alpha.0
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": "7.82.0",
3
+ "version": "7.83.0-alpha.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",