Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vonage/server-client

Package Overview
Dependencies
Maintainers
51
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/server-client - npm Package Compare versions

Comparing version 1.10.3-0 to 1.10.3

28

dist/client.d.ts

@@ -39,30 +39,2 @@ import { Response } from 'node-fetch';

/**
* Adds API key and secret to the request body.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
protected addQueryKeySecretToRequestBody(request: VetchOptions): Promise<VetchOptions>;
/**
* Adds API key and secret to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
protected addQueryKeySecretToRequest(request: VetchOptions): Promise<VetchOptions>;
/**
* Adds a JWT to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
protected addJWTToRequest(request: VetchOptions): Promise<VetchOptions>;
/**
* Adds basic authentication headers to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
protected addBasicAuthToRequest(request: VetchOptions): Promise<VetchOptions>;
/**
* Sends a DELETE request to the specified URL.

@@ -69,0 +41,0 @@ *

69

dist/client.js

@@ -76,18 +76,20 @@ "use strict";

case enums_1.AuthenticationType.BASIC:
return this.addBasicAuthToRequest(request);
request.headers = Object.assign({}, request.headers, {
Authorization: await this.auth.createBasicHeader(),
});
return request;
case enums_1.AuthenticationType.JWT:
return this.addJWTToRequest(request);
case enums_1.AuthenticationType.QUERY_KEY_SECRET:
return this.addQueryKeySecretToRequest(request);
default:
return this.addQueryKeySecretToRequestBody(request);
request.headers = Object.assign({}, request.headers, {
Authorization: await this.auth.createBearerHeader(),
});
return request;
}
}
/**
* Adds API key and secret to the request body.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
async addQueryKeySecretToRequestBody(request) {
if (this.authType === enums_1.AuthenticationType.QUERY_KEY_SECRET) {
log(`adding parameters to query string`);
request.params = {
...(request.params ? request.params : {}),
...(await this.auth.getQueryParams({})),
};
return request;
}
if (typeof request.data === 'string') {

@@ -107,40 +109,2 @@ throw new Error('Cannot append auth parameters to body');

/**
* Adds API key and secret to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
async addQueryKeySecretToRequest(request) {
log(`adding parameters to query string`);
request.params = {
...(request.params ? request.params : {}),
...(await this.auth.getQueryParams({})),
};
return request;
}
/**
* Adds a JWT to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
async addJWTToRequest(request) {
request.headers = Object.assign({}, request.headers, {
Authorization: await this.auth.createBearerHeader(),
});
return request;
}
/**
* Adds basic authentication headers to the request.
*
* @param {VetchOptions} request - The request options to which authentication needs to be added.
* @return {VetchOptions} - The request options with the added authentication.
*/
async addBasicAuthToRequest(request) {
request.headers = Object.assign({}, request.headers, {
Authorization: await this.auth.createBasicHeader(),
});
return request;
}
/**
* Sends a DELETE request to the specified URL.

@@ -170,2 +134,3 @@ *

type: vetch_1.ContentType.FORM_URLENCODED,
headers: { Accept: 'application/json' },
...(payload ? { data: payload } : {}),

@@ -172,0 +137,0 @@ };

{
"$schema": "https://json.schemastore.org/package.json",
"name": "@vonage/server-client",
"version": "1.10.3-0",
"version": "1.10.3",
"description": "The Vonage Server Client provides core functionalities for interacting with Vonage APIs, ensuring a standardized response regardless of the underlying HTTP adapter.",

@@ -6,0 +6,0 @@ "homepage": "https://developer.vonage.com",

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