@henripollet/jsapilib
Javascript API for the BLG Rest API
Last updated 9 months ago by henripollet .
UNLICENSED · Repository · Original npm · Tarball · package.json
$ cnpm install @henripollet/jsapilib 
SYNC missed versions from official npm registry.

JS API lib

JS API lib is designed to provide a convenient way to use the BLG API without taking care of the HTTP stack.

Installation

yarn add @blg/jsapilib

Usage

Node usage using native node http

const ApiClient = require('@blg/jsapilib/node');
// or
const ApiClient = require('@blg/jsapilib');

Client side usage using fetch

const ApiClient = require('@blg/jsapilib/fetch');

Example

const ApiClient = require('@blg/jsapilib');

async function main () {
    const apiClient = new ApiClient('https://***:***@app.blgcloud.com/josette/api');
    
    console.log(await apiClient.listNamespaces());
    
    console.log(await apiClient.listObjectNames('dataRepository'));

	// Location via mkLoc
    console.log(await apiClient.getObjectDef(ApiClient.mkLoc('dataRepository', 'field')));
    // Location via string[]
    console.log(await apiClient.getObjectDef(['dataRepository', 'range']));
    // Location via string
    console.log(await apiClient.getObjectDef('dataRepository/range'));

    const rep = await apiClient.listObjects(['dataRepository', 'range'], {
    	limit: 5,
    	filter: {name: 'rake'}
    });
    console.log(rep.checkedData());
}

Current Tags

  • 5.0.0                                ...           latest (9 months ago)

1 Versions

  • 5.0.0                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 5
Dependencies (5)
Dev Dependencies (22)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |