Skip to content

godmodelabs/flora-client-js

Repository files navigation

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

About

JavaScript client for Flora based APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published