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

sencrop-js-api-client

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sencrop-js-api-client - npm Package Compare versions

Comparing version 1.0.0 to 1.1.1

test/index.spec.js

42

.readme/API.md

@@ -17,2 +17,3 @@ # API

* [~postVerify(parameters, options)](#module_API..postVerify) ⇒ <code>Object</code>
* [~getPartnerDevices(parameters, options)](#module_API..getPartnerDevices) ⇒ <code>Object</code>
* [~postUser(parameters, options)](#module_API..postUser) ⇒ <code>Object</code>

@@ -163,2 +164,19 @@ * [~getUser(parameters, options)](#module_API..getUser) ⇒ <code>Object</code>

<a name="module_API..getPartnerDevices"></a>
### API~getPartnerDevices(parameters, options) ⇒ <code>Object</code>
Retrieves the devices a partner has access to.
**Kind**: inner method of [<code>API</code>](#module_API)
**Returns**: <code>Object</code> - The HTTP response
| Param | Type | Description |
| --- | --- | --- |
| parameters | <code>Object</code> | The parameters to provide (destructured) |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |
| parameters.partnerId | <code>number</code> | The partner organisation id, |
| parameters.limit | <code>number</code> | The number of items to retrieve, |
| parameters.start | <code>number</code> | The index in results |
| options | <code>Object</code> | Options to override Axios request configuration |
<a name="module_API..postUser"></a>

@@ -512,3 +530,3 @@

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -529,3 +547,3 @@ | options | <code>Object</code> | Options to override Axios request configuration |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -547,3 +565,3 @@ | parameters.body | <code>object</code> | The user device |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.sharesType | <code>string</code> | The shares type, |

@@ -566,3 +584,3 @@ | parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -586,3 +604,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -606,3 +624,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -626,3 +644,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -646,3 +664,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -666,3 +684,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -685,3 +703,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -704,3 +722,4 @@ | parameters.date | <code>string</code> | The summary date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.date | <code>string</code> | Date of the forecasts, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -723,2 +742,3 @@ | options | <code>Object</code> | Options to override Axios request configuration |

| parameters.longitude | <code>number</code> | The longitude of the forecasts, |
| parameters.date | <code>string</code> | Date of the forecasts, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -725,0 +745,0 @@ | options | <code>Object</code> | Options to override Axios request configuration |

@@ -19,2 +19,6 @@ 'use strict';

}
API.paths[operation.path][operation.method].tags =
(operation.tags || []).filter(t => !(t.startsWith('memx') || t.startsWith('tx')));
paths[operation.path] = paths[operation.path] || {};

@@ -21,0 +25,0 @@ paths[operation.path][operation.method] =

@@ -0,1 +1,22 @@

<a name="1.1.1"></a>
## [1.1.1](https://github.com/sencrop/sencrop-js-api-client/compare/v1.1.0...v1.1.1) (2017-11-30)
<a name="1.1.0"></a>
# [1.1.0](https://github.com/sencrop/sencrop-js-api-client/compare/v1.0.0...v1.1.0) (2017-11-30)
### Features
* **swagger:** Update to the last version ([0681a65](https://github.com/sencrop/sencrop-js-api-client/commit/0681a65))
* **Swagger:** Import the last Swagger file ([8ceb5eb](https://github.com/sencrop/sencrop-js-api-client/commit/8ceb5eb))
### BREAKING CHANGES
* **swagger:** You wont be able to hit the device forecast endpoint without a date param
<a name="1.0.0"></a>

@@ -2,0 +23,0 @@ # 1.0.0 (2017-10-12)

{
"name": "sencrop-js-api-client",
"version": "1.0.0",
"version": "1.1.1",
"description": "The Sencrop JavaScript API client",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -63,2 +63,3 @@ <!--

* [~postVerify(parameters, options)](#module_API..postVerify) ⇒ <code>Object</code>
* [~getPartnerDevices(parameters, options)](#module_API..getPartnerDevices) ⇒ <code>Object</code>
* [~postUser(parameters, options)](#module_API..postUser) ⇒ <code>Object</code>

@@ -209,2 +210,19 @@ * [~getUser(parameters, options)](#module_API..getUser) ⇒ <code>Object</code>

<a name="module_API..getPartnerDevices"></a>
### API~getPartnerDevices(parameters, options) ⇒ <code>Object</code>
Retrieves the devices a partner has access to.
**Kind**: inner method of [<code>API</code>](#module_API)
**Returns**: <code>Object</code> - The HTTP response
| Param | Type | Description |
| --- | --- | --- |
| parameters | <code>Object</code> | The parameters to provide (destructured) |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |
| parameters.partnerId | <code>number</code> | The partner organisation id, |
| parameters.limit | <code>number</code> | The number of items to retrieve, |
| parameters.start | <code>number</code> | The index in results |
| options | <code>Object</code> | Options to override Axios request configuration |
<a name="module_API..postUser"></a>

@@ -558,3 +576,3 @@

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -575,3 +593,3 @@ | options | <code>Object</code> | Options to override Axios request configuration |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -593,3 +611,3 @@ | parameters.body | <code>object</code> | The user device |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.sharesType | <code>string</code> | The shares type, |

@@ -612,3 +630,3 @@ | parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -632,3 +650,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -652,3 +670,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -672,3 +690,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -692,3 +710,3 @@ | parameters.beforeDate | <code>string</code> | The date before which the data starts being retrieved, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -712,3 +730,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -731,3 +749,3 @@ | parameters.startDate | <code>string</code> | The statistics start date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism, |

@@ -750,3 +768,4 @@ | parameters.date | <code>string</code> | The summary date, |

| parameters.userId | <code>number</code> | The user id, |
| parameters.deviceId | <code>string</code> | The device id, |
| parameters.deviceId | <code>number</code> | The device id, |
| parameters.date | <code>string</code> | Date of the forecasts, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -769,2 +788,3 @@ | options | <code>Object</code> | Options to override Axios request configuration |

| parameters.longitude | <code>number</code> | The longitude of the forecasts, |
| parameters.date | <code>string</code> | Date of the forecasts, |
| parameters.authorization | <code>string</code> | Authorization with Bearer mecanism |

@@ -771,0 +791,0 @@ | options | <code>Object</code> | Options to override Axios request configuration |

@@ -27,2 +27,3 @@

postVerify,
getPartnerDevices,
postUser,

@@ -340,2 +341,53 @@ getUser,

/**
* Retrieves the devices a partner has access to.
* @param {Object} parameters
* The parameters to provide (destructured)
* @param {string} parameters.authorization
* Authorization with Bearer mecanism,
* @param {number} parameters.partnerId
* The partner organisation id,
* @param {number} parameters.limit
* The number of items to retrieve,
* @param {number} parameters.start
* The index in results
* @param {Object} options
* Options to override Axios request configuration
* @return {Object}
* The HTTP response
*/
function getPartnerDevices({
_,
authorization,
partnerId,
limit,
start,
} = {}, options) {
const method = 'get';
let urlParts = [
'partners',
partnerId,
'devices',
];
let headers = {
Authorization: authorization,
};
let qs = cleanQuery({
limit: limit,
start: start,
});
let data = {}.undef;
return axios(Object.assign({
baseURL: 'https://api.sencrop.com/v1',
paramsSerializer: querystring.stringify.bind(querystring),
validateStatus: status => 200 <= status && 300 > status,
method: method,
url: urlParts.join('/'),
headers,
params: qs,
data,
}, options || {}));
}
/**
* Create a user.

@@ -1320,3 +1372,3 @@ * @param {Object} parameters

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1368,3 +1420,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1419,3 +1471,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1475,3 +1527,3 @@ * @param {string} parameters.sharesType

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1536,3 +1588,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1598,3 +1650,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1660,3 +1712,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1722,3 +1774,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1783,3 +1835,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1840,3 +1892,3 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,

@@ -1897,4 +1949,6 @@ * @param {string} parameters.authorization

* The user id,
* @param {string} parameters.deviceId
* @param {number} parameters.deviceId
* The device id,
* @param {string} parameters.date
* Date of the forecasts,
* @param {string} parameters.authorization

@@ -1911,2 +1965,3 @@ * Authorization with Bearer mecanism

deviceId,
date,
authorization,

@@ -1926,2 +1981,3 @@ } = {}, options) {

let qs = cleanQuery({
date: date,
});

@@ -1952,2 +2008,4 @@ let data = {}.undef;

* The longitude of the forecasts,
* @param {string} parameters.date
* Date of the forecasts,
* @param {string} parameters.authorization

@@ -1965,2 +2023,3 @@ * Authorization with Bearer mecanism

longitude,
date,
authorization,

@@ -1980,2 +2039,3 @@ } = {}, options) {

longitude: longitude,
date: date,
});

@@ -1982,0 +2042,0 @@ let data = {}.undef;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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