Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@senx/warp10

senx1.1kApache-2.02.0.3TypeScript support: included

Warp 10 NodeJS library

web, web components, time series, warp10, Warp 10, WarpScript, Geo Times Series, Times Series

readme

npm version

Warp 10 Node lib

Node.js library that helps to interact with Warp 10.

APIDoc

Installation

npm i @senx/warp10
yarn add @senx/warp10

Dates and formats

Date format: UTC ISO8601 strings (YYYY-MM-DDTHH:MM:SS.SSSSSSZ)

Available fetch formats:

  • text
  • fulltext
  • json
  • tsv
  • fulltsv
  • pack
  • raw
  • formatted (a json format, default)

Usage sample

import {Warp10} from "@senx/warp10";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
dayjs.extend(utc);

const writeToken = 'xxxxxx';
const deleteToken = 'xxxxxx';
const readToken = 'xxxx';
const w10 = new Warp10().endpoint('https://sandbox.senx.io');
// or const w10 = new Warp10({endpoint: 'https://sandbox.senx.io'});


const test = async () => {

  // WarpScript execution
  console.log(await w10.exec('2 2 +'));

  // fetch raw data between 2 dates 
  console.log(await w10.fetch(readToken, '~io.warp10.*', {}, '2019-11-11T12:34:43.388409Z', dayjs().toISOString()));

  // insert data points
  console.log(await w10.update(writeToken, [
    {timestamp: dayjs().utc().valueOf() * 1000, className: 'io.warp10.test', labels: {key: 'value'}, value: 54},
    '1380475081000000// io.warp10.test{key=value} T',
    '1566893344654882/48.81:-4.147/124 io.warp10.test{key=value} [8.2 151 152 1568189745655509/40.6:-74/14 ]',
  ]));

  // write meta
  console.log(await w10.meta(writeToken, [{
    className: 'io.warp10.test',
    labels: {key: 'value'},
    attributes: {attr: 'value'}
  }]));

  // Fetch data with a time span
  console.log(await w10.fetch(readToken, '~.*', {}, dayjs().toISOString(), 86400000000 * 5));

  // delete data between 2 dates
  console.log(await w10.delete(deleteToken, '~io.warp10.test*', {key: 'value'}, '2019-11-11T12:34:43.388409Z', dayjs().toISOString()));

  // delete all
  console.log(await w10.delete(deleteToken, '~io.warp10.test*', {key: 'value'}, '', '', true));
};

test().then(() => {

});

changelog

Warp 10 js lib

v2.0.0

  • 2023/10/24 | v2.0.1
  • 2023/10/24 | Update package
  • 2023/10/24 | Update doc and changelog
  • 2023/10/24 | Update unit tests
  • 2023/10/24 | Add a pseudo builder implementation
  • 2023/10/24 | Unit tests refactoring
  • 2023/10/24 | Unit tests refactoring
  • 2023/10/24 | Update logger
  • 2023/10/24 | Unit tests refactoring
  • 2023/10/24 | Fix update and provide a formatted output
  • 2023/10/23 | Bump minimatch from 3.0.4 to 3.1.2

v1.1.4

  • 2023/10/23 | v1.1.4

v1.1.3

  • 2023/10/23 | v1.1.3
  • 2023/10/23 | doc and lints
  • 2023/10/23 | doc and lints
  • 2023/10/23 | doc and lints
  • 2023/10/23 | doc and lints
  • 2023/10/23 | doc and lints
  • 2023/10/23 | doc and lints
  • 2022/07/13 | Bump ansi-regex from 3.0.0 to 3.0.1
  • 2021/06/12 | Bump glob-parent from 5.1.1 to 5.1.2

v1.1.2

  • 2021/05/31 | v1.1.2

v1.1.0

  • 2021/05/27 | v1.1.0
  • 2021/05/27 | clean old deps
  • 2021/01/05 | build fix

v1.0.14

  • 2021/01/05 | v1.0.14

v1.0.13

  • 2021/01/05 | v1.0.13

v1.0.12

  • 2021/01/05 | v1.0.12

v1.0.11

  • 2021/01/05 | v1.0.11
  • 2021/01/05 | dependencies update, dayjs migration, enhanced unit tests
  • 2020/07/14 | publish workflow
  • 2020/07/14 | publish
  • 2020/07/14 | fix es5 import

v1.0.7

  • 2020/04/29 | v1.0.7

v1.0.6

  • 2020/04/29 | v1.0.6
  • 2020/04/29 | fix export
  • 2020/03/31 | fix export

v1.0.5

  • 2020/03/31 | v1.0.5

v1.0.4

  • 2020/03/31 | v1.0.4
  • 2020/03/31 | fix export