Socket
Book a DemoInstallSign in
Socket

@futoin/msgbot

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@futoin/msgbot

FutoIn Message Bot Reference Implementation

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
1
Created
Source

About

WORK IN PROGRESS

Reference implementation of:

FTN22: FutoIn Interface - Message Bot
Version: 0.x
  • Spec: FTN22: FutoIn Interface - Message Bot

Author: Andrey Galkin

Installation for Node.js

Command line:

$ npm install @futoin/msgbot --save

API documentation

Classes

CommandRouterFace

FTN22: Command Router Face

CommandRouterService

Command Router Service

PushHandlerFace

FTN22: Push Handler Face

PushHandlerService

Push Handler Service base

PushRouterService

Push Router Service base

ReactHandlerFace

FTN22: React Handler Face

ReactHandlerService

React Handler Service base

ServerFace

FTN22: Server Face

ServerHelpers

FTN22: Server-specific helpers

ServerService

Server Service

ServiceApp

Basic bot service app.

Actual bot implementation is expected to inherit this class and override registration functions.

BaseFace

Base Face with neutral common registration functionality

BaseService

Base Service with common registration logic

CommandRouterFace

FTN22: Command Router Face

Kind: global class

CommandRouterService

Command Router Service

Kind: global class

new CommandRouterService(options)

C-tor

ParamTypeDescription
optionsobjectpassed to superclass c-tor

PushHandlerFace

FTN22: Push Handler Face

Kind: global class

PushHandlerService

Push Handler Service base

Kind: global class

PushRouterService

Push Router Service base

Kind: global class

ReactHandlerFace

FTN22: React Handler Face

Kind: global class

ReactHandlerService

React Handler Service base

Kind: global class

ServerFace

FTN22: Server Face

Kind: global class

serverFace.getFlavour(asi)

Get type of database

Kind: instance method of ServerFace

ParamTypeDescription
asiAsyncStepssteps interface

serverFace.helpers() ⇒ ServerHelpers

Get native server helpers

Kind: instance method of ServerFace
Returns: ServerHelpers - - driver implementation

serverFace.systemIface()

Get native message system interface implementation

Kind: instance method of ServerFace

ServerFace.register(asi, ccm, name, endpoint, [credentials], [options])

CCM registration helper

Kind: static method of ServerFace

ParamTypeDefaultDescription
asiAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
[credentials]*see AdvancedCCM#register
[options]object{}interface options
[options.version]string"<latest>"interface version to use

ServerHelpers

FTN22: Server-specific helpers

Kind: global class

serverHelpers.bold(str) ⇒ string

Get bold text

Kind: instance method of ServerHelpers
Returns: string - bold output

ParamTypeDescription
strstringinput

serverHelpers.italic(str) ⇒ string

Get italic text

Kind: instance method of ServerHelpers
Returns: string - italic output

ParamTypeDescription
strstringinput

serverHelpers.color(str, hexcolor) ⇒ string

Get colored text

Kind: instance method of ServerHelpers
Returns: string - colored output

ParamTypeDescription
strstringinput
hexcolorstringcolor code

serverHelpers.imgUrl(url) ⇒ string

Get image URL embedded into text

Kind: instance method of ServerHelpers
Returns: string - URL output

ParamTypeDescription
urlstringinput

serverHelpers.emoji(name) ⇒ string

Get emoji embedded into text

Kind: instance method of ServerHelpers
Returns: string - emoji output

ParamTypeDescription
namestringinput

serverHelpers.line() ⇒ string

Get new line

Kind: instance method of ServerHelpers
Returns: string - new line

serverHelpers.menion(ext_id) ⇒ string

Get actor mention into text

Kind: instance method of ServerHelpers
Returns: string - mention output

ParamTypeDescription
ext_idstringinput actor ID

ServerHelpers.setDriver(flavour, impl)

Add native helper driver

Kind: static method of ServerHelpers

ParamTypeDescription
flavourstringsystem flavour
implServerHelpersdriver implementation

ServerHelpers.getDriver(flavour) ⇒ ServerHelpers

Get native helper driver

Kind: static method of ServerHelpers
Returns: ServerHelpers - driver implementation

ParamTypeDescription
flavourstringsystem flavour

ServerService

Server Service

Kind: global class

ServiceApp

Basic bot service app.

Actual bot implementation is expected to inherit this class and override registration functions.

Kind: global class

new ServiceApp(asi, options)

C-tor

ParamTypeDefaultDescription
asiAsyncStepsAsyncSteps interface
optionsobject{}options
[options.ccm]AdvancedCCMexternal CCM instance
[options.executor]Executorexternal executor instance
[options.ccmOptions]objectauto-CCM options
[options.notExpectedHandler]callable'notExpected' error handler
[options.executorOptions]objectprivate auto-Executor options

serviceApp.ccm() ⇒ AdvancedCCM

CCM instance accessor

Kind: instance method of ServiceApp
Returns: AdvancedCCM - instance

serviceApp.executor() ⇒ Executor

Executor instance accessor

Kind: instance method of ServiceApp
Returns: Executor - instance

serviceApp.close([done])

Shutdown of app and related instances

Kind: instance method of ServiceApp

ParamTypeDefaultDescription
[done]callabledone callback

serviceApp.newExecutor() ⇒ Executor

Create an instance of executor which is useful to register services.

Kind: instance method of ServiceApp
Returns: Executor - instance

serviceApp._register_logsvc(asi, options)

Override to register custom log service

Kind: instance abstract method of ServiceApp

ParamTypeDefaultDescription
asiAsyncStepsAsyncSteps interface
optionsobject{}options

serviceApp._register_handlers(asi, options)

Override to register custom business logic.

Kind: instance abstract method of ServiceApp

ParamTypeDefaultDescription
asiAsyncStepsAsyncSteps interface
optionsobject{}options

serviceApp._register_servers(asi, options)

Override to register servers.

Kind: instance abstract method of ServiceApp

ParamTypeDefaultDescription
asiAsyncStepsAsyncSteps interface
optionsobject{}options

BaseFace

Base Face with neutral common registration functionality

Kind: global class
Note: Not official API

BaseFace.LATEST_VERSION

Latest supported FTN13 version

Kind: static property of BaseFace

BaseFace.PING_VERSION

Latest supported FTN4 version

Kind: static property of BaseFace

BaseFace.register(as, ccm, name, endpoint, [credentials], [options])

CCM registration helper

Kind: static method of BaseFace

ParamTypeDefaultDescription
asAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
[credentials]*see AdvancedCCM#register
[options]object{}interface options
[options.version]string"1.0"interface version to use

BaseService

Base Service with common registration logic

Kind: global class

new BaseService(options)

C-tor

ParamTypeDescription
optionsobjectpassed to superclass c-tor

BaseService.register(as, executor, options) ⇒ BaseService

Register Service with Executor

Kind: static method of BaseService
Returns: BaseService - instance

ParamTypeDescription
asAsyncStepssteps interface
executorExecutorexecutor instance
optionsobjectimplementation defined options

documented by jsdoc-to-markdown.

Keywords

futoin

FAQs

Package last updated on 14 Aug 2021

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