New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dl-opal-client

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dl-opal-client

Dreamlab OPAL request library

  • 0.0.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Example usage.

var dlOpalClient = require('dl-opal-client');

// ------------------------------------------------------------------
// Example use
//

dlOpalClient.call({
    identity: 'test.onetapi.pl',            // (optional) - override application identity 
    interface: 'api.ucs.onetapi.pl',        // OPAL interface
    method: 'getPublicationPackageByUuid',  // OPAL method
    params: {                               // JSON-RPC params
        "uuid":"5fc2bf98-2225-5489-9182-79727d26dcea"
    },
    options: {                              // (optional) - options for underlying request library
        'headers':{                         // how to inject header
            'x-accelerator':'afterburner'
        },
        endpoint: {                         // override opal gateway, if so, all fields required
            'host':'onetapi.pl',            //
            'port': 80,                     //
            'https': false
        },
        timeout: 1000                       // override timeout to 1000 ms
    }
    }, function(error, data) {
        console.log('==> Error:', error, 'data:', data);
    }
);

// ------------------------------------------------------------------
// Example #2
//


dlOpalClient.call({
    interface: 'api.ucs.onetapi.pl',        // OPAL interface
    method: 'getPublicationPackageByUuid',  // OPAL method
    params: {                               // JSON-RPC params
        "uuid":"5fc2bf98-2225-5489-9182-79727d26dcea"
    },
    options: {                              // OPTIONAL - options for underlying request library
        endpoint: {                         // override opal gateway
            'host':'onetapi.pl',            
            'port': 443,                    
            'https': true
        },
        rejectUnauthorized: false           // required in case of self-signed certs
    }
    }, function(error, data) {
        console.log('==> Error:', error, 'data:', data);
    }
);

// ------------------------------------------------------------------
// Example #3 - REST/HTTP request

dlOpalClient.sendHTTP({
    interface: 'somerest.onetapi.pl',       // OPAL interface
    uri: '/getCustomers',
    method: 'POST',                         // HTTP method
    payload: 'Hello http world!',           // HTTP payload
    options: {                              // OPTIONAL - options for underlying request library
        endpoint: {                         // override opal gateway
            'host':'localhost',            
            'port': 80,                    
            'https': false
        },
        rejectUnauthorized: false           // required in case of self-signed certs
    }
    }, function(error, data) {
        console.log('==> Error:', error, 'data:', data);
    }
);

FAQs

Package last updated on 09 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc