Comparing version 3.0.4 to 3.1.0
@@ -15,2 +15,3 @@ /* | ||
const clone = require('lodash.clone'); | ||
const merge = require('lodash.merge'); | ||
const isPlainObject = require('lodash.isplainobject'); | ||
@@ -49,2 +50,3 @@ | ||
); | ||
this.globalReqOptions = options.globalReqOptions || {}; | ||
} | ||
@@ -78,3 +80,10 @@ /** | ||
_processRequest(options, callback) { | ||
this.AuthClient.getAccessToken(clone(options.auth)) | ||
const requestOptions = merge( | ||
{}, | ||
this.globalReqOptions, | ||
options.auth | ||
); | ||
this.AuthClient.getAccessToken(requestOptions) | ||
.then(tokenInfo => { | ||
@@ -115,4 +124,8 @@ if (!tokenInfo.accessToken) { | ||
_makeRequest(consolidatedOpts, callback) { | ||
const requestOptions = consolidatedOpts.req; | ||
const requestOptions = merge( | ||
{}, | ||
this.globalReqOptions, | ||
consolidatedOpts.req | ||
); | ||
request(requestOptions, (err, res, body) => { | ||
@@ -119,0 +132,0 @@ let parsedBody; |
{ | ||
"name": "fuel-rest", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "Node library for performing REST API calls to Salesforce Marketing Cloud (formerly ExactTarget).", | ||
@@ -35,7 +35,8 @@ "main": "./lib/fuel-rest.js", | ||
"dependencies": { | ||
"fuel-auth": "^3.0.2", | ||
"fuel-auth": "3.1.0", | ||
"lodash.clone": "~4.5.0", | ||
"lodash.isplainobject": "~4.0.4", | ||
"request": "~2.87.0" | ||
"lodash.merge": "^4.6.1", | ||
"request": "~2.88.0" | ||
} | ||
} |
@@ -38,2 +38,6 @@ Fuel REST Client (for Node.js) [![Build Status](https://travis-ci.org/salesforce-marketingcloud/FuelSDK-Node-REST.svg?branch=master)](https://travis-ci.org/salesforce-marketingcloud/FuelSDK-Node-REST) [![Greenkeeper badge](https://badges.greenkeeper.io/salesforce-marketingcloud/FuelSDK-Node-REST.svg)](https://greenkeeper.io/) | ||
* set headers that apply to all REST requests (not auth requests) | ||
* `options.globalReqOptions` | ||
* Required: no | ||
* Type: `Object` | ||
* set configuration options that apply to all requests (auth + REST) | ||
@@ -40,0 +44,0 @@ ## API |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242
148
66427
5
+ Addedlodash.merge@^4.6.1
+ Addedfuel-auth@3.1.0(transitive)
- Removedajv@5.5.2(transitive)
- Removedco@4.6.0(transitive)
- Removedfast-deep-equal@1.1.0(transitive)
- Removedfuel-auth@3.3.0(transitive)
- Removedhar-validator@5.0.3(transitive)
- Removedjson-schema-traverse@0.3.1(transitive)
- Removedoauth-sign@0.8.2(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedrequest@2.87.0(transitive)
- Removedtough-cookie@2.3.4(transitive)
Updatedfuel-auth@3.1.0
Updatedrequest@~2.88.0