flora-client-js

0.5.3 • Public • Published

Flora JS client

NPM version NPM downloads

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));

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i flora-client-js

Weekly Downloads

15

Version

0.5.3

License

MIT

Unpacked Size

70.7 kB

Total Files

7

Last publish

Collaborators

  • not-implemented
  • nicokaiser
  • mbaumgartl