@cuba-platform/rest v2.1.2
CUBA REST JS
JavaScript library for web and Node.js which facilitates CUBA Platfotm's REST API usage.
Installation
npm
npm install @cuba-platform/rest --saveImport 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 --saveglobal.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);
});Development
Tests
In order to run integration tests you need Java to be installed.
Integration tests
npm run test:integrationRunning manually
Start test CUBA app
npm run start-test-appRun tests
npm testStop test app
npm run teardown-test-appBuild
npm run distLint
npm run lint4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago