0.2.1 • Published 5 years ago

birst v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

birst

A javascript api and command-line tool wrapping Birst's web service API.

Birst Web Services API Framework

This project is both a Nodejs API and a command-line tool.

NPM version NPM downloads ISC License Build Status Coverage Status

API

The Birst API wrapper uses a Javascript object to encapsulate SOAP method calls.

import {Birst} from 'birst'

const birst = new Birst()
await birst.connect(wsdl)
await birst.login(username, password)

const spaces = await birst.listSpaces()

await birst.logout()

execute a method from the command line

The command line tool also encapsulates the SOAP method calls. Parameters as passed as JSON objects.

$ birst exec listSpaces

[ { name: 'TEST DEV Model',
    owner: 'devops',
    id: 'f00ba3-1234-5678-9b38-8d5d5d839c80' },
  { name: 'TEST DEV Model V2',
    owner: 'devops',
    id: 'f00ba4-1234-5678-9a85-8b1ea6ca86d5' },
  { name: 'TEST DEV Reports',
    owner: 'devops',
    id: 'f00b85-1234-5678-aa81-e98adce9e9db' } ]

$ birst exec getLiveAccessColumnProperties '{"spaceID":"f00b85-1234-5678-9abc-1eaf","sourceName":"Claims","columnName":"Claim ID"}'

{ SourceName: 'Claims',
  ColumnName: 'Claim ID',
  Formula: 'claims_fact."claim_id"',
  DataType: 'Varchar',
  Width: 25,
  Attribute: true,
  Measure: false,
  AnalyzeByDate: false }

$

explore the Birst SOAP API from the command line

The command line tool can also be used to list the registered SOAP methods and their signatures.

Hint: use the filter option (--filter or -f) with a Javascript regular expression to filter the output.

$ birst api -f '[sS]paces'

listAllSpaces({}) => UserSpace[]
listSpaces({}) => UserSpace[]

$ birst api -f '{.*sourceName.*}'

getLiveAccessColumnProperties({spaceID,sourceName,columnName}) => {SourceName,ColumnName,Formula,DataType,Width,Attribute,Measure,AnalyzeByDate}
getLiveAccessSourceDetails({spaceID,sourceName}) => {Name,UnCached,TTL,Cardinality,SourceKeys,ForeignKeys,SourceFilterCondition}
getSourceDetails({spaceID,sourceName}) => {Name,OriginalName,Disabled,Script,LastModifiedDate,SubGroups,Columns}

$

Command Line Tool Installation

  • Install the birst command.
user@laptop:~/Workspaces/test$ npm i -g birst

/usr/local/bin/birst -> /usr/local/lib/node_modules/birst/lib/command.js
+ birst@0.1.0
added 67 packages from 13 contributors in 3.113s

user@laptop:~/Workspaces/test$
  • Test the installation by displaying the command help page.
user@laptop:~/Workspaces/test$ birst help

$ birst help
birst <command>

Commands:
  birst api   list Birst SOAP method signatures
  birst exec  execute a method using a JSON object as a parameter list

Options:
  --version       Show version number                                  [boolean]
  --wsdl, -w      URL for the Birst WSDL [BIRST_WSDL]                   [string]
  --username, -u  username for the Birst SOAP API [BIRST_USERNAME]      [string]
  --password, -p  password for the Birst SOAP API [BIRST_PASSWORD]      [string]
  --verbose, -v   display more details in response                     [boolean]
  --help          Show help                                            [boolean]

user@laptop:~/Workspaces/test$

Changelog

  • v0.2.1 fix packaging error

  • v0.1.0 initial release

License

birst is freely distributable under the terms of the ISC license.

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago