Socket
Socket
Sign inDemoInstall

@ambassify/ambassify-client

Package Overview
Dependencies
15
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.1.0

20

CHANGELOG.md

@@ -14,2 +14,8 @@ # Changelog

## 4.1.0
#### :rocket: New Feature
- Every returned promise from requests has a `.hal.embedded('resourceName')` decorator that helps extract resources from `_embedded` on HAL responses. `const things = api.get('/list').hal.embedded('thing');`
## 4.0.0

@@ -80,1 +86,15 @@

10

lib/index.js

@@ -189,3 +189,11 @@ "use strict";

return (0, _get3["default"])((0, _getPrototypeOf2["default"])(AmbassifyApi.prototype), "request", this).call(this, method, url, query, body, options);
var promise = (0, _get3["default"])((0, _getPrototypeOf2["default"])(AmbassifyApi.prototype), "request", this).call(this, method, url, query, body, options);
promise.hal = {
embedded: function embedded(resourceName) {
return promise.then(function (res) {
return _get(res.body, "_embedded.".concat(resourceName)) || [];
});
}
};
return promise;
}

@@ -192,0 +200,0 @@ }], [{

4

package.json
{
"name": "@ambassify/ambassify-client",
"version": "4.0.0",
"version": "4.1.0",
"description": "Base API client library for all Ambassify clients",

@@ -57,3 +57,3 @@ "engines": {

"homepage": "https://github.com/ambassify/api-clients#readme",
"gitHead": "199ab9b0e0ab1cf87b103d936a1d7f861afc0d95"
"gitHead": "a05866fc9f60257ad978e7186ee1c4f53e5eaf43"
}

@@ -190,3 +190,11 @@ const _get = require('lodash/get');

return super.request(method, url, query, body, options);
const promise = super.request(method, url, query, body, options);
promise.hal = {
embedded: resourceName => promise.then(res => {
return _get(res.body, `_embedded.${resourceName}`) || [];
})
};
return promise;
}

@@ -197,1 +205,2 @@

module.exports = AmbassifyApi;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc