1.20.0 • Published 1 month ago

@fnndsc/chrisapi v1.20.0

Weekly downloads
20
License
MIT
Repository
-
Last release
1 month ago

ChRIS API

Build Status

JavaScript 6 client for the ChRIS API.

Installation

npm i @fnndsc/chrisapi

API Documentation

If you have a ChRIS server up and running (eg. as explained below) then you can test the API in your Javascript code.

For more information visit the API documentation

Development and testing

ChRIS server preconditions

These preconditions are only necessary to be able to test the client against an actual instance of a ChRIS server both during development and for the automated tests.

Install latest Docker and Docker Compose.

Currently tested platforms:

  • Docker 18.06.0+
  • Docker Compose 1.27.0+
  • Ubuntu 18.04+ and MAC OS X 10.14+

On a Linux machine make sure to add your computer user to the docker group

Fire up the full set of ChRIS services:

Open a terminal and run the following commands in any working directory:

$> git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
$> cd ChRIS_ultron_backEnd
$> ./make.sh -U -I -i

Check that all the services are up:

$> docker ps -a

Create a test feed by making the following POST request:

Using curl:

curl -u cube:cube1234 -XPOST -H 'Content-Type: application/vnd.collection+json' -H 'Accept: application/vnd.collection+json' -d '{"template":{"data":[{"name":"dir", "value":"home/cube/uploads"}]}}' 'http://localhost:8000/api/v1/plugins/2/instances/'

Using HTTPie REST API client:

http -a cube:cube1234 POST http://localhost:8000/api/v1/plugins/2/instances/ template:='{"data":[{"name":"dir", "value":"home/cube/uploads"}]}' Content-Type:application/vnd.collection+json Accept:application/vnd.collection+json

Update the feed's files by making the following GET request:

Using curl:

curl -u cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/

Using HTTPie REST API client:

http -a cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/

Keep making this GET request until the "status" descriptor in the response becomes "finishedSuccessfully"

Tear down the full set of ChRIS services:

You can later remove all the backend containers and release storage volumes with:

$ cd ChRIS_ultron_backEnd
$ ./unmake.sh

JavaScript package manager prerequisite

  • yarn

Open a terminal in the directory of this README file

Commands

Install dependencies

$> yarn install

Start tests in watch mode (used for developing)

$> yarn start

Start test in single run mode (used by Travis CI)

$> yarn test

Compile library to standalone bundle

$> yarn build

Generate source code documentation

$> yarn docs
1.20.0

1 month ago

1.18.0

2 months ago

1.19.0

2 months ago

1.16.0

2 months ago

1.17.0

2 months ago

1.14.1

10 months ago

1.12.3

10 months ago

1.14.0

10 months ago

1.12.2

10 months ago

1.12.1

10 months ago

1.12.7

10 months ago

1.12.6

10 months ago

1.14.3

10 months ago

1.12.5

10 months ago

1.14.2

10 months ago

1.12.4

10 months ago

1.12.8

10 months ago

1.13.20

10 months ago

1.13.21

10 months ago

1.15.0

7 months ago

1.13.2

10 months ago

1.13.1

10 months ago

1.13.0

10 months ago

1.13.6

10 months ago

1.13.5

10 months ago

1.13.4

10 months ago

1.13.3

10 months ago

1.13.9

10 months ago

1.13.11

10 months ago

1.13.8

10 months ago

1.13.10

10 months ago

1.13.7

10 months ago

1.13.17

10 months ago

1.13.16

10 months ago

1.13.19

10 months ago

1.13.18

10 months ago

1.13.13

10 months ago

1.13.12

10 months ago

1.13.15

10 months ago

1.13.14

10 months ago

1.12.0

1 year ago

1.9.1

1 year ago

1.9.0

2 years ago

1.9.7

1 year ago

1.9.6

1 year ago

1.9.5

1 year ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago