@frontegg/rest-api 3.1.17 → 3.1.19

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.
@@ -513,6 +513,7 @@ export declare enum SecondaryAuthStrategy {
513
513
  WebAuthnPlatform = "WebAuthnPlatform",
514
514
  WebAuthnCrossPlatform = "WebAuthnCrossPlatform",
515
515
  SmsCode = "SmsCode",
516
+ SmsCodeV2 = "SmsCodeV2",
516
517
  Passkeys = "Passkeys"
517
518
  }
518
519
  export interface IAuthStrategyConfig {
@@ -6,6 +6,7 @@ export let SecondaryAuthStrategy;
6
6
  SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
7
7
  SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
8
8
  SecondaryAuthStrategy["SmsCode"] = "SmsCode";
9
+ SecondaryAuthStrategy["SmsCodeV2"] = "SmsCodeV2";
9
10
  SecondaryAuthStrategy["Passkeys"] = "Passkeys";
10
11
  })(SecondaryAuthStrategy || (SecondaryAuthStrategy = {}));
11
12
 
package/constants.d.ts CHANGED
@@ -115,6 +115,9 @@ export declare const urls: {
115
115
  v1: string;
116
116
  };
117
117
  };
118
+ phoneNumbers: {
119
+ v1: string;
120
+ };
118
121
  };
