0.8.0 • Published 8 years ago

juttle-client-library v0.8.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

Juttle Client Library

Juttle Client Library is a set of frontend building blocks for creating applications that interact with outputs from juttle programs via juttle-service.

Build Status

Introduction

Juttle Client Library consists of 5 distinct components: Views, Inputs, Errors, JobManager, and HttpApi.

ComponentDescription
ViewsThe Views class is used to run a bundle (a juttle program with its modules) against an instance of Juttle Service and render its output onto a provided DOM node.
InputsGiven a bundle, an inputs instance will render the bundle's inputs to specified DOM node.
ErrorsGiven an error object returned from either juttle-service or juttle-viz, an Errors instance will render a user-friendly error message.
JobManagerInteracts with the Juttle Service api to run and manage the lifecycle of a running Juttle Program. Emits events received from the Juttle Service streaming api.
HttpApiClient functions for interacting with the Juttle Service http api.

Additionally Juttle Client Library also exports these enums:

EnumDescription
JobStatusAn enum used to described the status of a given JobManager instance. Returned from the getStatus() method of JobManager. Possible values can be STOPPED, STARTING, RUNNING
ViewStatusExactly the same as JobStatus only returned from the getStatus() of a Views instance.

Getting Started

npm install --save juttle-client-library

A quick example:

import { Views, Inputs } from 'juttle-client-library';

let views = new Views(JUTTLE_SERVICE_HOST, document.getElementById('views'));
let inputs = new Inputs(JUTTLE_SERVICE_HOST, document.getElementById('inputs'));

let bundle = {
    program: 'input person:text; emit | put greeting = "hello " + person'    
};


inputs.render(bundle);

document.getElementById('btn-run').addEventListener('click', () => {
    inputs.getValues()
    .then(values => views.run(bundle, values));
});

API

See the example and test directory for how this library should be used. A more complete implementation can be see in juttle/juttle-viewer

Running Example

Prerequisite - Have a locally running instance of Juttle Service (or Juttle Engine) on port 8080 (you can adjust the location by changing line 6 of example/index.js).

Here's how to run this library locally from this repo (also used for development purposes):

$ git clone https://github.com/juttle/juttle-client-library.git
$ cd juttle-client-library
$ npm install
$ cd example
$ ./server.js
0.8.0

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.7.0-rc.6

8 years ago

0.7.0-rc.5

8 years ago

0.7.0-rc.4

8 years ago

0.7.0-rc.3

8 years ago

0.6.1

8 years ago

0.7.0-rc.2

8 years ago

0.7.0-rc.1

8 years ago

0.6.0

8 years ago

0.6.0-rc.0

8 years ago

0.5.0

8 years ago

0.5.0-rc.1

8 years ago

0.5.0-rc.0

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.1-rc.0

8 years ago

0.3.0

8 years ago

0.3.0-rc.1

8 years ago

0.3.0-rc.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.2.0-rc.2

8 years ago

0.1.6

8 years ago

0.2.0-rc.1

8 years ago

0.2.0-rc.0

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago