Observed since 20 Oct, 19:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
365farmnet
Node.js client for the 365FarmNet Connect REST API
A simple promise based client for the 365FarmNet Connect REST API.
npm install 365farmnet
Note: This library requires Node.js > v.10.0
Import the library, and pass the partner ID and secret that you got from registering at https://devcon.365farmnet.com/.
const farmnet = require('365farmnet')({
partnerId: 'yourPartnerId',
secret: 'yourPartnerSecret'
})
Make requests to the 365FarmNet Connect REST API by calling the imported function
(farmnet if you follow this example) in the following manner:
// farmnettoken is the JWT that is passed to the iframe within the
// 365FarmNet main application
farmnet('fields', {
token: farmnettoken,
params: {
includeGeometry: false,
includeSoilType: true
}
}).then(data => {
// data will contain all fields of the farm
}).catch(err => {
console.log(err)
})
The module exports a default function. It takes two arguments:
farmnet('endpoint', options)| Name | Description |
|---|---|
| endpoint string required | The REST API endpoint to call. See documentation for all available endpoints. |
| options.token string required | The token property of the options object needs to be a valid JWT farmnettoken. |
| options.params object | Optional query params for the API call. |
| options.data object | Optional body params for the API call (for POST/PUT requests). |
| options.method string | Default: 'GET'. Can be any HTTP request method valid for the given endpoint. |
Fork this repo, then put a credentials.js file in the root directory with the following content.
// content of the credentials.js file, which needs to be placed at the root of this repo
module.exports = {
partnerId: 'your_partner_id',
secret: 'your_secret'
}
Then run
npm test
This will spin up an Express.js server on http://localhost:3000/.
Login to your account at https://devcon.365farmnet.com/,
click on the Developer tab -> Developer Playground.
If all tests pass, you should see All test passed!, if not, check your console 😄
Please feel free to submit an issue or a pull request!
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.18.0 | runtime |
jsonwebtokenEnvironment{
"local_name": "jsonwebtoken",
"alias": false,
"peer_metadata": null
} | ^8.5.1 | runtime |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^5.16.0 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | 1.16.4 | development |
eslint-config-prettierEnvironment{
"local_name": "eslint-config-prettier",
"alias": false,
"peer_metadata": null
} | ^4.1.0 | development |
eslint-plugin-prettierEnvironment{
"local_name": "eslint-plugin-prettier",
"alias": false,
"peer_metadata": null
} | ^3.0.1 | development |
Source distribution
{
"shasum": "9bbd7c582e5f138a03316768d71db900cc28233a",
"tarball": "https://registry.npmjs.org/365farmnet/-/365farmnet-0.0.1.tgz",
"fileCount": 10,
"integrity": "sha512-5vMaNPIh7w5faNTfN7eaMFWtN5R1E8AW6hP6kN4w1hVz0yAG9V6uPA5wEJNN5PH+q/cOt0Xw3ywgfInOs0hC5w==",
"signatures": [
{
"sig": "MEQCIFIFxCYA8zPUCm6Bf6p1d2mrFxoyp3MNResPOnBmA2cXAiB8NZVIKQTrvOTNvaDpPDE0bqx50bvt66PGAV2DlRG68w==",
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
}
],
"unpackedSize": 10822,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsJ8JCRA9TVsSAnZWagAAx1sQAJyr7mbHkMa/FBhYmUGU\ntM4FD0pVRXAo9zs5qJgxO9atoVnLQHOv9JgNCNFzETxsP4aI+sQkv67zeaAn\nCwSMO4F5a4DhKWQU0TXz4FVZGTo2z2FV4C+I1vD7SXRIubmNO0CAJekwU58W\nWIX8XorMk3z05EOIwiGYYCKlIbXRPymxwLPjiVNmOnXuBA1COva2FSzPzWCb\nTWSlCUst1EeRxdkSRrFGpIHyNWpR/s6wfLnTzn1kep9hoge2uHS3vw7TtcB4\nynFeuLPp/jd/cHavB+Egk5U8NM+4Uefr7bezWJq0QsqzbIJiSKhw10tuC+Mh\nT+3ByCJXoO2BcGS4JSk+EUeZjVFnwvo055clLeXGLL0oX9ijhvXyzCjfcgWw\nXutpORzWalu4d3Qz1bCgRjFlg1BIHXhC/y4osYgXziHqJhyMax+IPGazhYRq\noua7TNEnjgOtpoDJtCKE2qGqpBdhRuAENUXcVF5/G4JOFaKXYSHN8pnUOaCI\nRLuTyf2IoRFpNO6I2mRyFAs9mOgqrWnlnwsJSC0cuBGsS4WJZNqbzEq903gc\nplaqq4/MgHw9fO7oPtA1zbxQS5vnfXi6G7jSqKusUHRc/x4DQ4LeSTOEWOgt\nMiNWEcEtJwoa8LHhBp60dXqqefQ08p7sY04r1/gXWGTUSqhXzuT4QiStacsf\n3YLh\r\n=WckI\r\n-----END PGP SIGNATURE-----\r\n"
}Observed since 20 Oct, 19:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:46b2f17c7b6000c71875745eb6cf5c88cb20412d17b6cd07b8ae10eb08d644bd