iot-js-sdk
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -55,2 +55,19 @@ 'use strict'; | ||
ContainerController.prototype.getAllContainers = function getAllContainers() { | ||
var result = []; | ||
return this.connection.get('/containers').then(function (data) { | ||
return data.map(function (datum) { | ||
result.push({ | ||
id: datum.id, | ||
fillLevel: datum.fillLevel, | ||
latitude: datum.latitude, | ||
longitude: datum.longitude, | ||
lastUpdated: datum.lastUpdated | ||
}); | ||
}); | ||
}).then(function () { | ||
return result; | ||
}); | ||
}; | ||
ContainerController.prototype.subscribeToContainer = function subscribeToContainer(containerId, email) { | ||
@@ -74,2 +91,2 @@ if (typeof containerId !== 'string') { | ||
exports.default = ContainerController; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250YWluZXIvY29udGFpbmVyLWNvbnRyb2xsZXIuanMiXSwibmFtZXMiOlsiQ29udGFpbmVyQ29udHJvbGxlciIsImNvbm5lY3Rpb24iLCJFcnJvciIsImdldENvbnRhaW5lciIsImlkIiwiUHJvbWlzZSIsInJlamVjdCIsImdldCIsInRoZW4iLCJkYXRhIiwiZmlsbExldmVsIiwibGF0aXR1ZGUiLCJsb25naXR1ZGUiLCJsYXN0VXBkYXRlZCIsImdldENvbnRhaW5lcnNOZWFyTWUiLCJyZXN1bHQiLCJtYXAiLCJwdXNoIiwiZGF0dW0iLCJzdWJzY3JpYmVUb0NvbnRhaW5lciIsImNvbnRhaW5lcklkIiwiZW1haWwiLCJwb3N0Il0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7O0lBRXFCQSxtQjtBQUNuQiwrQkFBWUMsVUFBWixFQUF3QjtBQUFBOztBQUN0QixRQUFJLEVBQUVBLDBDQUFGLENBQUosRUFBeUM7QUFDdkMsWUFBTSxJQUFJQyxLQUFKLENBQVUsdURBQVYsQ0FBTjtBQUNEO0FBQ0QsU0FBS0QsVUFBTCxHQUFrQ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udGFpbmVyKGNvbnRhaW5lcklkLCBlbWFpbCkge1xuICAgIGlmICh0eXBlb2YgY29udGFpbmVySWQgIT09ICdzdHJpbmcnKSB7XG4gICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QobmV3IEVycm9yKCdjb250YWluZXJJZCBwYXJhbWV0ZXIgb2YgdHlwZSBcInN0cmluZ1wiIGlzIHJlcXVpcmVkJykpO1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGVtYWlsICE9PSAnc3RyaW5nJykge1xuICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KG5ldyBFcnJvcignZW1haWwgcGFyYW1ldGVyIG9mIHR5cGUgXCJzdHJpbmdcIiBpcyByZXF1aXJlZCcpKTtcbiAgICB9XG4gICAgY29uc3QgZGF0YSA9XG4gICAgICB7XG4gICAgICAgIGlkOiBjb250YWluZXJJZCxcbiAgICAgICAgZW1haWxcbiAgICAgIH07XG4gICAgcmV0dXJuIHRoaXMuY29ubmVjdGlvbi5wb3N0KGRhdGEsICcvY29udGFpbmVycy9zdWJzY3JpYmUnKTtcbiAgfVxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250YWluZXIvY29udGFpbmVyLWNvbnRyb2xsZXIuanMiXSwibmFtZXMiOlsiQ29udGFpbmVyQ29udHJvbGxlciIsImNvbm5lY3Rpb24iLCJFcnJvciIsImdldENvbnRhaW5lciIsImlkIiwiUHJvbWlzZSIsInJlamVjdCIsImdldCIsInRoZW4iLCJkYXRhIiwiZmlsbExldmVsIiwibGF0aXR1ZGUiLCJsb25naXR1ZGUiLCJsYXN0VXBkYXRlZCIsImdldENvbnRhaW5lcnNOZWFyTWUiLCJyZXN1bHQiLCJtYXAiLCJwdXNoIiwiZGF0dW0iLCJnZXRBbGxDb250YWluZXJzIiwic3Vic2NyaWJlVG9Db250YWluZXIiLCJjb250YWluZXJJZCIsImVtYWlsI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uZ2l0dWRlLFxuICAgICAgICAgIGxhc3RVcGRhdGVkOiBkYXR1bS5sYXN0VXBkYXRlZFxuICAgICAgICB9KTtcbiAgICAgIH0pKVxuICAgICAgLnRoZW4oKCkgPT4gcmVzdWx0KTtcbiAgfVxuXG4gIHN1YnNjcmliZVRvQ29udGFpbmVyKGNvbnRhaW5lcklkLCBlbWFpbCkge1xuICAgIGlmICh0eXBlb2YgY29udGFpbmVySWQgIT09ICdzdHJpbmcnKSB7XG4gICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QobmV3IEVycm9yKCdjb250YWluZXJJZCBwYXJhbWV0ZXIgb2YgdHlwZSBcInN0cmluZ1wiIGlzIHJlcXVpcmVkJykpO1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGVtYWlsICE9PSAnc3RyaW5nJykge1xuICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KG5ldyBFcnJvcignZW1haWwgcGFyYW1ldGVyIG9mIHR5cGUgXCJzdHJpbmdcIiBpcyByZXF1aXJlZCcpKTtcbiAgICB9XG4gICAgY29uc3QgZGF0YSA9XG4gICAgICB7XG4gICAgICAgIGlkOiBjb250YWluZXJJZCxcbiAgICAgICAgZW1haWxcbiAgICAgIH07XG4gICAgcmV0dXJuIHRoaXMuY29ubmVjdGlvbi5wb3N0KGRhdGEsICcvY29udGFpbmVycy9zdWJzY3JpYmUnKTtcbiAgfVxufVxuIl19 |
{ | ||
"name": "iot-js-sdk", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "IoT JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19193
165