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

pitney-bowes

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pitney-bowes - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

6

CHANGELOG.md

@@ -9,5 +9,9 @@ # Changelog

## [0.3.1] - 2021-08-13
### Added
- Added support for creating manifests: https://shipping.pitneybowes.com/api/post-manifests.html
## [0.3.0] - 2021-07-31
### Changed
- Changed the default base URL for the sandbox environment to match https://shipping.pitneybowes.com/overview.html#sandbox-environment
- Changed the way OAuth tokens are cached so that they vary by environment.
- Changed the way OAuth tokens are cached so they vary by environment.

@@ -55,2 +55,36 @@ const cache = require('memory-cache');

this.createManifest = function(manifest, _options, callback) {
this.getOAuthToken(function(err, oAuthToken) {
if (err) {
return callback(err);
}
const req = {
auth: {
bearer: oAuthToken.access_token
},
headers: {},
json: manifest,
method: 'POST',
url: `${options.baseUrl}/v1/manifests`
};
if (_options.transactionId) {
req.headers['X-PB-TransactionId'] = _options.transactionId;
}
request(req, function(err, res, body) {
if (err) {
return callback(err);
}
if (res.statusCode !== 201) {
return callback(createError(res.statusCode, body && body.length && body[0].message ? body[0] : body));
}
callback(null, body);
});
});
};
this.getOAuthToken = function(callback) {

@@ -57,0 +91,0 @@ const url = `${options.baseUrl.replace('/shippingservices', '')}/oauth/token`;

2

package.json

@@ -30,3 +30,3 @@ {

},
"version": "0.3.0"
"version": "0.3.1"
}
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