Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianWowra committed Jan 18, 2022
2 parents a11150f + e8eb4d5 commit a1462ad
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 84 deletions.
136 changes: 64 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,20 @@ import * as client from 'opensensemap-client';

async function start() {
// Get information about a senseBox
const r = await client
.getBox('57000b8745fd40c8196ad04c')
.catch((e) => console.error(e));
const r = await client.getBox('57000b8745fd40c8196ad04c').catch((e) => console.error(e));

console.log(JSON.stringify(r));

// Post new sensor data
const data: client.TDataPostNewMeasurements = [];
const data: client.PostNewMeasurementsData = [];
const authToken = 'Your senseBox token';

data.push({
sensor: 'Your sensorId',
value: 'Your data'
});

client
.postNewMeasurements('Your senseBoxId', data, authToken)
.catch(console.error);
client.postNewMeasurements('Your senseBoxId', data, authToken).catch(console.error);
}

start();
Expand All @@ -49,24 +45,20 @@ const client = require('opensensemap-client');

async function start() {
// Get information about a senseBox
const r = await client
.getBox('57000b8745fd40c8196ad04c')
.catch((e) => console.error(e));
const r = await client.getBox('57000b8745fd40c8196ad04c').catch((e) => console.error(e));

console.log(JSON.stringify(r));

// Post new sensor data
const data: client.PostNewMeasurementsData = [];
const data = [];
const authToken = 'Your senseBox token';

data.push({
sensor: 'Your sensorId',
value: 'Your data'
});

client
.postNewMeasurements('Your senseBoxId', data, authToken)
.catch(console.error);
client.postNewMeasurements('Your senseBoxId', data, authToken).catch(console.error);
}

start();
Expand All @@ -78,69 +70,69 @@ start();

