Skip to content

Releases: iobeam/iobeam-client-node

[0.9.0] "Error-first" style callbacks. Remove deprecated device format

26 May 19:01
Compare
Choose a tag to compare

Error first callbacks

This release is not backwards compatible with previous releases when it comes to using callbacks. The library has been updated to use the "error first" convention, where the first argument to a callback is any error, and a null or undefined value implies the operation was a success.

For register():

var dev = new iobeam.Device("foo");

// pre-v0.9.0 way:
iobeamClient.register(dev, function(success, device, error) {
    if (!success) {
        console.warn(error);
    }
});

// NEW way:
iobeamClient.register(dev, function(error, device) {
    if (error) {
        console.warn(error);
    }
});

For send():

// pre-v0.9.0 way:
iobeamClient.send(function(success, store, error) {
    if (!success) {
        console.warn(error);
    }
});

// NEW way:
iobeamClient.send(dev, function(error, store) {
    if (error) {
        console.warn(error);
    }
});

Deprecation

The value passed to register() callbacks as the device parameter no longer has the following properties: device_id, device_name, device_type, or created. Instead, since it is an iobeam.Device object, use the getter methods: getId(), getName(), getType(), and getCreated().

[0.8.1] Bug fixes and errors

24 May 18:26
Compare
Choose a tag to compare

All errors for register() and send() are now passed via the callback rather than some throwing exceptions. Additionally, this release fixes a bug where values of 0 and 0.0 were sent as null.

Changelog

  • 0 values now correctly sent
  • Server error messages for invalid permissions are now passed back via callback.

[0.7.2] Fixes for pre-Node 4

15 Apr 18:48
Compare
Choose a tag to compare

This release mainly fixes issues with older Node platforms (v0.12 and v0.10). We do recommend using the most recent LTS version of Node (v4), however.

Changelog

  • Improve callback handling for send and register
  • deps: move jest to optional
  • Fix object check to work in older Node
  • resources: Use more for loops over foreach (performance)
  • resources: Turn DataStore into a 'named' type to make instanceof work.

[0.7.1] Tweaks to sending

30 Mar 16:16
Compare
Choose a tag to compare

This minor release improves sending to accurately match intended semantics. When send() is called, all DataStores are copied and the copies are sent while the originals are reset to containing no rows. This prevents double sending data and reduces memory leaks. Also updated superagent to the most recent stable version.

Changelog

  • Update docs for iobeam and Device
  • Fix semantics of sending so batches are snapshotted.
  • deps: Update superagent to 1.8

[0.7.0] Introduce Device resource. Remove deprecated DataBatch/DataPoint.

29 Mar 20:16
Compare
Choose a tag to compare

Compatibility and Deprecation

This is a breaking release for anyone still using DataPoint or DataBatch in their code. These types have been removed and associated methods in the client have been removed. The top level package now contains 3 members: Builder, DataStore (formerly DataBatch), and Device. Due to the introduction of the Device object, some old
interfaces may print deprecation warnings (see below).

Device object

Device is a representation of devices that simplifies some interfaces so that we don't need to pass around their id, name, and type as separate parameters. These old interfaces will work for the remainder of v0.7.x series, but will be removed in a future release (possibly v0.8.0). Usage of the old interfaces will trigger deprecation warnings. To create a device object:

// Name and type are optional
var device = new iobeam.Device('my_id', 'my_name', 'my_type');

Registering from the client:

var iobeamClient = ...

// No callback
iobeamClient.register(device);

// With callback
function regCallback(success, device, error) {
    if (success) {
        console.log("New device: " + device.getId());
    } else {
        console.log(error);
    }
}
iobeamClient.register(device, regCallback);

[0.6.4] Minor fixes and additions

18 Mar 19:02
Compare
Choose a tag to compare

The last few releases have contained a number of enhancements and bug fixes, particularly when validating input to API calls. Dependency, test, and linting updates as well.

Changelog

  • endpoints: Exports now accepts more options
  • resources: Reject empty or non-string series names
  • utils: Add check for device id to match regex
  • resources: Add convenience addNow() to DataStore

[0.6.0] Deprecate Datapoint & DataBatch. Use DataStore.

05 Feb 23:15
Compare
Choose a tag to compare

Changelog

  • DataBatch renamed to DataStore. Using iobeam.DataBatch will give a deprecation notice.
  • Datapoint deprecated in favor of using DataStores.
  • Cleanup and other improvements.

Deprecated functions and classes are subject to removal in future releases.

[0.5.5] Deps updates + rejecting reserved column names

01 Feb 16:42
Compare
Choose a tag to compare

Changelog

  • Updated dependencies
  • Reserved column names for a DataBatch are now rejected

[0.5.0] Token refresh

10 Dec 01:52
Compare
Choose a tag to compare

This release contains an important update to refresh project tokens as they expire. The client checks on initialization and before API calls to see if the token has expired. If it has, a new token is fetched without user intervention.

This update is strongly recommended.

[0.4.4] Last release without token refresh

02 Dec 17:39
Compare
Choose a tag to compare

This contains a few bug fixes and dependency updates. However, the iobeam client does not check validity of project
token nor refresh it if needed. Users should be advised that they will manually have to update their token.