limsml-client

0.5.2 • Public • Published

LIMSML Client

This package contains a JavaScript/TypeScript client library to access the LIMSML web service used by Thermo Fisher Scientific's SampleManager LIMS application.

Installation

Include this package into your project using NPM:

> npm install --save limsml-client

Basic Usage

Start with Client.login() to return a promise of a client connection.

const LIMSML = require('limsml-client');

LIMSML.Client.login("SYSTEM", "", "http://localhost:56104/wsdl?wsdl")
    .then(client => client.ping({ message: "Hello" }))
    .then(response => {
        console.log(response.system.ping);
    }).catch(reason => {
        console.error(reason);
    });

The above can also be rewritten using the async/await syntax. This makes it easier to make multiple calls to the LIMSML service with the same connection.

const LIMSML = require('limsml-client');
    
LIMSML.Client.login("SYSTEM", "", "http://localhost:56104/wsdl?wsdl")
    .then(async client => {

        // make two requests
        let pingResponse = await client.ping({ message: "Hello" });
        let personnelResponse =
            await client.find({ pagesize: 100 }, "personnel");

        // print the responses
        console.log("Ping:", pingResponse.system.ping);
        console.log("Personnel:",
            personnelResponse.data.personnel.table
                .map(r => ({ identity: r.identity, name: r.name })));

        // logout
        await client.logout();

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

See src/demo.ts for some more examples.

Changelog

  • 0.5.2: Updated parsing to correctly parse SOAP responses when they include newline characters.
  • 0.5.1: Added automatic Base64-decoding of received files under 512KB encoded size (override via Client.MAX_BASE64_DECODE).
  • 0.5.0: Made Client._actions protected, added Client.action() to get action definition, and updated demo to show usage.
  • 0.4.3: Added custom LIMSML action example
  • 0.4.2: Initial support for retrieving files from the LIMSML web service.
  • 0.4.1: Update logging to remove dependency on util.inspect() and make debug logs more readable in Chrome development tools.
  • 0.4.0: Trouble using with React and Electron; webpack seems to choke on some dependencies of the soap module. Updated to use easy-soap-request. Also now using CryptoJS to ensure that the RC4 cipher is available.
  • 0.3.1: Usable.

Readme

Keywords

none

Package Sidebar

Install

npm i limsml-client

Weekly Downloads

8

Version

0.5.2

License

MIT

Unpacked Size

167 kB

Total Files

15

Last publish

Collaborators

  • icooper