- Introduction
- Boxes
- [Get one senseBox](https://docs.opensensemap.org/#api-Boxes-getBox)
- Function [getBox](https://killerjulian.github.io/opensensemap-client/modules.html#getBox)
- [Get all senseBoxes](https://docs.opensensemap.org/#api-Boxes-getBoxes)
- Function [getBoxes](https://killerjulian.github.io/opensensemap-client/modules.html#getBoxes)
- [Post new senseBox](https://docs.opensensemap.org/#api-Boxes-postNewBox)
- Function [postNewBox](https://killerjulian.github.io/opensensemap-client/modules.html#postNewBox)
- [Update a senseBox](https://docs.opensensemap.org/#api-Boxes-updateBox)
- Function [updateBox](https://killerjulian.github.io/opensensemap-client/modules.html#updateBox)
- [Mark a senseBox and its measurements for deletion](https://docs.opensensemap.org/#api-Boxes-deleteBox)
- Function [deleteBox](https://killerjulian.github.io/opensensemap-client/modules.html#deleteBox)
- [Download the Arduino script for your senseBox](https://docs.opensensemap.org/#api-Boxes-getSketch)
- Function [getSketch](https://killerjulian.github.io/opensensemap-client/modules.html#getSketch)
- [Get locations of a senseBox](https://docs.opensensemap.org/#api-Boxes-getBoxLocations)
- Function [getBoxLocations](https://killerjulian.github.io/opensensemap-client/modules.html#getBoxLocations)
- [Get one senseBox](https://docs.opensensemap.org/#api-Boxes-getBox)
- Function [getBox](https://killerjulian.github.io/opensensemap-client/modules.html#getBox)
- [Get all senseBoxes](https://docs.opensensemap.org/#api-Boxes-getBoxes)
- Function [getBoxes](https://killerjulian.github.io/opensensemap-client/modules.html#getBoxes)
- [Post new senseBox](https://docs.opensensemap.org/#api-Boxes-postNewBox)
- Function [postNewBox](https://killerjulian.github.io/opensensemap-client/modules.html#postNewBox)
- [Update a senseBox](https://docs.opensensemap.org/#api-Boxes-updateBox)
- Function [updateBox](https://killerjulian.github.io/opensensemap-client/modules.html#updateBox)
- [Mark a senseBox and its measurements for deletion](https://docs.opensensemap.org/#api-Boxes-deleteBox)
- Function [deleteBox](https://killerjulian.github.io/opensensemap-client/modules.html#deleteBox)
- [Download the Arduino script for your senseBox](https://docs.opensensemap.org/#api-Boxes-getSketch)
- Function [getSketch](https://killerjulian.github.io/opensensemap-client/modules.html#getSketch)
- [Get locations of a senseBox](https://docs.opensensemap.org/#api-Boxes-getBoxLocations)
- Function [getBoxLocations](https://killerjulian.github.io/opensensemap-client/modules.html#getBoxLocations)
- Interpolation
- [Get a Inverse Distance Weighting Interpolation as FeatureCollection](https://docs.opensensemap.org/#api-Interpolation-calculateIdw)
- Function [calculateIdw](https://killerjulian.github.io/opensensemap-client/modules.html#calculateIdw)
- [Get a Inverse Distance Weighting Interpolation as FeatureCollection](https://docs.opensensemap.org/#api-Interpolation-calculateIdw)
- Function [calculateIdw](https://killerjulian.github.io/opensensemap-client/modules.html#calculateIdw)
- Measurements
- [Post new measurement](https://docs.opensensemap.org/#api-Measurements-postNewMeasurement)
- Function [postNewMeasurement](https://killerjulian.github.io/opensensemap-client/modules.html#postNewMeasurement)
- [Get the 10000 latest measurements for a sensor](https://docs.opensensemap.org/#api-Measurements-getData)
- Function [getData](https://killerjulian.github.io/opensensemap-client/modules.html#getData)
- [Delete measurements of a sensor](https://docs.opensensemap.org/#api-Measurements-deleteMeasurements)
- Function [deleteMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#deleteMeasurements)
- [Get latest measurements for a phenomenon as CSV](https://docs.opensensemap.org/#api-Measurements-getDataMulti)
- Function [getDataMulti](https://killerjulian.github.io/opensensemap-client/modules.html#getDataMulti)
- [Get latest measurements of a senseBox](https://docs.opensensemap.org/#api-Measurements-getLatestMeasurements)
- Function [getLatestMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#getLatestMeasurements)
- [Post multiple new measurements](https://docs.opensensemap.org/#api-Measurements-postNewMeasurements)
- Function [postNewMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#postNewMeasurements)
- [Post new measurement](https://docs.opensensemap.org/#api-Measurements-postNewMeasurement)
- Function [postNewMeasurement](https://killerjulian.github.io/opensensemap-client/modules.html#postNewMeasurement)
- [Get the 10000 latest measurements for a sensor](https://docs.opensensemap.org/#api-Measurements-getData)
- Function [getData](https://killerjulian.github.io/opensensemap-client/modules.html#getData)
- [Delete measurements of a sensor](https://docs.opensensemap.org/#api-Measurements-deleteMeasurements)
- Function [deleteMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#deleteMeasurements)
- [Get latest measurements for a phenomenon as CSV](https://docs.opensensemap.org/#api-Measurements-getDataMulti)
- Function [getDataMulti](https://killerjulian.github.io/opensensemap-client/modules.html#getDataMulti)
- [Get latest measurements of a senseBox](https://docs.opensensemap.org/#api-Measurements-getLatestMeasurements)
- Function [getLatestMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#getLatestMeasurements)
- [Post multiple new measurements](https://docs.opensensemap.org/#api-Measurements-postNewMeasurements)
- Function [postNewMeasurements](https://killerjulian.github.io/opensensemap-client/modules.html#postNewMeasurements)
- Misc
- [Get some statistics about the database](https://docs.opensensemap.org/#api-Misc-getStatistics)
- Function [getStatistics](https://killerjulian.github.io/opensensemap-client/modules.html#getStatistics)
- [print all routes](https://docs.opensensemap.org/#api-Misc-printRoutes)
- Function [printRoutes](https://killerjulian.github.io/opensensemap-client/modules.html#printRoutes)
- [Get some statistics about the database](https://docs.opensensemap.org/#api-Misc-getStatistics)
- Function [getStatistics](https://killerjulian.github.io/opensensemap-client/modules.html#getStatistics)
- [print all routes](https://docs.opensensemap.org/#api-Misc-printRoutes)
- Function [printRoutes](https://killerjulian.github.io/opensensemap-client/modules.html#printRoutes)
- Statistics
- [Compute basic descriptive statistics over specified time windows](https://docs.opensensemap.org/#api-Statistics-descriptive)
- Function [descriptive](https://killerjulian.github.io/opensensemap-client/modules.html#descriptive)
- [Compute basic descriptive statistics over specified time windows](https://docs.opensensemap.org/#api-Statistics-descriptive)
- Function [descriptive](https://killerjulian.github.io/opensensemap-client/modules.html#descriptive)
- Users
- [Register new](https://docs.opensensemap.org/#api-Users-register)
- Function [register](https://killerjulian.github.io/opensensemap-client/modules.html#register)
- [Delete user, all of its boxes and all of its boxes measurements](https://docs.opensensemap.org/#api-Users-deleteUser)
- Function [deleteUser](https://killerjulian.github.io/opensensemap-client/modules.html#deleteUser)
- [Get details](https://docs.opensensemap.org/#api-Users-getUser)
- Function [getUser](https://killerjulian.github.io/opensensemap-client/modules.html#getUser)
- [Refresh Authorization](https://docs.opensensemap.org/#api-Users-refresh_auth)
- Function [refreshAuth](https://killerjulian.github.io/opensensemap-client/modules.html#refreshAuth)
- [Sing in](https://docs.opensensemap.org/#api-Users-sign_in)
- Function [singIn](https://killerjulian.github.io/opensensemap-client/modules.html#singIn)
- [Sing out](https://docs.opensensemap.org/#api-Users-sign_out)
- Function [singOut](https://killerjulian.github.io/opensensemap-client/modules.html#singOut)
- [Update user details](https://docs.opensensemap.org/#api-Users-updateUser)
- Function [updateUser](https://killerjulian.github.io/opensensemap-client/modules.html#updateUser)
- [confirm email address](https://docs.opensensemap.org/#api-Users-confirm_email)
- Function [confirmEmail](https://killerjulian.github.io/opensensemap-client/modules.html#confirmEmail)
- [list all boxes of the signed in user](https://docs.opensensemap.org/#api-Users-getUserBoxes)
- Function [getUserBoxes](https://killerjulian.github.io/opensensemap-client/modules.html#getUserBoxes)
- [request a resend of the email confirmation](https://docs.opensensemap.org/#api-Users-resend_email_confirmation)
- Function [resendEmailConfirmation](https://killerjulian.github.io/opensensemap-client/modules.html#resendEmailConfirmation)
- [request password reset](https://docs.opensensemap.org/#api-Users-request_password_reset)
- Function [requestPasswordReset](https://killerjulian.github.io/opensensemap-client/modules.html#requestPasswordReset)
- [reset password with passwordResetToken](https://docs.opensensemap.org/#api-Users-password_reset)
- Function [passwordReset](https://killerjulian.github.io/opensensemap-client/modules.html#passwordReset)
- [Register new](https://docs.opensensemap.org/#api-Users-register)
- Function [register](https://killerjulian.github.io/opensensemap-client/modules.html#register)
- [Delete user, all of its boxes and all of its boxes measurements](https://docs.opensensemap.org/#api-Users-deleteUser)
- Function [deleteUser](https://killerjulian.github.io/opensensemap-client/modules.html#deleteUser)
- [Get details](https://docs.opensensemap.org/#api-Users-getUser)
- Function [getUser](https://killerjulian.github.io/opensensemap-client/modules.html#getUser)
- [Refresh Authorization](https://docs.opensensemap.org/#api-Users-refresh_auth)
- Function [refreshAuth](https://killerjulian.github.io/opensensemap-client/modules.html#refreshAuth)
- [Sing in](https://docs.opensensemap.org/#api-Users-sign_in)
- Function [singIn](https://killerjulian.github.io/opensensemap-client/modules.html#singIn)
- [Sing out](https://docs.opensensemap.org/#api-Users-sign_out)
- Function [singOut](https://killerjulian.github.io/opensensemap-client/modules.html#singOut)
- [Update user details](https://docs.opensensemap.org/#api-Users-updateUser)
- Function [updateUser](https://killerjulian.github.io/opensensemap-client/modules.html#updateUser)
- [confirm email address](https://docs.opensensemap.org/#api-Users-confirm_email)
- Function [confirmEmail](https://killerjulian.github.io/opensensemap-client/modules.html#confirmEmail)
- [list all boxes of the signed in user](https://docs.opensensemap.org/#api-Users-getUserBoxes)
- Function [getUserBoxes](https://killerjulian.github.io/opensensemap-client/modules.html#getUserBoxes)
- [request a resend of the email confirmation](https://docs.opensensemap.org/#api-Users-resend_email_confirmation)
- Function [resendEmailConfirmation](https://killerjulian.github.io/opensensemap-client/modules.html#resendEmailConfirmation)
- [request password reset](https://docs.opensensemap.org/#api-Users-request_password_reset)
- Function [requestPasswordReset](https://killerjulian.github.io/opensensemap-client/modules.html#requestPasswordReset)
- [reset password with passwordResetToken](https://docs.opensensemap.org/#api-Users-password_reset)
- Function [passwordReset](https://killerjulian.github.io/opensensemap-client/modules.html#passwordReset)

---

Expand Down
8 changes: 2 additions & 6 deletions examples/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ const client = require('../../dist/index');

async function start() {
// Get information about a senseBox
const r = await client
.getBox('57000b8745fd40c8196ad04c')
.catch((e) => console.error(e));
const r = await client.getBox('57000b8745fd40c8196ad04c').catch((e) => console.error(e));

console.log(JSON.stringify(r));

Expand All @@ -18,9 +16,7 @@ async function start() {
value: 'Your data'
});

client
.postNewMeasurements('Your senseBoxId', data, authToken)
.catch(console.error);
client.postNewMeasurements('Your senseBoxId', data, authToken).catch(console.error);
}

start();
8 changes: 2 additions & 6 deletions examples/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import * as client from '../../dist/index';

async function start() {
// Get information about a senseBox
const r = await client
.getBox('57000b8745fd40c8196ad04c')
.catch((e) => console.error(e));
const r = await client.getBox('57000b8745fd40c8196ad04c').catch((e) => console.error(e));

console.log(JSON.stringify(r));

Expand All @@ -17,9 +15,7 @@ async function start() {
value: 'Your data'
});

client
.postNewMeasurements('Your senseBoxId', data, authToken)
.catch(console.error);
client.postNewMeasurements('Your senseBoxId', data, authToken).catch(console.error);
}

start();

0 comments on commit a1462ad

Please sign in to comment.