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

aftership

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aftership - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

20

lib/aftership.js

@@ -74,2 +74,3 @@ 'use strict';

call(method, path, options, callback) {
let _this = this;
// retrieve arguments as array

@@ -90,6 +91,19 @@ let args = [];

// Create payload with (aftership, method, path, options)
let payload = Payload(this, args[0], args[1], args[2]);
let payload = Payload(_this, args[0], args[1], args[2]);
// Handle the payload, with the callback
Handler.handlePayload(this, payload, callback);
if (callback) {
// Handle the payload, with the callback
Handler.handlePayload(_this, payload, callback);
} else {
// return Promise, is callback is not define
return new Promise(function (resolve, reject) {
Handler.handlePayload(_this, payload, function (err, result) {
if (err) {
reject(err);
} else {
resolve(result);
}
});
});
}
}

@@ -96,0 +110,0 @@

2

package.json
{
"name": "aftership",
"description": "node.js SDK for AfterShip API",
"version": "5.1.0",
"version": "5.2.0",
"homepage": "https://github.com/aftership/aftership-sdk-nodejs",

@@ -6,0 +6,0 @@ "author": {

@@ -33,2 +33,10 @@ # aftership-sdk-node

// Or do it with promise
Aftership.call('GET', '/couriers/all').then(function (result) {
console.log(result);
}).catch(function (err) {
console.log(err);
});
/** Console

@@ -54,2 +62,3 @@ { meta: { code: 200 },

- [call(method, path, options, callback)](#callmethod-path-options-callback)
- [Proxy Method](#proxy-method-get-post-put-delete)
- [Rate Limiter](#rate-limiter)

@@ -63,3 +72,2 @@ - [Retry policy](#retry-policy)

- [/notifications](#notifications)
- [Proxy Method](#proxy-method)

@@ -105,2 +113,15 @@

## Proxy Method (GET, POST, PUT, DELETE)
There are also interface `GET`, `POST`, `PUT`, `DELETE` which are proxy to `Aftership.call(...)`
```javascript
Aftership.call('GET', '/path', options, callback);
// is equivalent to
Aftership.GET('/path', options, callback);
// So as `POST`, `PUT` and `DELETE`
```
## Rate Limiter

@@ -335,14 +356,2 @@

## Proxy Method
There are also interface `GET`, `POST`, `PUT`, `DELETE` which are proxy to `Aftership.call(...)`
```javascript
Aftership.call('GET', '/path', options, callback);
// is equivalent to
Aftership.GET('/path', options, callback);
// So as `POST`, `PUT` and `DELETE`
```
## License

@@ -349,0 +358,0 @@ Copyright (c) 2016 AfterShip

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