Releases: iobeam/iobeam-client-node
[0.9.0] "Error-first" style callbacks. Remove deprecated device format
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
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
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
This minor release improves sending to accurately match intended semantics. When send()
is called, all DataStore
s 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.
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
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.
Changelog
DataBatch
renamed toDataStore
. Usingiobeam.DataBatch
will give a deprecation notice.Datapoint
deprecated in favor of usingDataStore
s.- Cleanup and other improvements.
Deprecated functions and classes are subject to removal in future releases.
[0.5.5] Deps updates + rejecting reserved column names
Changelog
- Updated dependencies
- Reserved column names for a
DataBatch
are now rejected
[0.5.0] Token refresh
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
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.