1.12.14 • Published 2 years ago
@contrast/screener-service v1.12.14
@contrast/screener-service
This module houses client code for talking to either the local or cloud provisioning services as well as RMQ interfacing.
:pushpin: Important Note: If you are looking for documentation on how to use the Screener with the Node Agent, look into the Wiki!
Install
npm i @contrast/screener-service
API
Creating a session
const provisioningClient = require('@contrast/screener-service').client;
const response = await provisioningClient.createSession(
process.env.SCREENER_AGENT_URL
);
const { id: sessionId } = response;
const { hostname, port, username, password } = response.mq;
Starting an app
const { id: appId, url: appUrl } = await provisioningClient.startApp({
sessionId,
'express',
port: 3000,
'12',
'assess',
agentUrl: process.env.SCREENER_AGENT_URL
});
Polling an app
await provisioningClient.pollApp({ appUrl });
Stopping an app
await provisioningClient.stopApp(appId);
Interacting with Rabbit MQ
const RmqClient = require('@contrast/screener-service').rmqClient;
// connect
const mq = new RmqClient(`amap://${username}:${password}@${hostname}:${port}`, exchangeName);
await mq.connect();
// create a queue
await mq.createQueue(queueName);
// poll for message
const msg = await mq.getMessage(queueName, msgType, timeout);
1.12.14
2 years ago
1.12.13
2 years ago
1.12.12
2 years ago
1.12.11
2 years ago
1.12.7
3 years ago
1.12.6
3 years ago
1.12.9
3 years ago
1.12.8
3 years ago
1.12.10
3 years ago
1.12.5
3 years ago
1.12.3
3 years ago
1.12.4
3 years ago
1.12.2
3 years ago
1.12.1
3 years ago
1.12.0
4 years ago
1.11.0
4 years ago
1.10.0
4 years ago
1.9.0
4 years ago
1.8.0
4 years ago
1.7.0
4 years ago
1.6.0
4 years ago
1.5.0
4 years ago
1.4.0
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.2.0
4 years ago
0.1.0
4 years ago