@frontegg/rest-api 7.75.0-alpha.1 → 7.75.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/index.d.ts CHANGED
@@ -27,6 +27,7 @@ import { SecurityCenterApi } from './security-center';
27
27
  import { PhoneNumbersApi } from './user-phone-numbers';
28
28
  import { ApplicationsApi } from './applications';
29
29
  import { VeloApi } from './velo';
30
+ import { UserEmailPolicyApi } from './users-emails-policy';
30
31
  export * from './interfaces';
31
32
  export * from './auth/interfaces';
32
33
  export * from './auth/enums';
@@ -57,6 +58,7 @@ export * from './security-center/interfaces';
57
58
  export * from './user-phone-numbers/interfaces';
58
59
  export * from './applications/interfaces';
59
60
  export * from './velo/interfaces';
61
+ export * from './users-emails-policy/interfaces';
60
62
  export { GENERIC_ERROR_CODE, GENERIC_ERROR_MESSAGE } from './constants';
61
63
  /**
62
64
  * Frontegg API client for default app
@@ -88,6 +90,7 @@ declare const api: {
88
90
  userPhoneNumbers: PhoneNumbersApi;
89
91
  applications: ApplicationsApi;
90
92
  velo: VeloApi;
93
+ userEmailPolicy: UserEmailPolicyApi;
91
94
  };
92
95
  export type FronteggApiClient = {
93
96
  auth: AuthenticationApi;
@@ -114,6 +117,7 @@ export type FronteggApiClient = {
114
117
  userPhoneNumbers: PhoneNumbersApi;
115
118
  applications: ApplicationsApi;
116
119
  velo: VeloApi;
120
+ userEmailPolicy: UserEmailPolicyApi;
117
121
  };
118
122
  declare const createApiClient: (appName: string) => FronteggApiClient;
119
123
  export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, };
@@ -165,6 +169,7 @@ declare const _default: {
165
169
  userPhoneNumbers: PhoneNumbersApi;
166
170
  applications: ApplicationsApi;
167
171
  velo: VeloApi;
172
+ userEmailPolicy: UserEmailPolicyApi;
168
173
  };
169
174
  createApiClient: (appName: string) => FronteggApiClient;
170
175
  FronteggApiError: typeof FronteggApiError;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.75.0-alpha.1
1
+ /** @license Frontegg v7.75.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.
@@ -32,6 +32,7 @@ import DefaultSecurityCenterApi, { SecurityCenterApi } from './security-center';
32
32
  import DefaultPhoneNumbersApi, { PhoneNumbersApi } from './user-phone-numbers';
33
33
  import DefaultApplicationsApi, { ApplicationsApi } from './applications';
34
34
  import DefaultVeloApi, { VeloApi } from './velo';
35
+ import DefaultUserEmailPolicyApi, { UserEmailPolicyApi } from './users-emails-policy';
35
36
  export * from './interfaces';
36
37
  export * from './auth/interfaces';
37
38
  export * from './auth/enums';
@@ -62,6 +63,7 @@ export * from './security-center/interfaces';
62
63
  export * from './user-phone-numbers/interfaces';
63
64
  export * from './applications/interfaces';
64
65
  export * from './velo/interfaces';
66
+ export * from './users-emails-policy/interfaces';
65
67
  export { GENERIC_ERROR_CODE, GENERIC_ERROR_MESSAGE } from './constants';
66
68
  /**
67
69
  * Frontegg API client for default app
@@ -92,7 +94,8 @@ const api = {
92
94
  securityCenter: DefaultSecurityCenterApi,
93
95
  userPhoneNumbers: DefaultPhoneNumbersApi,
94
96
  applications: DefaultApplicationsApi,
95
- velo: DefaultVeloApi
97
+ velo: DefaultVeloApi,
98
+ userEmailPolicy: DefaultUserEmailPolicyApi
96
99
  };
97
100
  const createApiClient = appName => ({
98
101
  auth: new AuthenticationApi(appName),
@@ -118,7 +121,8 @@ const createApiClient = appName => ({
118
121
  securityCenter: new SecurityCenterApi(appName),
119
122
  userPhoneNumbers: new PhoneNumbersApi(appName),
120
123
  applications: new ApplicationsApi(appName),
121
- velo: new VeloApi(appName)
124
+ velo: new VeloApi(appName),
125
+ userEmailPolicy: new UserEmailPolicyApi(appName)
122
126
  });
123
127
  export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
124
128
  export default {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.75.0-alpha.1
1
+ /** @license Frontegg v7.75.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.
@@ -173,6 +173,7 @@ var _securityCenter = _interopRequireWildcard(require("./security-center"));
173
173
  var _userPhoneNumbers = _interopRequireWildcard(require("./user-phone-numbers"));
174
174
  var _applications = _interopRequireWildcard(require("./applications"));
175
175
  var _velo = _interopRequireWildcard(require("./velo"));
176
+ var _usersEmailsPolicy = _interopRequireWildcard(require("./users-emails-policy"));
176
177
  var _interfaces = require("./interfaces");
177
178
  Object.keys(_interfaces).forEach(function (key) {
178
179
  if (key === "default" || key === "__esModule") return;
@@ -521,6 +522,18 @@ Object.keys(_interfaces24).forEach(function (key) {
521
522
  }
522
523
  });
523
524
  });
525
+ var _interfaces25 = require("./users-emails-policy/interfaces");
526
+ Object.keys(_interfaces25).forEach(function (key) {
527
+ if (key === "default" || key === "__esModule") return;
528
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
529
+ if (key in exports && exports[key] === _interfaces25[key]) return;
530
+ Object.defineProperty(exports, key, {
531
+ enumerable: true,
532
+ get: function () {
533
+ return _interfaces25[key];
534
+ }
535
+ });
536
+ });
524
537
  var _constants = require("./constants");
525
538
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
526
539
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -553,7 +566,8 @@ const api = {
553
566
  securityCenter: _securityCenter.default,
554
567
  userPhoneNumbers: _userPhoneNumbers.default,
555
568
  applications: _applications.default,
556
- velo: _velo.default
569
+ velo: _velo.default,
570
+ userEmailPolicy: _usersEmailsPolicy.default
557
571
  };
558
572
  exports.api = api;
559
573
  const createApiClient = appName => ({
@@ -580,7 +594,8 @@ const createApiClient = appName => ({
580
594
  securityCenter: new _securityCenter.SecurityCenterApi(appName),
581
595
  userPhoneNumbers: new _userPhoneNumbers.PhoneNumbersApi(appName),
582
596
  applications: new _applications.ApplicationsApi(appName),
583
- velo: new _velo.VeloApi(appName)
597
+ velo: new _velo.VeloApi(appName),
598
+ userEmailPolicy: new _usersEmailsPolicy.UserEmailPolicyApi(appName)
584
599
  });
585
600
  exports.createApiClient = createApiClient;
586
601
  var _default = {
@@ -16,6 +16,17 @@ class TeamsApi extends _BaseApiClient.BaseApiClient {
16
16
  addRoles: true
17
17
  });
18
18
  };
19
+ this.updateEmail = async email => {
20
+ return this.post(`${_constants.urls.identity.users.v1}/email/me`, {
21
+ email
22
+ });
23
+ };
24
+ this.verifyEmail = async (email, code) => {
25
+ return this.post(`${_constants.urls.identity.users.v1}/email/me/verify`, {
26
+ email,
27
+ code
28
+ });
29
+ };
19
30
  this.updateProfile = async body => {
20
31
  return this.put(`${_constants.urls.identity.users.v2}/me`, body);
21
32
  };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.UserEmailPolicyApi = void 0;
7
+ var _BaseApiClient = require("../BaseApiClient");
8
+ var _constants = require("../constants");
9
+ class UserEmailPolicyApi extends _BaseApiClient.BaseApiClient {
10
+ constructor(appName) {
11
+ super(appName);
12
+ this.getUserEmailPolicyConfig = async () => {
13
+ return this.get(`${_constants.urls.identity.configurations.v1}/user-emails-policy`);
14
+ };
15
+ }
16
+
17
+ /** Retrieve users email policy config. */
18
+ }
19
+ exports.UserEmailPolicyApi = UserEmailPolicyApi;
20
+ var _default = new UserEmailPolicyApi('default');
21
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "7.75.0-alpha.1",
3
+ "version": "7.75.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
package/teams/index.d.ts CHANGED
@@ -5,6 +5,8 @@ import { BaseApiClient } from '../BaseApiClient';
5
5
  export declare class TeamsApi extends BaseApiClient {
6
6
  constructor(appName: string);
7
7
  getProfile: (params?: object) => Promise<IUserProfile>;
8
+ updateEmail: (email: string) => Promise<void>;
9
+ verifyEmail: (email: string, code: string) => Promise<void>;
8
10
  updateProfile: (body: Partial<IUpdateProfile>) => Promise<IUserProfile>;
9
11
  updateProfileImage: (body: FormData) => Promise<string>;
10
12
  /**
package/teams/index.js CHANGED
@@ -9,6 +9,17 @@ export class TeamsApi extends BaseApiClient {
9
9
  addRoles: true
10
10
  });
11
11
  };
12
+ this.updateEmail = async email => {
13
+ return this.post(`${urls.identity.users.v1}/email/me`, {
14
+ email
15
+ });
16
+ };
17
+ this.verifyEmail = async (email, code) => {
18
+ return this.post(`${urls.identity.users.v1}/email/me/verify`, {
19
+ email,
20
+ code
21
+ });
22
+ };
12
23
  this.updateProfile = async body => {
13
24
  return this.put(`${urls.identity.users.v2}/me`, body);
14
25
  };
@@ -0,0 +1,9 @@
1
+ import { BaseApiClient } from '../BaseApiClient';
2
+ import { IUserEmailPolicyConfig } from './interfaces';
3
+ export declare class UserEmailPolicyApi extends BaseApiClient {
4
+ constructor(appName: string);
5
+ /** Retrieve users email policy config. */
6
+ getUserEmailPolicyConfig: () => Promise<IUserEmailPolicyConfig>;
7
+ }
8
+ declare const _default: UserEmailPolicyApi;
9
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { BaseApiClient } from '../BaseApiClient';
2
+ import { urls } from '../constants';
3
+ export class UserEmailPolicyApi extends BaseApiClient {
4
+ constructor(appName) {
5
+ super(appName);
6
+ this.getUserEmailPolicyConfig = async () => {
7
+ return this.get(`${urls.identity.configurations.v1}/user-emails-policy`);
8
+ };
9
+ }
10
+
11
+ /** Retrieve users email policy config. */
12
+ }
13
+
14
+ export default new UserEmailPolicyApi('default');
@@ -0,0 +1,3 @@
1
+ export interface IUserEmailPolicyConfig {
2
+ allowEmailChange: boolean;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/users-emails-policy/index.js",
5
+ "types": "./index.d.ts"
6
+ }