flora-client-js
v0.5.3
Published
JavaScript client for Flora based APIs
Downloads
10
Keywords
Readme
Flora JS client
Easily access Flora based APIs.
String-Notation
const FloraClient = require('flora-client-js');
const client = new FloraClient({ url: 'http://api.example.com/' });
client.execute({
resource: 'article',
select: 'id,name,subGroupA[id,name,subSubGroupA[attr1,attr2],subSubGroupB[subSubSubGroupA[attr1,attr2],subSubSubItem,subSubSubGroupB[attr1,attr2]]],attr';
limit: 15,
}).then((response) => console.log(response));
Object-Notation ( >= v0.4.1)
const FloraClient = require('flora-client-js');
const client = new FloraClient({ url: 'http://api.example.com/' });
client.execute({
resource: 'article',
select: [
'id',
'name',
{
subGroupA: [
'id',
'name',
{
subSubGroupA: ['attr1', 'attr2'],
subSubGroupB: [
{ subSubSubGroupA: ['attr1', 'attr2'] },
'subSubSubItem',
{ subSubSubGroupB: ['attr1', 'attr2'] },
],
},
],
},
];
limit: 15
}).then(response => console.log(response));