Socket
Socket
Sign inDemoInstall

@vonage/applications

Package Overview
Dependencies
Maintainers
52
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/applications - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

206

dist/applications.d.ts
import { AuthenticationType, Client } from '@vonage/server-client';
import { ApplicationPageResponse, Application, ListApplicationParams, ApplicationPageList } from './types';
import { ApplicationResponse, Application, ListApplicationParams, ApplicationPageList } from './types';
/**
* Represents the application with both the `snake_case` and the `camelCase` keys.
*
* @remarks
* This is used for backward compatibility with an earlier release of the SDK
* which was not transforming the application correctly.
* Using `snake_case` is considered deprecated
*
* @example
* Create a standalone Application client
*
* ```ts
* import { Applications } from '@vonage/application';
*
* const applicationClient = new Applications({
* apiKey: VONAGE_API_KEY,
* apiSecret: VONAGE_API_SECRET
* });
* ```
*
* @example
* Create an Application client from the Vonage client
*
* ```ts
* import { Vonage } from '@vonage/server-client';
*
* const vonage = new Vonage({
* apiKey: VONAGE_API_KEY,
* apiSecret: VONAGE_API_SECRET
* });
*
* const applicationClient = vonage.application
* ```
*/
export type MergedApplication = Application | ApplicationResponse;
export declare class Applications extends Client {
protected authType: AuthenticationType;
listApplications(filter: {
page_size?: number;
page?: number;
}): Promise<ApplicationPageResponse>;
listAllApplications(params?: ListApplicationParams): AsyncGenerator<Application, void & Application, undefined>;
authType: AuthenticationType;
/**
* Retrieves a list of applications with optional pagination parameters.
*
* @remarks
* This is used to get a specific page of applications. This will
* return the `snake_case` and the `camelCase` response. Using `snake_case`
* is considered deprecated
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#listApplication}
*
* @param {ListApplicationParams} params - The filter parameters.
* @return {Promise<ApplicationPageResponse>} - A promise resolving to the list of applications.
*
* @example
* List a single page of applications
*
* ```ts
* const applications = await applicationClient.listApplications({});
*
* applications.applications.forEach(application => {
* console.log(application.name);
* });
* ```
*/
listApplications(params: ListApplicationParams): Promise<ApplicationPageList>;
/**
* Retrieves all applications, iterating over paginated results.
*
* @remarks
* This will keep calling the API until there are no pages left. This will
* return the `snake_case` and the `camelCase` response. Using `snake_case`
* is considered deprecated
*
* @param {ListApplicationParams} [params={}] - Optional filter parameters.
* @yields {MergedApplication} - Yields application items.
* @return {AsyncGenerator<MergedApplication, void, undefined>} - An asynchronous generator.
*
* @example
* List applications with pagination using an iterator
*
* ```ts
* for await (const application of applicationClient.listAllApplications()) {
* console.log(application.name);
* }
* ```
*/
listAllApplications(params?: ListApplicationParams): AsyncGenerator<MergedApplication, void & MergedApplication, undefined>;
/**
* Retrieves a page of applications based on filter parameters.
*
* @param {ListApplicationParams} filter - The filter parameters for pagination.
* @return {Promise<ApplicationPageList>} - A promise resolving to a page of applications.
*
* @remarks
* This will return the `snake_case` and the `camelCase` response. Using
* `snake_case` is considered deprecated
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#listApplication}
*
* @example
* Get a single page of applications
*
* ```ts
* const applications = await applicationClient.getApplicationPage({
* page: 1,
* size: 10
* });
*
* applications.applications.forEach(application => {
* console.log(application.name);
* });
* ```
*/
getApplicationPage(filter: ListApplicationParams): Promise<ApplicationPageList>;
createApplication(application: Application): Promise<Application>;
getApplication(applicationId: string): Promise<Application>;
updateApplication(application: Application): Promise<Application>;
/**
* Creates a new application with the provided details.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#createApplication}
*
* @param {Application} application - The application details to be created.
* @return {Promise<MergedApplication>} - A promise resolving to the created application.
*
* @example
* Create a new application
*
* ```ts
* const application = await applicationClient.createApplication({
* name: 'My Application',
* capabilities: {
* voice: {
* webhooks: {
* answerUrl: {
* address: 'https://example.com/answer',
* httpMethod: 'GET'
* },
* eventUrl: {
* address: 'https://example.com/event',
* httpMethod: 'POST'
* }
* }
* }
* }
* });
*
* console.log(application.id);
* ```
*/
createApplication(application: Application): Promise<MergedApplication>;
/**
* Retrieves an application by its unique identifier.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#getApplication}
*
* @param {string} applicationId - The unique identifier of the application to retrieve.
* @return {Promise<MergedApplication>} - A promise resolving to the retrieved application.
*
* @example
* Retrieve an application
*
* ```ts
* const application = await applicationClient.getApplication(APPLICATION_ID);
* console.log(application.name);
* ```
*/
getApplication(applicationId: string): Promise<MergedApplication>;
/**
* Updates an existing application with the provided details.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#updateApplication}
*
* @param {Application} application - The application details to be updated.
* @return {Promise<MergedApplication>} - A promise resolving to the updated application.
*
* @example
* Update an application
*
* ```ts
* const application = await applicationClient.updateApplication({
* id: APPLICATION_ID,
* name: 'My Application',
* });
* console.log(application.name);
* ```
*/
updateApplication(application: Application): Promise<MergedApplication>;
/**
* Deletes an application by its unique identifier.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#deleteApplication}
*
* @param {string} applicationId - The unique identifier of the application to delete.
* @return {Promise<void>} - A promise indicating the successful deletion of the application.
*
* @example
* Delete an application
*
* ```ts
* await applicationClient.deleteApplication(APPLICATION_ID);
* ```
*/
deleteApplication(applicationId: string): Promise<void>;
}

