2.7.6 • Published 5 years ago

linkurious-rest-client v2.7.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

linkurious-rest-client

A javascript library to simplify interactions with Linkurious server.

The library is used by Linkurious SAS in the Linkurious Entreprise v2 for all the communication with the Linkurious server.

Installing linkurious-rest-client

  • If it's not already done, install node (>4.0.0) following this link : https://nodejs.org/en/download/
  • Clone the project : git clone git@github.com:Linkurious/linkurious-rest-client.git
  • Run the install command : npm install

This command will download all the dependencies and typescripts definitions necessary to use or build the library.

Technical requirements

All modern web browsers are supported.

In node environment, use Node.js 4.0.0+.

Build and use the library

Linkurious-rest-client is compatible with typescript, ES6 or ES5 environments.

To compile the library, use the following command :

npm run build
  • A folder called dist-es6 will be produced to use the library in an ES6 environment.
  • A file called linkurious-rest-client-es5.js will be produced for use directly in the browser.

1) Typescript environment

Linkurious-rest-client library is develop using typescript. You can use it directly in your typescript project :

import Linkurious = require('linkurious-rest-client');

2) ES6 environment

The ES6 generated code use commonjs. So you can use it with node or in the browser using a module bundler like webpack or browserify :

const Linkurious = require('linkurious-rest-client');

3) ES5 environment

The library is also compilated to be used directly in the browser :

<script src="./linkurious-rest-client-es5.js"></script>

First steps

For every environments, you can interact with the linkurious-server by invoking the rest-client and use its methods :

The Linkurious class takes 4 parameters :

  • The linkurious server host (ex: 'http://127.0.0.1:8080')
  • The log level ('quiet', 'error' or 'debug')
  • The logger methods (optional) if you want to use your proper logger library
  • the HTTP methods (optional) if you want to use your proper HTTP library

The state object will return the current user connected and the current dataSource connected.

example :

For this exemple we use Bunyan logging module to show how to use another logging library.

let linkurious = new Linkurious('127.0.0.1:8080', 'debug', {debug:bunyan.debug, error:bunyan.error});

// log the user to linkurious server and set the default datasource (the first datasource connected)
linkurious.init({
  usernameOrEmail : 'user_id',
  password : 'user_password'
}).then(() => {
  console.log(linkurious.state); // state : user info + first connected datasource infos
});

Generate the documentation

To view the documentation, run this command line :

npm run doc

Open the index.html file (located in the newly created docs folder) in your favorite browser.

Run tests

To run tests, use this command line :

npm test

Getting help / submit an issue

The easiest way is to file an issue(https://github .com/Linkurious/linkurious-rest-client/issues) with the following informations :

  • A step-by-step process to reproduce the bug or hurdle
  • A screenshot / console output
  • The version of your web browser, or version of Node.js

External dependencies

Linkurious-rest-client use two dependencies to work properly in all environment :

License

MIT

Authors

2.7.6

5 years ago

2.7.5

5 years ago

2.7.3

5 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.7.0

5 years ago

2.7.0-20

5 years ago

2.7.0-19

5 years ago

2.7.0-18

5 years ago

2.7.0-17

5 years ago

2.7.0-16

5 years ago

2.7.0-15

5 years ago

2.7.0-14

5 years ago

2.7.0-13

5 years ago

2.7.0-12

5 years ago

2.7.0-11

5 years ago

2.7.0-10

5 years ago

2.7.0-9

5 years ago

2.7.0-8

5 years ago

2.7.0-6

5 years ago

2.7.0-5

5 years ago

2.7.0-4

5 years ago

2.7.0-3

5 years ago

2.6.2-0

5 years ago

2.6.1-1

5 years ago

2.7.0-2

5 years ago

2.6.0

5 years ago

2.6.0-26

6 years ago

2.6.0-25

6 years ago

2.6.0-24

6 years ago

2.6.0-23

6 years ago

2.6.0-22

6 years ago

2.6.0-21

6 years ago

2.6.0-20

6 years ago

2.6.0-19

6 years ago

2.6.0-18

6 years ago

2.6.0-16

6 years ago

2.6.0-15

6 years ago

2.6.0-14

6 years ago

2.6.0-13

6 years ago

2.6.0-12

6 years ago

2.6.0-11

6 years ago

2.6.0-5

6 years ago

2.6.0-4

6 years ago

2.6.0-2

6 years ago

2.6.0-1

6 years ago

2.5.0

6 years ago

2.5.0-3

6 years ago

2.5.0-2

6 years ago

2.5.0-1

6 years ago

2.4.0

6 years ago

2.4.0-18

6 years ago

2.4.0-17

6 years ago

2.4.0-16

6 years ago

2.4.0-15

6 years ago

2.4.0-14

6 years ago

2.4.0-13

6 years ago

2.4.0-12

6 years ago

2.4.0-11

6 years ago

2.4.0-10

6 years ago

2.4.0-9

6 years ago

2.4.0-8

6 years ago

2.4.0-7

6 years ago

2.4.0-6

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.4.0-5

6 years ago

2.4.0-4

6 years ago

2.4.0-3

6 years ago

2.4.0-2

6 years ago

2.4.0-1

6 years ago

2.4.0-0

6 years ago

2.2.2-0

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago