npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botium-connector-simple-socketio

v0.1.7

Published

Botium Connector for Socket.io Endpoints

Downloads

27

Readme

Botium Connector for Socket.io Interface

NPM

Codeship Status for codeforequity-at/botium-connector-simple-socketio npm version license

This is a Botium connector for testing your Socket.io chatbot interface.

Did you read the Botium in a Nutshell articles? Be warned, without prior knowledge of Botium you won't be able to properly use this library!

How it works

Botium connects to the API of your Socket.io chatbot interface.

It can be used as any other Botium connector with all Botium Stack components:

Requirements

  • Node.js and NPM
  • a Socket.io interface
  • a project directory on your workstation to hold test cases and Botium configuration

Install Botium and Socket.io-Connector

When using Botium CLI:

> npm install -g botium-cli
> npm install -g botium-connector-simple-socketio
> botium-cli init
> botium-cli run

When using Botium Bindings:

> npm install -g botium-bindings
> npm install -g botium-connector-simple-socketio
> botium-bindings init mocha
> npm install && npm run mocha

When using Botium Box:

Already integrated into Botium Box, no setup required

Connecting Socket.io chatbot interface to Botium

Process is very simple, you have to know just the endpoint URL for your chatbot.

Create a botium.json with this URL in your project directory:

{
  "botium": {
    "Capabilities": {
      "PROJECTNAME": "<whatever>",
      "CONTAINERMODE": "simple-socketio",
      "SIMPLESOCKETIO_ENDPOINTURL": "..."
    }
  }
}

Botium setup is ready, you can begin to write your BotiumScript files.

Supported Capabilities

Set the capability CONTAINERMODE to simple-socketio to activate this connector.

SIMPLESOCKETIO_SERVER_MAJOR_VERSION

The major version of socket.io server package on the bot side

SIMPLESOCKETIO_ENDPOINTURL

Socket.io Host Url

SIMPLESOCKETIO_ENDPOINTPATH

Socket.io Endpoint Path - Default /socket.io

SIMPLESOCKETIO_CLIENT_OPTIONS

Socket.io client options in json form according to their documentation

SIMPLESOCKETIO_USE_WEBSOCKET_TRANSPORT

The default and the recommended value is true. When it's true than in the client options the websocket transport will be used: {transports: ['websocket']}. We recommend to use websocket transport, because with long http polling, we had a fragile connection and it causes troubles in case of sticky session.

SIMPLESOCKETIO_EMIT_SESSION_REQUEST_EVENT

This event is emitted in connect to receive a remoteId in 'session_confirm' event

SIMPLESOCKETIO_SESSION_REQUEST_HOOK

Javascript commands which executed before emitting SIMPLESOCKETIO_EMIT_SESSION_REQUEST_EVENT. Global variables available: socketOptions, container, context, botium

SIMPLESOCKETIO_COOKIE_AUTOFILL

When it's true in pollComplete event the cookies from the server are replicated in the extraHeaders property of client options

SIMPLESOCKETIO_START_HOOK

Javascript commands which executed at the beginning of start function. Global variables available: socketOptions, container, context, botium

SIMPLESOCKETIO_STOP_HOOK

Javascript commands which executed at the beginning of stop function. Global variables available: socketOptions, container, context, botium

SIMPLESOCKETIO_USERSAYS_EVENT_HOOK

Javascript commands which executed before emitting SIMPLESOCKETIO_EVENT_USERSAYS. Global variables available: socketOptions, container, context, botium

SIMPLESOCKETIO_BOTSAYS_EVENT_HOOK

Javascript commands which executed at the end of SIMPLESOCKETIO_EVENT_BOTSAYS function. Global variables available: socketOptions, container, context, botium

SIMPLESOCKETIO_EVENT_USERSAYS

#me Event Name

SIMPLESOCKETIO_SENDTEXT_FIELD

Payload Field for Text Input

SIMPLESOCKETIO_SENDMEDIA_FIELD

Payload Field for Attachments Input

SIMPLESOCKETIO_SENDBUTTON_FIELD

Payload Field for Button Input

SIMPLESOCKETIO_EVENT_BOTSAYS

#bot Event Name

SIMPLESOCKETIO_RECEIVETEXT_JSONPATH

JSONPath expression to extract Text Response

SIMPLESOCKETIO_RECEIVEATTACHMENTS_JSONPATH

JSONPath expression to extract Attachments Response

SIMPLESOCKETIO_RECEIVEBUTTONS_JSONPATH

JSONPath expression to extract Buttons Response

SIMPLESOCKETIO_RECEIVECARDS_JSONPATH

JSONPath expression to extract Cards response

SIMPLESOCKETIO_RECEIVECARD_CARD_TEXT_JSONPATH

JSONPath expression to extract Cards Text response

SIMPLESOCKETIO_RECEIVECARD_CARD_SUBTEXT_JSONPATH

JSONPath expression to extract Cards Subtext response

SIMPLESOCKETIO_RECEIVECARD_CARD_BUTTONS_JSONPATH

JSONPath expression to extract Cards Buttons response

SIMPLESOCKETIO_RECEIVECARD_CARD_ATTACHMENTS_JSONPATH

JSONPath expression to extract Cards Attachments response