-
Notifications
You must be signed in to change notification settings - Fork 182
Vonage Audit
Documentation / Vonage Audit
Defined in: audit/lib/enums.ts:14
Audit Events are generated automatically by Vonage as the user interacts with either a Vonage API or the Vonage Dashboard. Each Audit Event object has a type and associated metadata.
The list of supported event types does change from time to time. For this reason the OPTIONS method is provided to return event types. You can see how to return the definitive list of event types from the https://developer.vonage.com/en/audit/code-snippets/get-event-types
Documentation https://developer.vonage.com/en/audit/concepts/audit-events
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
ACCOUNT_SECRET_CREATE
|
"ACCOUNT_SECRET_CREATE" |
Secret Rotation operation. | audit/lib/enums.ts:63 |
ACCOUNT_SECRET_DELETE
|
"ACCOUNT_SECRET_DELETE" |
Secret Rotation operation. | audit/lib/enums.ts:58 |
ACCOUNT_UPDATE_SETTINGS_API
|
"ACCOUNT_UPDATE_SETTINGS_API" |
Account Settings updated via API. | audit/lib/enums.ts:73 |
ACCOUNT_UPDATE_SPAMMER
|
"ACCOUNT_UPDATE_SPAMMER" |
Account Settings updated via API. | audit/lib/enums.ts:68 |
APP_CREATE
|
"APP_CREATE" |
App created. | audit/lib/enums.ts:103 |
APP_DELETE
|
"APP_DELETE" |
App deleted. | audit/lib/enums.ts:113 |
APP_DISABLE
|
"APP_DISABLE" |
App disabled. | audit/lib/enums.ts:118 |
APP_ENABLE
|
"APP_ENABLE" |
App enabled. | audit/lib/enums.ts:123 |
APP_UPDATE
|
"APP_UPDATE" |
App updated. | audit/lib/enums.ts:108 |
AUTORELOAD_DISABLE
|
"AUTORELOAD_DISABLE" |
Automatic reload disabled. | audit/lib/enums.ts:148 |
AUTORELOAD_ENABLE
|
"AUTORELOAD_ENABLE" |
Automatic reload enabled. | audit/lib/enums.ts:138 |
AUTORELOAD_UPDATE
|
"AUTORELOAD_UPDATE" |
Automatic reload settings updated. | audit/lib/enums.ts:143 |
IP_WHITELIST_CREATE
|
"IP_WHITELIST_CREATE" |
Whitelist IP added. | audit/lib/enums.ts:128 |
IP_WHITELIST_DELETE
|
"IP_WHITELIST_DELETE" |
Whitelist IP deleted. | audit/lib/enums.ts:133 |
NUMBER_ASSIGN
|
"NUMBER_ASSIGN" |
Number assigned. | audit/lib/enums.ts:78 |
NUMBER_LINKED
|
"NUMBER_LINKED" |
Number linked to Vonage application. | audit/lib/enums.ts:93 |
NUMBER_RELEASE
|
"NUMBER_RELEASE" |
Number released. | audit/lib/enums.ts:88 |
NUMBER_UNLINKED
|
"NUMBER_UNLINKED" |
Number unlinked from Vonage application. | audit/lib/enums.ts:98 |
NUMBER_UPDATED
|
"NUMBER_UPDATED" |
Number updated. | audit/lib/enums.ts:83 |
USER_API_KEYS_UPDATE
|
"USER_API_KEYS_UPDATE" |
Sub-accounts for user updated. | audit/lib/enums.ts:53 |
USER_BILLING_UPDATE
|
"USER_BILLING_UPDATE" |
User billing updated. | audit/lib/enums.ts:28 |
USER_CREATE
|
"USER_CREATE" |
User created. | audit/lib/enums.ts:33 |
USER_LOGIN
|
"USER_LOGIN" |
User login (Premium Support only). | audit/lib/enums.ts:38 |
USER_LOGOUT
|
"USER_LOGOUT" |
User logout (Premium Support only). | audit/lib/enums.ts:43 |
USER_PRODUCT_SEARCH
|
"USER_PRODUCT_SEARCH" |
Relates to searching for CDRs or logs in Dashboard. | audit/lib/enums.ts:48 |
USER_STATUS
|
"USER_STATUS" |
User status updated. | audit/lib/enums.ts:18 |
USER_UPDATE
|
"USER_UPDATE" |
User updated. | audit/lib/enums.ts:23 |
Defined in: audit/lib/audit.ts:28
Represents an SDK client for interacting with audit-related functionality.
This client is only available as a standalone client. It cannot be instantiated from a Vonage client.
Create a standalone Audit client
import { Audit } from '@vonage/audit';
const auditClient = new Audit({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
new Audit(credentials, options?): Audit
Defined in: server-client/dist/lib/client.d.ts:35
Creates a new instance of the Client.
The authentication credentials or an authentication instance.
Optional configuration settings for the client.
protected auth: AuthInterface;
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
authType: AuthenticationType = AuthenticationType.BASIC;
Defined in: audit/lib/audit.ts:33
The type of authentication used for the client's requests.
protected BASE_PATH: string = 'beta';
Defined in: audit/lib/audit.ts:30
protected config: ConfigParams;
Defined in: server-client/dist/lib/client.d.ts:28
Configuration settings for the client, including default hosts for various services and other request settings.
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;
addAuthenticationToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:43
Adds the appropriate authentication headers or parameters to the request based on the authentication type.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.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.
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.
Client
.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.
Client
.addQueryKeySecretToRequestBody
getConfig(): ConfigParams
Defined in: server-client/dist/lib/client.d.ts:36
getEvent(eventId): Promise<AuditEvent>
Defined in: audit/lib/audit.ts:105
Retrieves a specific audit event by its ID.
string
The ID of the audit event to retrieve.
Promise
<AuditEvent
>
A promise that resolves to the retrieved audit event.
Retrieve a specific audit event
const auditEvent = await auditClient.getEvent('event-id');
console.log(auditEvent.id);
getEvents(params): AsyncGenerator<AuditEvent, void, undefined>
Defined in: audit/lib/audit.ts:68
Retrieves a list of audit events based on specified parameters.
The query parameters for filtering audit events.
AsyncGenerator
<AuditEvent
, void
, undefined
>
An async generator that yields audit events.
Retrieve a list of audit events
const auditEvents = auditClient.getEvents({
page: 1,
size: 10,
dateFrom: '2021-01-01T00:00:00Z',
dateTo: '2021-01-31T23:59:59Z',
eventType: 'message',
search: 'search term'
});
for await (const event of auditEvents) {
console.log(event.id);
console.log(event.type);
console.log(event.created);
console.log(event.accountId);
console.log(event.requestId);
console.log(event.request);
console.log(event.response);
console.log(event.ipAddress);
console.log(event.country);
console.log(event.msisdn);
}
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.
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.
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.
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.
type AuditEvent = object;
Defined in: audit/lib/types/auditEvent.ts:5
Represents an Audit Event.
accountId: string;
The API_KEY of the Vonage API account that the audit event is associated with.
optional context: unknown;
Additional context information for the audit event.
createdAt: string;
The date when the audit event was created.
eventType: AuditEventTypes | string;
The type of the audit event.
id: string;
UUID of the audit event.
source: "CD" | "DEVAPI";
The source of the event.
sourceCountry: string;
ISO 3166-1 Alpha-2 country code recorded for the event.
sourceDescription: "Customer Dashboard" | "Developer API";
Description of the audit event source.
optional userEmail: string;
Email of the user whose account the audit event is associated with.
optional userId: string;
The ID of the user that the audit event is associated with.
type AuditEventListResponse = object;
Defined in: audit/lib/types/auditEventListResponse.ts:12
Represents the response containing a list of audit events.
optional _embedded: object;
An object containing an array of audit events.
_embedded.events: AuditEvent[];
_links: APILinks;
Links associated with the API response.
page: AuditEventPage;
Information about the pagination and page details.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type AuditEventPage = object;
Defined in: audit/lib/types/auditEventPage.ts:4
Represents information about the pagination of audit events.
number: number;
The current page number.
size: number;
The number of items per page.
totalElements: number;
The total number of elements across all pages.
totalPages: number;
The total number of pages available.
type AuditEventResponse = object & Pick<AuditEvent, "id" | "source" | "context">;
Defined in: audit/lib/types/auditEventResponse.ts:11
Represents an Audit Event.
account_id: string;
The API_KEY of the Vonage API account that the audit event is associated with.
created_at: string;
The date when the audit event was created.
event_type: AuditEventTypes | string;
The type of the audit event.
source_country: string;
ISO 3166-1 Alpha-2 country code recorded for the event.
source_description: Pick<AuditEvent, "sourceDescription">;
Description of the audit event source.
optional user_email: string;
Email of the user whose account the audit event is associated with.
optional user_id: string;
The ID of the user that the audit event is associated with.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type AuditParams = object;
Defined in: audit/lib/types/auditParams.ts:6
Represents parameters for querying audit events.
optional dateFrom: string;
The start date for the audit event query.
optional dateTo: string;
The end date for the audit event query.
optional eventType: AuditEventTypes | string;
The type of the audit event to filter by.
optional page: number;
The page number for paginated results.
optional searchText: string;
Text to search within audit event descriptions.
optional size: number;
The number of items per page.
type AuditResponse<T> = VetchResponse<T>;
Defined in: audit/lib/types/auditResponse.ts:6
• T
this is not used