119
122
  team: {
120
123
  sso: {
package/constants.js CHANGED
@@ -114,6 +114,9 @@ export const urls = {
114
114
  getByIds: {
115
115
  v1: '/identity/resources/groups/v1/bulkGet'
116
116
  }
117
+ },
118
+ phoneNumbers: {
119
+ v1: '/identity/resources/phoneNumbers/v1'
117
120
  }
118
121
  },
119
122
  team: {
package/index.d.ts CHANGED
@@ -22,6 +22,7 @@ import * as groups from "./groups";
22
22
  import * as users from "./users";
23
23
  import * as entitlements from "./entitlements";
24
24
  import * as securityCenter from "./security-center";
25
+ import * as userPhoneNumbers from "./user-phone-numbers";
25
26
  import { ContextHolder, FronteggContext } from "./ContextHolder";
26
27
  export * from "./interfaces";
27
28
  export * from "./auth/interfaces";
@@ -48,6 +49,7 @@ export * from "./groups/enums";
48
49
  export * from "./users/interfaces";
49
50
  export * from "./entitlements/interfaces";
50
51
  export * from "./security-center/interfaces";
52
+ export * from "./user-phone-numbers/interfaces";
51
53
  declare const api: {
52
54
  auth: typeof auth;
53
55
  teams: typeof teams;
@@ -69,6 +71,7 @@ declare const api: {
69
71
  users: typeof users;
70
72
  entitlements: typeof entitlements;
71
73
  securityCenter: typeof securityCenter;
74
+ userPhoneNumbers: typeof userPhoneNumbers;
72
75
  };
73
76
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, };
74
77
  declare const _default: {
@@ -102,6 +105,7 @@ declare const _default: {
102
105
  users: typeof users;
103
106
  entitlements: typeof entitlements;
104
107
  securityCenter: typeof securityCenter;
108
+ userPhoneNumbers: typeof userPhoneNumbers;
105
109
  };
106
110
  FronteggApiError: typeof FronteggApiError;
107
111
  AuthStrategyEnum: typeof auth.AuthStrategyEnum;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.17
1
+ /** @license Frontegg v3.1.19
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.
@@ -27,6 +27,7 @@ import * as groups from "./groups";
27
27
  import * as users from "./users";
28
28
  import * as entitlements from "./entitlements";
29
29
  import * as securityCenter from "./security-center";
30
+ import * as userPhoneNumbers from "./user-phone-numbers";
30
31
  import { ContextHolder, FronteggContext } from "./ContextHolder";
31
32
  export * from "./interfaces";
32
33
  export * from "./auth/interfaces";
@@ -53,6 +54,7 @@ export * from "./groups/enums";
53
54
  export * from "./users/interfaces";
54
55
  export * from "./entitlements/interfaces";
55
56
  export * from "./security-center/interfaces";
57
+ export * from "./user-phone-numbers/interfaces";
56
58
  const api = {
57
59
  auth,
58
60
  teams,
@@ -73,7 +75,8 @@ const api = {
73
75
  groups,
74
76
  users,
75
77
  entitlements,
76
- securityCenter
78
+ securityCenter,
79
+ userPhoneNumbers
77
80
  };
78
81
  export { fetch, ContextHolder, FronteggContext, api, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
79
82
  export default {
@@ -32,6 +32,7 @@ exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
32
32
  SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
33
33
  SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
34
34
  SecondaryAuthStrategy["SmsCode"] = "SmsCode";
35
+ SecondaryAuthStrategy["SmsCodeV2"] = "SmsCodeV2";
35
36
  SecondaryAuthStrategy["Passkeys"] = "Passkeys";
36
37
  })(SecondaryAuthStrategy || (exports.SecondaryAuthStrategy = SecondaryAuthStrategy = {}));
37
38
 
package/node/constants.js CHANGED
@@ -120,6 +120,9 @@ const urls = {
120
120
  getByIds: {
121
121
  v1: '/identity/resources/groups/v1/bulkGet'
122
122
  }
123
+ },
124
+ phoneNumbers: {
125
+ v1: '/identity/resources/phoneNumbers/v1'
123
126
  }
124
127
  },
125
128
  team: {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.17
1
+ /** @license Frontegg v3.1.19
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.
@@ -130,6 +130,8 @@ var entitlements = _interopRequireWildcard(require("./entitlements"));
130
130
 
131
131
  var securityCenter = _interopRequireWildcard(require("./security-center"));
132
132
 
133
+ var userPhoneNumbers = _interopRequireWildcard(require("./user-phone-numbers"));
134
+
133
135
  var _ContextHolder = require("./ContextHolder");
134
136
 
135
137
  var _interfaces = require("./interfaces");
@@ -482,6 +484,20 @@ Object.keys(_interfaces21).forEach(function (key) {
482
484
  });
483
485
  });
484
486
 
487
+ var _interfaces22 = require("./user-phone-numbers/interfaces");
488
+
489
+ Object.keys(_interfaces22).forEach(function (key) {
490
+ if (key === "default" || key === "__esModule") return;
491
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
492
+ if (key in exports && exports[key] === _interfaces22[key]) return;
493
+ Object.defineProperty(exports, key, {
494
+ enumerable: true,
495
+ get: function () {
496
+ return _interfaces22[key];
497
+ }
498
+ });
499
+ });
500
+
485
501
  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); }
486
502
 
487
503
  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; }
@@ -506,7 +522,8 @@ const api = {
506
522
  groups,
507
523
  users,
508
524
  entitlements,
509
- securityCenter
525
+ securityCenter,
526
+ userPhoneNumbers
510
527
  };
511
528
  exports.api = api;
512
529
  var _default = {
@@ -24,7 +24,6 @@ exports.RecommendationCode = RecommendationCode;
24
24
  RecommendationCode["CHANGE_IP_TO_ALLOWLIST"] = "CHANGE_IP_TO_ALLOWLIST";
25
25
  RecommendationCode["ENABLE_DOMAIN_RESTRICTIONS"] = "ENABLE_DOMAIN_RESTRICTIONS";
26
26
  RecommendationCode["CHANGE_DOMAIN_TO_ALLOWLIST"] = "CHANGE_DOMAIN_TO_ALLOWLIST";
27
- RecommendationCode["REMOVE_STALE_USERS"] = "REMOVE_STALE_USERS";
28
27
  RecommendationCode["CONFIGURE_SSO"] = "CONFIGURE_SSO";
29
28
  })(RecommendationCode || (exports.RecommendationCode = RecommendationCode = {}));
30
29
 
@@ -42,8 +41,6 @@ exports.InsightCode = InsightCode;
42
41
  InsightCode["NO_SESSION_SETTINGS"] = "NO_SESSION_SETTINGS";
43
42
  InsightCode["PARTIAL_SESSION_SETTINGS"] = "PARTIAL_SESSION_SETTINGS";
44
43
  InsightCode["FULL_SESSION_SETTINGS"] = "FULL_SESSION_SETTINGS";
45
- InsightCode["STALE_USERS_EXIST"] = "STALE_USERS_EXIST";
46
- InsightCode["NO_STALE_USERS_EXIST"] = "NO_STALE_USERS_EXIST";
47
44
  InsightCode["NO_IP_RESTRICTIONS"] = "NO_IP_RESTRICTIONS";
48
45
  InsightCode["IP_ALLOWLIST"] = "IP_ALLOWLIST";
49
46
  InsightCode["IP_DENYLIST"] = "IP_DENYLIST";
@@ -61,7 +58,6 @@ exports.RecommendationActionKey = RecommendationActionKey;
61
58
  RecommendationActionKey["ADJUST_FORCE_RELOGIN"] = "ADJUST_FORCE_RELOGIN";
62
59
  RecommendationActionKey["ADJUST_MAX_CONCURRENT_SESSIONS"] = "ADJUST_MAX_CONCURRENT_SESSIONS";
63
60
  RecommendationActionKey["ADJUST_IDLE_TIMEOUT"] = "ADJUST_IDLE_TIMEOUT";
64
- RecommendationActionKey["REMOVE_STALE_USERS"] = "REMOVE_STALE_USERS";
65
61
  })(RecommendationActionKey || (exports.RecommendationActionKey = RecommendationActionKey = {}));
66
62
 
67
63
  let RecommendationSeverity;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createPhoneNumber = createPhoneNumber;
7
+ exports.deletePhoneNumber = deletePhoneNumber;
8
+ exports.getAllUserPhoneNumbers = getAllUserPhoneNumbers;
9
+ exports.updatePhoneNumber = updatePhoneNumber;
10
+ exports.verifyPhoneNumber = verifyPhoneNumber;
11
+
12
+ var _constants = require("../constants");
13
+
14
+ var _fetch = require("../fetch");
15
+
16
+ async function getAllUserPhoneNumbers(queryParams) {
17
+ return (0, _fetch.Get)(`${_constants.urls.identity.phoneNumbers.v1}`, queryParams);
18
+ }
19
+
20
+ async function createPhoneNumber(body) {
21
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}`, body);
22
+ }
23
+
24
+ async function updatePhoneNumber(phoneId, body) {
25
+ return (0, _fetch.Patch)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`, body);
26
+ }
27
+
28
+ async function deletePhoneNumber(phoneId) {
29
+ return (0, _fetch.Delete)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`);
30
+ }
31
+
32
+ async function verifyPhoneNumber(body) {
33
+ return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/verify`, body);
34
+ }
@@ -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": "3.1.17",
3
+ "version": "3.1.19",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -52,7 +52,6 @@ export declare enum RecommendationCode {
52
52
  CHANGE_IP_TO_ALLOWLIST = "CHANGE_IP_TO_ALLOWLIST",
53
53
  ENABLE_DOMAIN_RESTRICTIONS = "ENABLE_DOMAIN_RESTRICTIONS",
54
54
  CHANGE_DOMAIN_TO_ALLOWLIST = "CHANGE_DOMAIN_TO_ALLOWLIST",
55
- REMOVE_STALE_USERS = "REMOVE_STALE_USERS",
56
55
  CONFIGURE_SSO = "CONFIGURE_SSO"
57
56
  }
58
57
  export declare enum InsightCode {
@@ -66,8 +65,6 @@ export declare enum InsightCode {
66
65
  NO_SESSION_SETTINGS = "NO_SESSION_SETTINGS",
67
66
  PARTIAL_SESSION_SETTINGS = "PARTIAL_SESSION_SETTINGS",
68
67
  FULL_SESSION_SETTINGS = "FULL_SESSION_SETTINGS",
69
- STALE_USERS_EXIST = "STALE_USERS_EXIST",
70
- NO_STALE_USERS_EXIST = "NO_STALE_USERS_EXIST",
71
68
  NO_IP_RESTRICTIONS = "NO_IP_RESTRICTIONS",
72
69
  IP_ALLOWLIST = "IP_ALLOWLIST",
73
70
  IP_DENYLIST = "IP_DENYLIST",
@@ -83,8 +80,7 @@ export declare enum RecommendationActionKey {
83
80
  SEND_RESET_BREACHED_PASSWORD_EMAIL = "SEND_RESET_BREACHED_PASSWORD_EMAIL",
84
81
  ADJUST_FORCE_RELOGIN = "ADJUST_FORCE_RELOGIN",
85
82
  ADJUST_MAX_CONCURRENT_SESSIONS = "ADJUST_MAX_CONCURRENT_SESSIONS",
86
- ADJUST_IDLE_TIMEOUT = "ADJUST_IDLE_TIMEOUT",
87
- REMOVE_STALE_USERS = "REMOVE_STALE_USERS"
83
+ ADJUST_IDLE_TIMEOUT = "ADJUST_IDLE_TIMEOUT"
88
84
  }
89
85
  export declare enum RecommendationSeverity {
90
86
  SEVERE = "SEVERE",
@@ -17,7 +17,6 @@ export let RecommendationCode;
17
17
  RecommendationCode["CHANGE_IP_TO_ALLOWLIST"] = "CHANGE_IP_TO_ALLOWLIST";
18
18
  RecommendationCode["ENABLE_DOMAIN_RESTRICTIONS"] = "ENABLE_DOMAIN_RESTRICTIONS";
19
19
  RecommendationCode["CHANGE_DOMAIN_TO_ALLOWLIST"] = "CHANGE_DOMAIN_TO_ALLOWLIST";
20
- RecommendationCode["REMOVE_STALE_USERS"] = "REMOVE_STALE_USERS";
21
20
  RecommendationCode["CONFIGURE_SSO"] = "CONFIGURE_SSO";
22
21
  })(RecommendationCode || (RecommendationCode = {}));
23
22
 
@@ -34,8 +33,6 @@ export let InsightCode;
34
33
  InsightCode["NO_SESSION_SETTINGS"] = "NO_SESSION_SETTINGS";
35
34
  InsightCode["PARTIAL_SESSION_SETTINGS"] = "PARTIAL_SESSION_SETTINGS";
36
35
  InsightCode["FULL_SESSION_SETTINGS"] = "FULL_SESSION_SETTINGS";
37
- InsightCode["STALE_USERS_EXIST"] = "STALE_USERS_EXIST";
38
- InsightCode["NO_STALE_USERS_EXIST"] = "NO_STALE_USERS_EXIST";
39
36
  InsightCode["NO_IP_RESTRICTIONS"] = "NO_IP_RESTRICTIONS";
40
37
  InsightCode["IP_ALLOWLIST"] = "IP_ALLOWLIST";
41
38
  InsightCode["IP_DENYLIST"] = "IP_DENYLIST";
@@ -52,7 +49,6 @@ export let RecommendationActionKey;
52
49
  RecommendationActionKey["ADJUST_FORCE_RELOGIN"] = "ADJUST_FORCE_RELOGIN";
53
50
  RecommendationActionKey["ADJUST_MAX_CONCURRENT_SESSIONS"] = "ADJUST_MAX_CONCURRENT_SESSIONS";
54
51
  RecommendationActionKey["ADJUST_IDLE_TIMEOUT"] = "ADJUST_IDLE_TIMEOUT";
55
- RecommendationActionKey["REMOVE_STALE_USERS"] = "REMOVE_STALE_USERS";
56
52
  })(RecommendationActionKey || (RecommendationActionKey = {}));
57
53
 
58
54
  export let RecommendationSeverity;
@@ -0,0 +1,22 @@
1
+ import { FronteggPaginationWrapper } from "../interfaces";
2
+ import { IGetPhoneNumbersQueryParams, IPhoneNumber, IUpdatePhoneNumber, IUpdatePhoneNumberResponse, IVerifyPhoneNumber } from "./interfaces";
3
+ /**
4
+ * Get all phone numbers of user
5
+ */
6
+ export declare function getAllUserPhoneNumbers(queryParams: IGetPhoneNumbersQueryParams): Promise<FronteggPaginationWrapper<IPhoneNumber[]>>;
7
+ /**
8
+ * Create new phone number for user
9
+ */
10
+ export declare function createPhoneNumber(body: IUpdatePhoneNumber): Promise<IUpdatePhoneNumberResponse>;
11
+ /**
12
+ * Update existing phone number for user
13
+ */
14
+ export declare function updatePhoneNumber(phoneId: string, body: IUpdatePhoneNumber): Promise<IUpdatePhoneNumberResponse>;
15
+ /**
16
+ * Delete existing phone number for user
17
+ */
18
+ export declare function deletePhoneNumber(phoneId: string): Promise<void>;
19
+ /**
20
+ * Verify phone number
21
+ */
22
+ export declare function verifyPhoneNumber(body: IVerifyPhoneNumber): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { urls } from "../constants";
2
+ import { Delete, Get, Patch, Post } from "../fetch";
3
+ export async function getAllUserPhoneNumbers(queryParams) {
4
+ return Get(`${urls.identity.phoneNumbers.v1}`, queryParams);
5
+ }
6
+ export async function createPhoneNumber(body) {
7
+ return Post(`${urls.identity.phoneNumbers.v1}`, body);
8
+ }
9
+ export async function updatePhoneNumber(phoneId, body) {
10
+ return Patch(`${urls.identity.phoneNumbers.v1}/${phoneId}`, body);
11
+ }
12
+ export async function deletePhoneNumber(phoneId) {
13
+ return Delete(`${urls.identity.phoneNumbers.v1}/${phoneId}`);
14
+ }
15
+ export async function verifyPhoneNumber(body) {
16
+ return Post(`${urls.identity.phoneNumbers.v1}/verify`, body);
17
+ }
@@ -0,0 +1,26 @@
1
+ import { PaginationOrderEnum } from "../interfaces";
2
+ import { SortByEnum } from "../users/interfaces";
3
+ export interface IGetPhoneNumbersQueryParams {
4
+ _limit?: number;
5
+ _offset?: number;
6
+ _sortBy?: SortByEnum;
7
+ _order?: PaginationOrderEnum;
8
+ }
9
+ export declare type IPhoneNumber = {
10
+ id: string;
11
+ phoneNumber: string;
12
+ verified: boolean;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ };
16
+ export declare type IUpdatePhoneNumber = {
17
+ phoneNumber: string;
18
+ };
19
+ export interface IVerifyPhoneNumber {
20
+ otcToken: string;
21
+ code: string;
22
+ }
23
+ export interface IUpdatePhoneNumberResponse {
24
+ otcToken: string;
25
+ phoneId: string;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/user-phone-numbers/index.js",
5
+ "types": "./index.d.ts"
6
+ }