-
Notifications
You must be signed in to change notification settings - Fork 182
Vonage Network SIM Swap
Documentation / Vonage Network SIM Swap
Defined in: network-sim-swap/lib/simSwap.ts:5
new SIMSwap(auth, config?): SIMSwap
Defined in: network-client/dist/networkClient.d.ts:34
protected _msisdn: string;
Defined in: network-client/dist/networkClient.d.ts:21
The msisdn that will be used for API calls
protected optional _purpose: FRAUD_PREVENTION_AND_DETECTION;
Defined in: network-client/dist/networkClient.d.ts:25
The purpose for the scope
protected optional _scope: Scope;
Defined in: network-client/dist/networkClient.d.ts:29
The scope for the token
protected optional accessToken: string;
Defined in: network-client/dist/networkClient.d.ts:13
The current token
protected auth: AuthInterface;
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
protected optional authType: CIBA = AuthenticationType.CIBA;
Defined in: network-sim-swap/lib/simSwap.ts:6
The type of authentication used for the client's requests.
protected config: NetworkConfigParameters;
Defined in: network-client/dist/networkClient.d.ts:33
Configuration settings for the client, including default hosts for various services and other request settings.
protected expires: number;
Defined in: network-client/dist/networkClient.d.ts:17
Timestamp until the token expires
protected gettingToken: boolean;
Defined in: network-client/dist/networkClient.d.ts:9
Flags if we are currently getting a token
static transformers: object;
Defined in: server-client/dist/lib/client.d.ts:11
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
string
[]
snakeCaseObjectKeys: PartialTransformFunction;
get msisdn(): string
Defined in: network-client/dist/networkClient.d.ts:40
Get the msisdn
If the msisdn is not set
string
The msisdn
get purpose(): FRAUD_PREVENTION_AND_DETECTION
Defined in: network-client/dist/networkClient.d.ts:48
Get the purpose
If the purpose is not set
If the purpose is not valid
FRAUD_PREVENTION_AND_DETECTION
The purpose
set purpose(value): void
Defined in: network-client/dist/networkClient.d.ts:53
Set the purpose
FRAUD_PREVENTION_AND_DETECTION
The purpose
void
get scope(): Scope
Defined in: network-client/dist/networkClient.d.ts:61
Get the scope
If the scope is not set
If the scope is not valid
The scope
set scope(value): void
Defined in: network-client/dist/networkClient.d.ts:69
Set the scope
If the scope is not valid
If the scope is not set
The scope
void
addAuthenticationToRequest(request): Promise<VetchOptions>
Defined in: network-client/dist/networkClient.d.ts:78
Add authentication to the auth
This will make the calls to get a network token if required.
The request to add authentication to
Promise
<VetchOptions
>
The request with authentication added
NetworkClient
.addAuthenticationToRequest
protected addBasicAuthToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:71
Adds basic authentication headers to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
NetworkClient
.addBasicAuthToRequest
protected addJWTToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:64
Adds a JWT to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:57
Adds API key and secret to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
NetworkClient
.addQueryKeySecretToRequest
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:50
Adds API key and secret to the request body.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
NetworkClient
.addQueryKeySecretToRequestBody
buildOIDCURL(state?): string
Defined in: network-client/dist/networkClient.d.ts:85
Build the URL for the OIDC flow
string
The state to use
string
The URL for the OIDC flow
checkSwapSim(params): Promise<boolean>
Defined in: network-sim-swap/lib/simSwap.ts:8
Promise
<boolean
>
exchangeCodeForToken(code): Promise<NetworkTokenResponse>
Defined in: network-client/dist/networkClient.d.ts:92
Exchange the code for a network token
string
The code to exchange
Promise
<NetworkTokenResponse
>
The network token token
NetworkClient
.exchangeCodeForToken
protected getCIBAAccessToken(cibaRequestId): Promise<NetworkTokenResponse>
Defined in: network-client/dist/networkClient.d.ts:106
Get a network token
string
The CIBA request id
Promise
<NetworkTokenResponse
>
The network token data
NetworkClient
.getCIBAAccessToken
protected getCIBARequestId(): Promise<string>
Defined in: network-client/dist/networkClient.d.ts:112
Get an CIBA request id
Promise
<string
>
The CIBA request id
NetworkClient
.getCIBARequestId
protected getCIBAToken(): Promise<void>
Defined in: network-client/dist/networkClient.d.ts:99
Get the access token for the CIBA flow
This is a two step process. First we need to get an CIBA request id, then we can use that to get a network token.
Promise
<void
>
getConfig(): ConfigParams
Defined in: server-client/dist/lib/client.d.ts:36
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:168
Parses the response based on its content type.
• T
The expected type of the parsed response data.
The request options.
Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
protected prepareBody(request): undefined | string
Defined in: server-client/dist/lib/client.d.ts:158
Prepares the body for the request based on the content type.
The request options.
undefined
| string
- The prepared request body as a string or undefined.
protected prepareRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:151
Prepares the request with necessary headers, authentication, and query parameters.
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:78
Sends a DELETE request to the specified URL.
• T
string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
NetworkClient
.sendDeleteRequest
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:86
Sends a POST request with form data to the specified URL.
• T
string
The URL endpoint for the POST request.
Record
<string
, undefined
| string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
NetworkClient
.sendFormSubmitRequest
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:94
Sends a GET request to the specified URL with optional query parameters.
• T
string
The URL endpoint for the GET request.
Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.
Promise
<VetchResponse
<T
>>
- The response from the GET request.
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:104
Sends a PATCH request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PATCH request.
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
NetworkClient
.sendPatchRequest
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:114
Sends a POST request to the specified URL with an optional payload.
• T
string
The URL endpoint for the POST request.
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:124
Sends a PUT request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PUT request.
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
sendRequest<T>(request): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:144
Sends a request adding necessary headers, handling authentication, and parsing the response.
• T
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:135
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
• T
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
string
The URL endpoint for the request.
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
NetworkClient
.sendRequestWithData
type SIMSwapParameters = object;
Defined in: network-sim-swap/lib/types/parameters/simSwapParameters.ts:1
optional maxAge: number;
The number of days to check if the SIM was swapped
From 1 to 2400
phoneNumber: string;
The Phone number to check if the SIM was swapped
type SIMSwapResponse = object;
Defined in: network-sim-swap/lib/types/responses/simSwapResponse.ts:1
swapped: boolean;
Weahter the SIM was swapped or not