@frontegg/rest-api 3.1.18 → 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.
- package/auth/interfaces.d.ts +1 -0
- package/auth/interfaces.js +1 -0
- package/constants.d.ts +3 -0
- package/constants.js +3 -0
- package/index.d.ts +4 -0
- package/index.js +5 -2
- package/node/auth/interfaces.js +1 -0
- package/node/constants.js +3 -0
- package/node/index.js +19 -2
- package/node/user-phone-numbers/index.js +34 -0
- package/node/user-phone-numbers/interfaces.js +5 -0
- package/package.json +1 -1
- package/user-phone-numbers/index.d.ts +22 -0
- package/user-phone-numbers/index.js +17 -0
- package/user-phone-numbers/interfaces.d.ts +26 -0
- package/user-phone-numbers/interfaces.js +1 -0
- package/user-phone-numbers/package.json +6 -0
package/auth/interfaces.d.ts
CHANGED
|
@@ -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 {
|
package/auth/interfaces.js
CHANGED
|
@@ -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
package/constants.js
CHANGED
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.
|
|
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 {
|
package/node/auth/interfaces.js
CHANGED
|
@@ -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
package/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Frontegg v3.1.
|
|
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 = {
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -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 {};
|