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

@ifings/api-client

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ifings/api-client - npm Package Compare versions

Comparing version 0.13.1 to 0.14.0

43

dist/routes/frost/things.js
"use strict";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var baseUrl = "FROST-Server/v1.0/Things";

@@ -14,4 +20,41 @@

return instance.get("".concat(baseUrl, "(").concat(id, ")")).query(query);
},
aggregation: {
getById: function getById(id) {
return {
withStatus: function withStatus() {
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return instance.get("".concat(baseUrl, "(").concat(id, ")")).query(_objectSpread(_objectSpread({}, query), {}, {
$expand: "Datastreams/Observations"
})).then(function (res) {
return _objectSpread(_objectSpread({}, res), {}, {
status: res.Datastreams.reduce(function (acc, ds) {
return ds.Observations.length !== 0 && acc === true;
}, true) ? "online" : "offline"
});
});
}
};
},
getAll: function getAll() {
return {
withStatus: function withStatus() {
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return instance.get(baseUrl).query(_objectSpread(_objectSpread({}, query), {}, {
$expand: "Datastreams/Observations"
})).then(function (res) {
return res.map(function (thing) {
var status = thing.Datastreams.reduce(function (acc, ds) {
return ds.Observations.length !== 0 && acc === true;
}, true);
return _objectSpread(_objectSpread({}, thing), {}, {
status: status ? "online" : "offline"
});
});
});
}
};
}
}
};
};

2

package.json
{
"name": "@ifings/api-client",
"description": "iFings API client",
"version": "0.13.1",
"version": "0.14.0",
"main": "dist/index.js",

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

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