2.1.2 • Published 2 years ago

@cuba-platform/rest v2.1.2

Weekly downloads
104
License
Apache-2.0
Repository
github
Last release
2 years ago

CUBA REST JS

Build Status

JavaScript library for web and Node.js which facilitates CUBA Platfotm's REST API usage.

Installation

npm

npm install @cuba-platform/rest --save

Import as module

const cuba = require('@cuba-platform/rest');

Or using ES6 imports:

import * as cuba from '@cuba-platform/rest';

bower

bower install cuba-platform/cuba-rest-js
<script src="./bower_components/cuba-rest-js/dist-browser/cuba.js">

Dependencies and requirements

Library has no external dependencies. It's assumed that Promise and fetch -compatible API are available or polyfilled i.e. in node environment:

npm install node-fetch --save
global.fetch = require('node-fetch');

Usage

import * as cuba from 'cuba-rest-js';

const app = cuba.initializeApp({
  name: 'myApp',
  apiUrl: 'http://localhost:8080/app/rest/'
});

app.getUserInfo().then((d) => {
  console.log(d);
});

// retrieve app by name

const myApp = cuba.getApp('myApp');

or use if you want to manage instances yourself

const myApp = new CubaApp("myApp", "http://localhost:8080/app/rest/")
myApp.loadEntities('sec$User', {view: '_minimal', sort: 'login'}).then((users) => {
  console.log(users);
});

Full API reference

Development

Tests

In order to run integration tests you need Java to be installed.

Integration tests

npm run test:integration

Running manually

Start test CUBA app

npm run start-test-app

Run tests

npm test

Stop test app

npm run teardown-test-app

Build

npm run dist

Lint

npm run lint
2.1.2

2 years ago

2.1.0

3 years ago

2.0.0-beta.1

3 years ago

2.0.0

3 years ago

2.0.0-beta.0

3 years ago

1.0.3

4 years ago

2.0.0-dev.3

4 years ago

1.0.2

4 years ago

2.0.0-dev.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

0.7.4

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.7.0-beta.0

4 years ago

0.7.0-dev.4

4 years ago

0.7.0-dev.2

4 years ago

0.7.0-dev.1

4 years ago

0.6.0

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.5.0-beta.1

5 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.3.0-pre.1

6 years ago