@frontegg/rest-api 3.1.23 → 3.1.25
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.js
CHANGED
package/node/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createPhoneNumber = createPhoneNumber;
|
|
7
7
|
exports.deletePhoneNumber = deletePhoneNumber;
|
|
8
8
|
exports.getUserPhoneNumbers = getUserPhoneNumbers;
|
|
9
|
-
exports.
|
|
9
|
+
exports.preVerifyPhoneNumber = preVerifyPhoneNumber;
|
|
10
10
|
exports.verifyDeletePhoneNumber = verifyDeletePhoneNumber;
|
|
11
11
|
exports.verifyPhoneNumber = verifyPhoneNumber;
|
|
12
12
|
|
|
@@ -22,16 +22,16 @@ async function createPhoneNumber(body) {
|
|
|
22
22
|
return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}`, body);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async function updatePhoneNumber(phoneId, body) {
|
|
26
|
-
return (0, _fetch.Patch)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`, body);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
25
|
async function deletePhoneNumber(phoneId) {
|
|
30
26
|
return (0, _fetch.Delete)(`${_constants.urls.identity.phoneNumbers.v1}/${phoneId}`);
|
|
31
27
|
}
|
|
32
28
|
|
|
33
|
-
async function
|
|
34
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}
|
|
29
|
+
async function preVerifyPhoneNumber(body) {
|
|
30
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/preverify`, body);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function verifyPhoneNumber(body) {
|
|
34
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.phoneNumbers.v1}/verify`, body);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
async function verifyDeletePhoneNumber(phoneId, body) {
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { FronteggPaginationWrapper } from "../interfaces";
|
|
2
|
-
import { IGetPhoneNumbersQueryParams, IPhoneNumber,
|
|
2
|
+
import { ICreatePhoneNumberResponse, IDeletePhoneNumberResponse, IGetPhoneNumbersQueryParams, IPhoneNumber, IPreVerifyPhoneNumber, IPreVerifyPhoneNumberResponse, IUpdatePhoneNumber, IVerifyPhoneNumber } from "./interfaces";
|
|
3
3
|
/**
|
|
4
4
|
* Get phone numbers of user
|
|
5
5
|
*/
|
|
6
6
|
export declare function getUserPhoneNumbers(queryParams: IGetPhoneNumbersQueryParams): Promise<FronteggPaginationWrapper<IPhoneNumber>>;
|
|
7
7
|
/**
|
|
8
|
-
* Create new phone number for user
|
|
8
|
+
* Create new phone number for user, by default otc will be sent with this request
|
|
9
9
|
*/
|
|
10
|
-
export declare function createPhoneNumber(body: IUpdatePhoneNumber): Promise<
|
|
10
|
+
export declare function createPhoneNumber(body: IUpdatePhoneNumber): Promise<ICreatePhoneNumberResponse>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Delete existing phone number for user
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function deletePhoneNumber(phoneId: string): Promise<IDeletePhoneNumberResponse>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Pre verify phone number, used before verify to send OTC to user
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function preVerifyPhoneNumber(body: IPreVerifyPhoneNumber): Promise<IPreVerifyPhoneNumberResponse>;
|
|
19
19
|
/**
|
|
20
20
|
* Verify phone number
|
|
21
21
|
*/
|
|
22
|
-
export declare function verifyPhoneNumber(
|
|
22
|
+
export declare function verifyPhoneNumber(body: IVerifyPhoneNumber): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* Verify delete phone number
|
|
25
25
|
*/
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { urls } from "../constants";
|
|
2
|
-
import { Delete, Get,
|
|
2
|
+
import { Delete, Get, Post } from "../fetch";
|
|
3
3
|
export async function getUserPhoneNumbers(queryParams) {
|
|
4
4
|
return Get(`${urls.identity.phoneNumbers.v1}`, queryParams);
|
|
5
5
|
}
|
|
6
6
|
export async function createPhoneNumber(body) {
|
|
7
7
|
return Post(`${urls.identity.phoneNumbers.v1}`, body);
|
|
8
8
|
}
|
|
9
|
-
export async function updatePhoneNumber(phoneId, body) {
|
|
10
|
-
return Patch(`${urls.identity.phoneNumbers.v1}/${phoneId}`, body);
|
|
11
|
-
}
|
|
12
9
|
export async function deletePhoneNumber(phoneId) {
|
|
13
10
|
return Delete(`${urls.identity.phoneNumbers.v1}/${phoneId}`);
|
|
14
11
|
}
|
|
15
|
-
export async function
|
|
16
|
-
return Post(`${urls.identity.phoneNumbers.v1}
|
|
12
|
+
export async function preVerifyPhoneNumber(body) {
|
|
13
|
+
return Post(`${urls.identity.phoneNumbers.v1}/preverify`, body);
|
|
14
|
+
}
|
|
15
|
+
export async function verifyPhoneNumber(body) {
|
|
16
|
+
return Post(`${urls.identity.phoneNumbers.v1}/verify`, body);
|
|
17
17
|
}
|
|
18
18
|
export async function verifyDeletePhoneNumber(phoneId, body) {
|
|
19
19
|
return Post(`${urls.identity.phoneNumbers.v1}/${phoneId}/delete/verify`, body);
|
|
@@ -15,12 +15,22 @@ export declare type IPhoneNumber = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare type IUpdatePhoneNumber = {
|
|
17
17
|
phoneNumber: string;
|
|
18
|
+
verify?: boolean;
|
|
18
19
|
};
|
|
20
|
+
export interface IPreVerifyPhoneNumber {
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
}
|
|
19
23
|
export interface IVerifyPhoneNumber {
|
|
20
24
|
otcToken: string;
|
|
21
25
|
code: string;
|
|
22
26
|
}
|
|
23
|
-
export interface
|
|
27
|
+
export interface ICreatePhoneNumberResponse {
|
|
28
|
+
otcToken?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IPreVerifyPhoneNumberResponse {
|
|
24
31
|
otcToken: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IDeletePhoneNumberResponse {
|
|
25
34
|
phoneId: string;
|
|
35
|
+
otcToken: string;
|
|
26
36
|
}
|