@@ -6,10 +6,58 @@ "use strict";

const apiToApplication = (response) => {
delete response?._links;
delete response._links;
return server_client_1.Client.transformers.camelCaseObjectKeys(response, true, true);
};
class Applications extends server_client_1.Client {
authType = server_client_1.AuthenticationType.BASIC;
async listApplications(filter) {
return this.getApplicationPage(filter);
constructor() {
super(...arguments);
this.authType = server_client_1.AuthenticationType.BASIC;
}
/**
* Retrieves a list of applications with optional pagination parameters.
*
* @remarks
* This is used to get a specific page of applications. This will
* return the `snake_case` and the `camelCase` response. Using `snake_case`
* is considered deprecated
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#listApplication}
*
* @param {ListApplicationParams} params - The filter parameters.
* @return {Promise<ApplicationPageResponse>} - A promise resolving to the list of applications.
*
* @example
* List a single page of applications
*
* ```ts
* const applications = await applicationClient.listApplications({});
*
* applications.applications.forEach(application => {
* console.log(application.name);
* });
* ```
*/
async listApplications(params) {
return this.getApplicationPage(params);
}
/**
* Retrieves all applications, iterating over paginated results.
*
* @remarks
* This will keep calling the API until there are no pages left. This will
* return the `snake_case` and the `camelCase` response. Using `snake_case`
* is considered deprecated
*
* @param {ListApplicationParams} [params={}] - Optional filter parameters.
* @yields {MergedApplication} - Yields application items.
* @return {AsyncGenerator<MergedApplication, void, undefined>} - An asynchronous generator.
*
* @example
* List applications with pagination using an iterator
*
* ```ts
* for await (const application of applicationClient.listAllApplications()) {
* console.log(application.name);
* }
* ```
*/
async *listAllApplications(params = {}) {

@@ -20,3 +68,3 @@ let next = null;

const resp = await this.getApplicationPage(params);
yield* resp._embedded?.applications;
yield* resp._embedded?.applications || [];
next = resp._links?.next;

@@ -26,2 +74,28 @@ params.page++;

}
/**
* Retrieves a page of applications based on filter parameters.
*
* @param {ListApplicationParams} filter - The filter parameters for pagination.
* @return {Promise<ApplicationPageList>} - A promise resolving to a page of applications.
*
* @remarks
* This will return the `snake_case` and the `camelCase` response. Using
* `snake_case` is considered deprecated
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#listApplication}
*
* @example
* Get a single page of applications
*
* ```ts
* const applications = await applicationClient.getApplicationPage({
* page: 1,
* size: 10
* });
*
* applications.applications.forEach(application => {
* console.log(application.name);
* });
* ```
*/
async getApplicationPage(filter) {

@@ -40,2 +114,35 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/v2/applications`, server_client_1.Client.transformers.snakeCaseObjectKeys(filter));

}
/**
* Creates a new application with the provided details.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#createApplication}
*
* @param {Application} application - The application details to be created.
* @return {Promise<MergedApplication>} - A promise resolving to the created application.
*
* @example
* Create a new application
*
* ```ts
* const application = await applicationClient.createApplication({
* name: 'My Application',
* capabilities: {
* voice: {
* webhooks: {
* answerUrl: {
* address: 'https://example.com/answer',
* httpMethod: 'GET'
* },
* eventUrl: {
* address: 'https://example.com/event',
* httpMethod: 'POST'
* }
* }
* }
* }
* });
*
* console.log(application.id);
* ```
*/
async createApplication(application) {

@@ -45,2 +152,18 @@ const resp = await this.sendPostRequest(`${this.config.apiHost}/v2/applications`, server_client_1.Client.transformers.snakeCaseObjectKeys(application, true));

}
/**
* Retrieves an application by its unique identifier.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#getApplication}
*
* @param {string} applicationId - The unique identifier of the application to retrieve.
* @return {Promise<MergedApplication>} - A promise resolving to the retrieved application.
*
* @example
* Retrieve an application
*
* ```ts
* const application = await applicationClient.getApplication(APPLICATION_ID);
* console.log(application.name);
* ```
*/
async getApplication(applicationId) {

@@ -50,2 +173,21 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/v2/applications/${applicationId}`);

}
/**
* Updates an existing application with the provided details.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#updateApplication}
*
* @param {Application} application - The application details to be updated.
* @return {Promise<MergedApplication>} - A promise resolving to the updated application.
*
* @example
* Update an application
*
* ```ts
* const application = await applicationClient.updateApplication({
* id: APPLICATION_ID,
* name: 'My Application',
* });
* console.log(application.name);
* ```
*/
async updateApplication(application) {

@@ -55,2 +197,17 @@ const resp = await this.sendPutRequest(`${this.config.apiHost}/v2/applications/${application.id}`, server_client_1.Client.transformers.snakeCaseObjectKeys(application, true));

}
/**
* Deletes an application by its unique identifier.
*
* @see API Specification {@link https://developer.vonage.com/en/api/application.v2#deleteApplication}
*
* @param {string} applicationId - The unique identifier of the application to delete.
* @return {Promise<void>} - A promise indicating the successful deletion of the application.
*
* @example
* Delete an application
*
* ```ts
* await applicationClient.deleteApplication(APPLICATION_ID);
* ```
*/
async deleteApplication(applicationId) {

@@ -61,2 +218,1 @@ await this.sendDeleteRequest(`${this.config.apiHost}/v2/applications/${applicationId}`);

exports.Applications = Applications;
//# sourceMappingURL=applications.js.map

1

dist/enums/index.js

@@ -18,2 +18,1 @@ "use strict";

__exportStar(require("./VoiceRegions"), exports);
//# sourceMappingURL=index.js.map

@@ -0,8 +1,34 @@

/**
* Enumeration representing different voice regions.
*
* @remarks
* Selecting a region means all inbound, programmable SIP and SIP connect calls
* will be sent to the selected region unless the call is sent to a regional endpoint.
* If the call is using a regional endpoint this will override the application setting.
*/
export declare enum VoiceRegions {
/**
* @description North America - East region
*/
NA_EAST = "na-east",
/**
* @description North America - West region
*/
NA_WEST = "na-west",
/**
* @description Europe - West region
*/
EU_WEST = "eu-west",
/**
* @description Europe - East region
*/
EU_EAST = "eu-east",
/**
* @description Asia-Pacific - Singapore region
*/
APAC_SNG = "apac-sng",
/**
* @description Asia-Pacific - Australia region
*/
APAC_AUSTRALIA = "apac-australia"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VoiceRegions = void 0;
/**
* Enumeration representing different voice regions.
*
* @remarks
* Selecting a region means all inbound, programmable SIP and SIP connect calls
* will be sent to the selected region unless the call is sent to a regional endpoint.
* If the call is using a regional endpoint this will override the application setting.
*/
var VoiceRegions;
(function (VoiceRegions) {
/**
* @description North America - East region
*/
VoiceRegions["NA_EAST"] = "na-east";
/**
* @description North America - West region
*/
VoiceRegions["NA_WEST"] = "na-west";
/**
* @description Europe - West region
*/
VoiceRegions["EU_WEST"] = "eu-west";
/**
* @description Europe - East region
*/
VoiceRegions["EU_EAST"] = "eu-east";
/**
* @description Asia-Pacific - Singapore region
*/
VoiceRegions["APAC_SNG"] = "apac-sng";
/**
* @description Asia-Pacific - Australia region
*/
VoiceRegions["APAC_AUSTRALIA"] = "apac-australia";
})(VoiceRegions || (exports.VoiceRegions = VoiceRegions = {}));
//# sourceMappingURL=VoiceRegions.js.map

@@ -0,3 +1,16 @@

/**
* A library to allow management of your Vonage Applications.
*
* @remarks
* A Vonage API application contains the security and configuration information
* you need to connect to Vonage endpoints and use the Vonage APIs. Each Vonage
* application created can support multiple capabilities - for example you can
* create an Application that supports using the Voice, Messages and RTC APIs.
*
* @link https://developer.vonage.com/en/application/overview
*
* @packageDocumentation
*/
export * from './types';
export * from './enums';
export { Applications } from './applications';
export * from './applications';

@@ -17,7 +17,17 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Applications = void 0;
/**
* A library to allow management of your Vonage Applications.
*
* @remarks
* A Vonage API application contains the security and configuration information
* you need to connect to Vonage endpoints and use the Vonage APIs. Each Vonage
* application created can support multiple capabilities - for example you can
* create an Application that supports using the Voice, Messages and RTC APIs.
*
* @link https://developer.vonage.com/en/application/overview
*
* @packageDocumentation
*/
__exportStar(require("./types"), exports);
__exportStar(require("./enums"), exports);
var applications_1 = require("./applications");
Object.defineProperty(exports, "Applications", { enumerable: true, get: function () { return applications_1.Applications; } });
//# sourceMappingURL=index.js.map
__exportStar(require("./applications"), exports);

@@ -7,21 +7,79 @@ import { CapabilityBulk } from './CapabilityBulk';

import { CapabilityVoice } from './CapabilityVoice';
/**
* Represents an application configuration.
*/
export type Application = {
/**
* The application's unique ID.
*/
id?: string;
/**
* Friendly identifier for the application.
*
* @remarks
* This is not unique.
*/
name: string;
/**
* Represents the keys associated with an application.
*
*/
keys?: {
/**
* The public key for the application.
*
* @remarks
* You can find this value in your Vonage developer dashboard [https://dashboard.nexmo.com/applications]
*
*/
publicKey?: string;
privateKey?: string;
};
/**
* Represents the privacy configuration for an application
*/
privacy?: {
/**
* Share content
*
* @remarks
* If set to true, Vonage may store and use your content and data for the
* improvement of Vonage's AI-based services and technologies.
*/
improveAi: boolean;
};
/**
* Represents the capabilities configuration for an application.
*/
capabilities: {
/**
* Bulk related configuration.
*/
bulk?: CapabilityBulk;
/**
* Meetings related configuration.
*/
meetings?: CapabilityMeetings;
/**
* Messages/Dispatch related configuration.
*/
messages?: CapabilityMessages;
/**
* RTC/Conversation Service related configuration.
*/
rtc?: CapabilityRTC;
/**
* Specify the vbc capability to enable zero-rated calls for VBC number
* programmability service applications. This is always an empty object.
*/
vbc?: unknown;
/**
* Verify related configuration.
*/
verify?: CapabilityVerify;
/**
* Voice related configuration.
*/
voice?: CapabilityVoice;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Application.js.map
import { ApplicationPageResponse } from './Response';
/**
* Represents a paginated list of applications.
*/
export type ApplicationPageList = {
/**
* The total number of applications.
*/
totalItems: number;
/**
* The total number of pages returned.
*/
totalPages: number;
/**
* The number of applications per page.
*/
pageSize: number;
} & ApplicationPageResponse;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ApplicationPageList.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
/**
* Represents a bulk capability configuration containing webhooks.
*/
export type CapabilityBulk = {
/**
* Webhook configuration for proactive-connect related events.
*/
webhooks: {
/**
* URL for listing status related to bulk operations.
*/
listStatusUrl: CapabilityWebhook;
/**
* URL for running status related to bulk operations.
*/
runStatusUrl: CapabilityWebhook;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityBulk.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
/**
* Represents the meetings-related capabilities configuration for an application.
*/
export type CapabilityMeetings = {
/**
* Webhook configuration for meetings-related events.
*/
webhooks: {
/**
* Webhook for events related to changes in meeting rooms.
*/
roomChanged: CapabilityWebhook;
/**
* Webhook for events related to changes in meeting sessions.
*/
sessionChanged: CapabilityWebhook;
/**
* Webhook for events related to changes in meeting recording.
*/
recordingChanged: CapabilityWebhook;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityMeetings.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
/**
* Represents a configuration for messaging capabilities.
*/
export type CapabilityMessages = {
/**
* Webhook configuration for inbound messages.
*/
webhooks: {
/**
* URL for handling inbound messages.
*/
inboundUrl: CapabilityWebhook;
/**
* URL for handling message status events.
*/
statusUrl: CapabilityWebhook;
};
/**
* The version of messaging capabilities ('v1' or 'v0.1').
*/
version: 'v1' | 'v0.1';
/**
* Whether to authenticate inbound media.
*/
authenticateInboundMedia: boolean;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityMessages.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
/**
* Represents a configuration for RTC (Real-Time Communication) capabilities.
*/
export type CapabilityRTC = {
/**
* Webhook configuration for RTC events.
*/
webhooks: {
/**
* URL for handling RTC events.
*/
eventUrl: CapabilityWebhook;
};
/**
* Whether to use signed callbacks for RTC.
*/
signedCallbacks: boolean;
/**
* The leg persistence time for RTC in milliseconds.
*/
legPersistenceTime: number;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityRTC.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
/**
* Represents a configuration for verification capabilities.
*/
export type CapabilityVerify = {
/**
* Webhook configuration for verification status events.
*/
webhooks: {
/**
* URL for handling verification status events.
*/
statusUrl: CapabilityWebhook;
};
/**
* The version of verification capabilities ('v2').
*/
version: 'v2';
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityVerify.js.map
import { CapabilityWebhook } from './CapabilityWebhook';
import { VoiceRegions } from "../enums";
/**
* Vonage numbers that are linked to Vonage applications will use the answer_url
* to retrieve an NCCO
*/
export type AnswerCallbackUrl = {
/**
* Socket timeout in milliseconds.
*/
socketTimeout?: number;
/**
* Connection timeout in milliseconds.
*/
connectTimeout?: number;
} & CapabilityWebhook;
/**
* Vonage numbers that are linked to Vonage applications will use the answer_url
* to retrieve an NCCO, and the event url to send call status information to you
*
* @link https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
*/
export type EventCallbackUrl = {
/**
* Socket timeout in milliseconds.
*/
socketTimeout?: number;
/**
* Connection timeout in milliseconds.
*/
connectTimeout?: number;
} & CapabilityWebhook;
/**
* The fallback answer url can optionally be configured. This is used when
* answer url is offline or returning an HTTP error code.
*
* @link https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
*/
export type FallbackAnswerUrl = {
/**
* Socket timeout in milliseconds.
*/
socketTimeout?: number;
/**
* Connection timeout in milliseconds.
*/
connectTimeout?: number;
} & CapabilityWebhook;
/**
* Represents the voice-related capabilities configuration for an application.
*
* @link https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
*/
export type CapabilityVoice = {
/**
* Webhook configuration for voice events.
*/
webhooks: {
eventUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhook;
answerUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhook;
fallbackAnswerUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhook;
/**
* Webhook for events related to voice calls.
*/
eventUrl: EventCallbackUrl;
/**
* Webhook for voice call answer events.
*/
answerUrl: AnswerCallbackUrl;
/**
* Webhook for fallback voice call answer events.
*/
fallbackAnswerUrl: FallbackAnswerUrl;
};
/**
* Indicates whether payment is enabled.
*/
paymentEnabled: boolean;
/**
* Whether to use signed webhooks for voice events.
*
* @remarks Refer to {@link https://developer.vonage.com/en/getting-started/concepts/webhooks#decoding-signed-webhooks} for more information.
*/
signedCallbacks: boolean;
/**
* Conversation TTL
*
* @remarks The length of time named conversations will remain active for after
* creation, in hours. 0 means infinite. Maximum value is 744 (i.e., 31 days).
*/
conversationsTTL: number;
region: string;
/**
* Region to round calls
*
* @remarks
* Selecting a region means all inbound, programmable SIP and SIP connect
* calls will be sent to the selected region unless the call is sent to a
* regional endpoint. If the call is using a regional endpoint, this will
* override the application setting.
*/
region: VoiceRegions | string;
/**
* Payment gateway configuration.
*/
payments: {
/**
* List of payment gateways.
*/
gateways: Array<unknown>;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityVoice.js.map

@@ -0,4 +1,14 @@

/**
* Represents the base properties for a capability webhook configuration.
*/
export type CapabilityWebhook = {
/**
* The URL endpoint to which the webhook data will be sent.
*/
address: string;
/**
* The HTTP method to be used when sending data to the webhook endpoint.
* It can be either 'POST' or 'GET'.
*/
httpMethod: 'POST' | 'GET';
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityWebhook.js.map
export * from './Application';
export * from './ApplicationClassParameters';
export * from './ApplicationPageList';

@@ -4,0 +3,0 @@ export * from './CapabilityBulk';

@@ -18,3 +18,2 @@ "use strict";

__exportStar(require("./Application"), exports);
__exportStar(require("./ApplicationClassParameters"), exports);
__exportStar(require("./ApplicationPageList"), exports);

@@ -30,2 +29,1 @@ __exportStar(require("./CapabilityBulk"), exports);

__exportStar(require("./Response"), exports);
//# sourceMappingURL=index.js.map

@@ -0,8 +1,18 @@

/**
* Parameters for listing applications with pagination.
*/
export type ListApplicationParams = {
/**
* The size of the page for pagination.
*/
pageSize?: number;
/**
* @deprecated please use pageSize instead
* The deprecated size of the page for pagination.
*/
page_size?: number;
/**
* The specific page number for pagination.
*/
page?: number;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ListApplicationParams.js.map

@@ -0,11 +1,43 @@

import { Application } from '..';
import { ApplicationResponse } from './ApplicationResponse';
import { APILinks } from '@vonage/server-client';
/**
* Represents the response for a paginated list of applications.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*
* @link https://developer.vonage.com/en/api/application.v2#listApplication
*/
export type ApplicationPageResponse = {
/**
* The number of applications per page.
*/
page_size: number;
/**
* The current page number (starts at 1).
*/
page: number;
/**
* The total number of applications.
*/
total_items: number;
/**
* The total number of pages returned.
*/
total_pages: number;
/**
* A list of applications matching your existing filters.
*/
applications: ApplicationResponse[];
/**
* An object containing a list of applications.
*/
_embedded: {
applications: ApplicationResponse[];
/**
* A list of applications matching your existing filters.
*/
applications: Array<ApplicationResponse | Application>;
};
} & APILinks;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ApplicationPageResponse.js.map

@@ -9,18 +9,68 @@ import { APILinks } from '@vonage/server-client';

import { CapabilityMessagesResponse } from './CapabilityMessagesResponse';
/**
* Represents a response containing application information.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*
* @link https://developer.vonage.com/en/api/application.v2#getApplication
*
* @see {@link Application}
*/
export type ApplicationResponse = {
/**
* Keys associated with the application.
*/
keys: {
public_key: string;
/**
* The public key for the application.
*/
public_key?: string | undefined;
};
/**
* Privacy configuration for the application.
*/
privacy: {
improve_ai: boolean;
/**
* If set to true, Vonage may store and use your content and data for the
* improvement of Vonage's AI-based services and technologies.
*/
improve_ai?: boolean;
};
/**
* Capabilities configuration for the application.
*/
capabilities: {
/**
* RTC/Conversation Service related configuration.
*/
rtc: CapabilityRTCResponse;
/**
* Voice related configuration.
*/
voice: CapabilityVoiceResponse;
/**
* Meetings related configuration.
*/
meetings: CapabilityMeetingsResponse;
/**
* Bulk related configuration.
*/
bulk: CapabilityBulkResponse;
/**
* Messages/Dispatch related configuration.
*/
messages: CapabilityMessagesResponse;
/**
* Verify related configuration.
*/
verify: CapabilityVerifyResponse;
/**
* Specify the vbc capability to enable zero-rated calls for VBC number
* programmability service applications. This is always an empty object.
*/
vbc: unknown;
};
} & Application & APILinks;
_links?: Pick<APILinks, '_links'>;
} & Application;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ApplicationResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
/**
* Represents the response for bulk-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityBulkResponse = {
/**
* Webhook configuration for bulk events.
*/
webhooks: {
/**
* Webhook for events related to bulk list status.
*/
list_status_url: CapabilityWebhookResponse;
/**
* Webhook for events related to bulk run status.
*/
run_status_url: CapabilityWebhookResponse;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityBulkResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
/**
* Represents the response for meetings-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityMeetingsResponse = {
/**
* Webhook configuration for meetings-related events.
*/
webhooks: {
/**
* Webhook for events related to changes in meeting rooms.
*/
room_changed: CapabilityWebhookResponse;
/**
* Webhook for events related to changes in meeting sessions.
*/
session_changed: CapabilityWebhookResponse;
/**
* Webhook for events related to changes in meeting recording.
*/
recording_changed: CapabilityWebhookResponse;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityMeetingsResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
import { CapabilityMessages } from '../CapabilityMessages';
/**
* Represents the response for messages-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityMessagesResponse = {
/**
* Webhook configuration for messages-related events.
*/
webhooks: {
/**
* Webhook for inbound messages.
*/
inbound_url: CapabilityWebhookResponse;
/**
* Webhook for events related to message status.
*/
status_url: CapabilityWebhookResponse;
};
/**
* Whether to authenticate inbound media for messages.
*/
authenticate_inbound_media: boolean;
} & Omit<CapabilityMessages, 'version' | 'webhooks' | 'authenticateInboundMedia'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityMessagesResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
/**
* Represents the response for RTC-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityRTCResponse = {
/**
* Webhook configuration for RTC events.
*/
webhooks: {
/**
* Webhook for events related to RTC.
*/
event_url: CapabilityWebhookResponse;
};
/**
* Whether to use signed webhooks for RTC events.
*/
signed_callbacks: boolean;
/**
* The leg persistence time for RTC events.
*/
leg_persistence_time: number;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityRTCResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
import { CapabilityVerify } from '../CapabilityVerify';
/**
* Represents the response for verification-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityVerifyResponse = {
/**
* Webhook configuration for verification events.
*/
webhooks: {
/**
* Webhook for events related to verification status.
*/
status_url: CapabilityWebhookResponse;
};
} & Omit<CapabilityVerify, 'webhooks'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityVerifyResponse.js.map
import { CapabilityWebhookResponse } from './CapabilityWebhookResponse';
import { CapabilityVoice } from '../CapabilityVoice';
/**
* Event URL configuration response
*
* @see {@link EventCallbackUrl}
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type EventUrlResponse = {
/**
* Socket timeout in milliseconds.
*/
socketTimeout?: number;
/**
* Connection timeout in milliseconds.
*/
connectTimeout?: number;
} & CapabilityWebhookResponse;
/**
* Answer URL configuration response
*
* @see {@link AnswerCallbackUrl}
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type AnswerUrlResponse = {
/**
* Socket timeout in milliseconds.
*/
socket_timeout?: number;
/**
* Connection timeout in milliseconds.
*/
connect_timeout?: number;
} & CapabilityWebhookResponse;
/**
* Fallback URL configuration response
*
* @see {@link FallbackAnswerUrlResponse}
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type FallbackAnswerUrlResponse = {
/**
* Socket timeout in milliseconds.
*/
socket_timeout?: number;
/**
* Connection timeout in milliseconds.
*/
connect_timeout?: number;
} & CapabilityWebhookResponse;
/**
* Represents the response for voice-related capabilities configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*/
export type CapabilityVoiceResponse = {
/**
* Webhook configuration for voice events.
*/
webhooks: {
eventUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhookResponse;
answerUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhookResponse;
fallbackAnswerUrl: {
socketTimeout?: number;
connectTimeout?: number;
} & CapabilityWebhookResponse;
/**
* Webhook for events related to voice calls.
*/
event_url: EventUrlResponse;
/**
* Webhook for voice call answer events.
*/
answer_url: AnswerUrlResponse;
/**
* Webhook for fallback voice call answer events.
*/
fallback_answer_url: FallbackAnswerUrlResponse;
};
/**
* Indicates whether payment is enabled.
*/
payment_enabled: boolean;
/**
* Whether to use signed webhooks for voice events.
* Refer to [the Webhooks documentation](https://developer.vonage.com/en/getting-started/concepts/webhooks#decoding-signed-webhooks) for more information.
*/
signed_callbacks: boolean;
/**
* The length of time named conversations will remain active for after creation, in hours.
* 0 means infinite. Maximum value is 744 (i.e., 31 days).
*/
conversations_ttl: number;
} & Omit<CapabilityVoice, 'webhooks' | 'paymentEnabled' | 'signedCallbacks' | 'conversationsTTL'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityVoiceResponse.js.map
import { CapabilityWebhook } from '../CapabilityWebhook';
/**
* Represents the response for a capability webhook configuration.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`
*
* @see {@link CapabilityWebhook}
*/
export type CapabilityWebhookResponse = {
/**
* The HTTP method to be used when sending data to the webhook endpoint. It can be either 'POST' or 'GET'.
*/
http_method: 'POST' | 'GET';
} & Omit<CapabilityWebhook, 'httpMethod'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CapabilityWebhookResponse.js.map

@@ -26,2 +26,1 @@ "use strict";

__exportStar(require("./CapabilityWebhookResponse"), exports);
//# sourceMappingURL=index.js.map
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@vonage/applications",
"version": "1.9.0",
"version": "1.10.0",
"description": "Vonage Applications API",

@@ -17,3 +18,12 @@ "keywords": [

"license": "Apache-2.0",
"author": "Chris Tankersley <chris@ctankersley.com>",
"contributors": [
{
"name": "Chris Tankersley",
"url": "https://github.com/dragonmantank"
},
{
"name": "Chuck \"MANCHUCK\" Reeves",
"url": "https://github.com/manchuck"
}
],
"main": "dist/index.js",

@@ -31,8 +41,8 @@ "types": "dist/index.d.ts",

"clean": "npx shx rm -rf dist tsconfig.tsbuildinfo",
"compile": "npx tsc --build --verbose"
"compile": "npx tsc --build --verbose",
"prepublishOnly": "npm run build"
},
"dependencies": {
"@vonage/auth": "^1.7.0",
"@vonage/server-client": "^1.9.0",
"@vonage/vetch": "^1.6.0"
"@vonage/auth": "^1.8.0",
"@vonage/server-client": "^1.10.0"
},

@@ -44,4 +54,3 @@ "devDependencies": {

"directory": "dist"
},
"gitHead": "328f18e5c8a458cb4d06d7955ec2399a6ce6f5d8"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc