@cordite/braid-client
service proxies for Braid JsonRPC services
Last updated 23 days ago by cordite .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @cordite/braid-client 
SYNC missed versions from official npm registry.

braid-client NPM module

Short Example

npm install --save braid-client

followed by something along the lines of:

const Proxy = require('braid-client').Proxy;

const alpha1 = new Proxy({url: 'https://alpha-one.cordite.foundation:8080/api/'}, onOpen, onClose, onError, {strictSSL: false})

let saltedDaoName = 'testDao-'+new Date().getTime()

function onOpen() {
    console.log("ooh - worked")
    console.log(new Date().getTime())
    alpha1.dao.daoInfo(saltedDaoName).then(daos => {
        console.log("there were", daos.length, "existing doas with name", saltedDaoName )
        
        return alpha1.dao.createDao.docs()

    }).catch(error => {
        console.error(error)
    })
}

function onClose() {
    console.log("closed")
}

function onError(err) {
    console.error(err)
}

Note that this hits the live cordite alpha.

Features

Allows for the calling of any service method exposed by the end point. If the service method is not available, the module emits a message and URL to the developer console. Clicking on the URL takes the UI developer to the Braid Editor to add the new method the service.

Build

npm run build

Current Tags

  • 4.4.0                                ...           latest (23 days ago)

5 Versions

  • 4.4.0                                ...           23 days ago
  • 4.4.0-RC03                                ...           24 days ago
  • 4.4.0-RC02                                ...           2 months ago
  • 4.4.0-RC01                                ...           2 months ago
  • 4.4.0-SNAPSHOT                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 35
Last Day 0
Last Week 5
Last Month 32
Dependencies (4)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |