@sendgrid/client
Advanced tools
Comparing version 7.2.6 to 7.3.0
{ | ||
"name": "@sendgrid/client", | ||
"description": "Twilio SendGrid NodeJS API client", | ||
"version": "7.2.6", | ||
"version": "7.3.0", | ||
"author": "Twilio SendGrid <help@twilio.com> (sendgrid.com)", | ||
@@ -30,3 +30,3 @@ "contributors": [ | ||
"dependencies": { | ||
"@sendgrid/helpers": "^7.2.6", | ||
"@sendgrid/helpers": "^7.3.0", | ||
"axios": "^0.19.2" | ||
@@ -44,3 +44,3 @@ }, | ||
], | ||
"gitHead": "017fe1a56391cfe5d74c3d432881dbdc44287d41" | ||
"gitHead": "59f6cffc3d45e702ec81212238bae7bf0d704841" | ||
} |
@@ -71,2 +71,4 @@ [![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-nodejs.svg?branch=main)](https://travis-ci.org/sendgrid/sendgrid-nodejs) | ||
client.setDefaultHeader('User-Agent', 'Some user agent string'); | ||
// or | ||
client.setDefaultHeader({'User-Agent': 'Some user agent string'}); | ||
``` | ||
@@ -77,2 +79,4 @@ | ||
client.setDefaultRequest('baseUrl', 'https://api.sendgrid.com/'); | ||
// or | ||
client.setDefaultRequest({baseUrl: 'https://api.sendgrid.com/'}); | ||
``` | ||
@@ -79,0 +83,0 @@ |
@@ -75,2 +75,8 @@ 'use strict'; | ||
setDefaultHeader(key, value) { | ||
if (key !== null && typeof key === 'object') { | ||
// key is an object | ||
Object.assign(this.defaultHeaders, key); | ||
return this; | ||
} | ||
this.defaultHeaders[key] = value; | ||
@@ -81,2 +87,8 @@ return this; | ||
setDefaultRequest(key, value) { | ||
if (key !== null && typeof key === 'object') { | ||
// key is an object | ||
Object.assign(this.defaultRequest, key); | ||
return this; | ||
} | ||
this.defaultRequest[key] = value; | ||
@@ -83,0 +95,0 @@ return this; |
@@ -26,3 +26,3 @@ import {ResponseError} from "@sendgrid/helpers/classes"; | ||
*/ | ||
setDefaultHeader(key: string, value: string): this; | ||
setDefaultHeader(key: string | { [s: string]: string }, value ?: string): this; | ||
@@ -32,3 +32,3 @@ /** | ||
*/ | ||
setDefaultRequest<K extends keyof ClientRequest>(key: K, value: ClientRequest[K]): this; | ||
setDefaultRequest<K extends keyof ClientRequest>(key: K | ClientRequest, value ?: ClientRequest[K]): this; | ||
@@ -35,0 +35,0 @@ /** |
319337
3025
127
Updated@sendgrid/helpers@^7.3.0