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

ma3route-sdk

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ma3route-sdk - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

Makefile

10

CHANGELOG.md

@@ -9,2 +9,12 @@ # Change Log

## 2.2.0 - 2022-05-29
Added:
* Added methods:
* `drivingReports.getTags()`: Fetch tags for driving reports.
* `trafficUpdates.getTags()`: Fetch tags for traffic updates.
## 2.1.0 - 2021-06-20

@@ -11,0 +21,0 @@

@@ -53,2 +53,11 @@ /**

),
/**
* Retrieve tags for driving reports
* @type {itemsGetRequest}
*/
getTags: generate.newGet("drivingreports/tags", {
allowable: ["timeFilter"],
apiVersion: 3,
camelcase: false,
}),
};

26

lib/generate.js

@@ -32,6 +32,17 @@ /**

* @param {Endpoint} endpoint
* @param {String[]} [allowable]
* @param {Object} [options]
* @param {String[]} [options.allowable]
* @param {Number} [options.apiVersion=2] API version used
* @param {Boolean} [options.camelcase=true]
* @return {itemsGetRequest}
*/
function newGet(endpoint, allowable) {
function newGet(endpoint, options) {
// for backwards-compatibility <= 2.1.0
if (_.isArray(options)) {
options = { allowable: options };
}
options = _.defaultsDeep({}, options, {
allowable: [],
});
return function(params, callback) {

@@ -43,2 +54,3 @@ // allow options params

utils.setup(),
options,
this,

@@ -58,3 +70,7 @@ args.params,

// remove params that are not allowed
args.params = utils.pickParams(args.params, allowable);
args.params = utils.pickParams(
args.params,
options.allowable,
options.camelcase
);
// add the params as querystring to the URI

@@ -64,3 +80,5 @@ utils.addQueries(uri, args.params);

try {
auth.sign(authOptions.key, authOptions.secret, uri);
auth.sign(authOptions.key, authOptions.secret, uri, undefined, {
apiVersion: uriOptions.apiVersion,
});
} catch (err) {

@@ -67,0 +85,0 @@ return args.callback(err);

@@ -53,2 +53,11 @@ /**

getSeverityLevels: generate.newGet("severity", []),
/**
* Retrieve tags for traffic updates
* @type {itemsGetRequest}
*/
getTags: generate.newGet("trafficupdates/tags", {
allowable: ["timeFilter", "townId"],
apiVersion: 3,
camelcase: false,
}),
};

5

lib/utils.js

@@ -499,3 +499,4 @@ /**

*/
function pickParams(params, keys) {
function pickParams(params, keys, camelcase) {
camelcase = camelcase === undefined ? true : camelcase;
params = _.cloneDeep(params);

@@ -508,3 +509,3 @@ // decamelize all options

// 'base64String': introduced by 'image.upload()'
if (["base64String"].indexOf(key) === -1) {
if (["base64String"].indexOf(key) === -1 && camelcase) {
key = decamelize(key, "_");

@@ -511,0 +512,0 @@ }

{
"name": "ma3route-sdk",
"version": "2.1.0",
"version": "2.2.0",
"description": "Node.js SDK for developing with the Ma3Route REST API",

@@ -5,0 +5,0 @@ "repository": {

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