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

@onfleet/node-onfleet

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onfleet/node-onfleet - npm Package Compare versions

Comparing version 1.2.7 to 1.2.8

11

CHANGELOG.md

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

## [1.2.8] - 2021-10-11
### Changed
- Relocate `depleted` event handler
## [1.2.7] - 2021-08-23
### Added
- Enable passing a baseURL param to `Onfleet`'s constructor
- Enable passing `baseURL` as param to `Onfleet`'s constructor
- README in ES

@@ -95,4 +99,5 @@ - CHANGELOG

[Unreleased]: https://github.com/onfleet/node-onfleet/compare/v1.2.7...HEAD
[1.2.6]: https://github.com/onfleet/node-onfleet/compare/v1.2.6...v1.2.7
[Unreleased]: https://github.com/onfleet/node-onfleet/compare/v1.2.8...HEAD
[1.2.8]: https://github.com/onfleet/node-onfleet/compare/v1.2.7...v1.2.8
[1.2.7]: https://github.com/onfleet/node-onfleet/compare/v1.2.6...v1.2.7
[1.2.6]: https://github.com/onfleet/node-onfleet/compare/v1.2.5...v1.2.6

@@ -99,0 +104,0 @@ [1.2.5]: https://github.com/onfleet/node-onfleet/compare/v1.2.4...v1.2.5

@@ -38,2 +38,11 @@ /* eslint-disable no-console */

// On reservoir depletion, we wait 10000ms and reset the rate again (20 req/second limitation)
limiter.on('depleted', (empty) => {
if (!empty) {
wait(constants.LIMITER_WAIT_UPON_DEPLETION).then(() => {
reassignRate(constants.LIMITER_RESERVOIR);
});
}
});
/**

@@ -112,11 +121,5 @@ * The Method Factory

body: hasBody ? JSON.stringify(body) : undefined,
}).then((res) => {
// On reservoir depletion, we wait 10000ms and reset the rate again (20 req/second limitation)
limiter.on('depleted', (empty) => {
if (!empty) {
wait(constants.LIMITER_WAIT_UPON_DEPLETION).then(() => {
reassignRate(constants.LIMITER_RESERVOIR);
});
}
});
}))
.then((res) => {
// For every request, we compare the reservoir with the remainding rate limit in the header

@@ -134,2 +137,3 @@ limiter.currentReservoir()

}
return res.json().then((error) => {

@@ -156,7 +160,9 @@ // Throws custom error according to errorCode

});
}).catch((error) => {
})
.catch((error) => {
throw (error);
}));
});
};
module.exports = Methods;
{
"name": "@onfleet/node-onfleet",
"version": "1.2.7",
"version": "1.2.8",
"description": "Onfleet's Node.js API Wrapper Package",

@@ -17,2 +17,5 @@ "main": "index.js",

"author": "James Li",
"contributors": [
"Julián Pérez"
],
"license": "MIT",

@@ -19,0 +22,0 @@ "bugs": {

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