Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
An api-bot
is an customizable chat bot that can proxy with any APIs and
transform the results into a bot message. A JSON or YAML config file is used to
describe the both the interaction with the API and the transformation of the
output. The config file/doc can also easily be served via a noSQL database.
This is a NodeJS library to handle various instructions for an api-bot
.
yarn add api-bot --save
Module for handling messages from bot.
Base class to parse message string into commands and arguments.
Kind: static class of BotMsg
Properties
Name | Type | Description |
---|---|---|
payload | Object | payload from bot. |
text | String | text message from the payload. |
cmd | String | Command string. |
tokens | Array.<String> | Argument tokens. |
String
Object
Object
Array.<String>
Create a new BaseCmd instance.
Param | Type | Description |
---|---|---|
payload | Object | payload from bot. |
textAccessor | function | accessor function to extract message text from the payload. |
String
Kind: instance property of BaseCmd
Returns: String
- text message from the payload
Object
Kind: instance property of BaseCmd
Returns: Object
- payload payload from bot.
Object
Kind: instance property of BaseCmd
Returns: Object
- cmd Command string.
Array.<String>
Kind: instance property of BaseCmd
Returns: Array.<String>
- tokens Argument tokens.
BaseCmd
Class to extract a slash command string (i.e. /hello
) and the argument tokens from a text message.
Kind: static class of BotMsg
Extends: BaseCmd
BaseCmd
String
Object
Object
Array.<String>
Create a new SlashCmd instance.
Param | Type | Description |
---|---|---|
payload | Object | payload from bot. |
textAccessor | function | accessor function to extract message text from the payload. |
String
Kind: instance property of SlashCmd
Returns: String
- text message from the payload
Object
Kind: instance property of SlashCmd
Returns: Object
- payload payload from bot.
Object
Kind: instance property of SlashCmd
Returns: Object
- cmd Command string.
Array.<String>
SlashCmd
Array.<String>
- tokens Argument tokens.Module for handling Facebook messenger hooks.
Promise
Promise
Object
Object
Object
Object
Object
Utility class to handle Facebook messenger APIs.
Promise
Utility class to handle Facebook messenger APIs.
Kind: static method of FbHook
Param | Type | Description |
---|---|---|
id | String | id of the Facebook recipient to send the message to. |
payload | Payload | Payload to Facebook messenger. |
Promise
Function to process a bot message from Facebook messenger.
Kind: static method of FbHook
Param | Type | Description |
---|---|---|
cmds | Object.<String, Api.Transformer> | A map of Api.Transformer . |
botCmd | BotMsg.BaseCmd | BotMsg.BaseCmd instance. |
Object
attachment
object for response message to Facebook messenger.
details
Kind: inner typedef of FbHook
Properties
Name | Type | Description |
---|---|---|
type | String | Type of attachment, may be image , audio , video , file or template . |
payload | Any | Payload of attachment. |
Object
quick_reply
object for response message to Facebook messenger.
details
Kind: inner typedef of FbHook
Properties
Name | Type | Description |
---|---|---|
content_type | String | text or location . |
title | String | Caption of button. |
payload | String | Number | Custom data that will be sent back to you via webhook. |
image_url | String | URL of image for text quick replies. |
Object
message
object for response message to Facebook messenger.
details
Kind: inner typedef of FbHook
Properties
Name | Type | Description |
---|---|---|
text | String | Message text. Previews will not be shown for the URLs in this field. Use attachment instead. Must be UTF-8 and has a 640 character limit. |
attachment | Attachment | attachment object. Previews the URL. Used to send messages with media or Structured Messages. |
quick_replies | Array.<QuickReply> | Array of quick_reply to be sent with messages. |
metadata | String | Custom string that is delivered as a message echo. 1000 character limit. |
Object
payload
object for response message to Facebook messenger.
Kind: inner typedef of FbHook
Properties
Name | Type | Description |
---|---|---|
id | String | Number | id of the Facebook messenger recipient. |
Object
payload
object for response message to Facebook messenger.
details
Kind: inner typedef of FbHook
Properties
Name | Type | Description |
---|---|---|
recipient | Recipient | Recipient object. |
message | Message | Message object. |
sender_action | String | typing_on , typing_off or mark_seen . |
notification_type | String | REGULAR , SILENT_PUSH , NO_PUSH . Defaults to REGULAR . |
tag | String | The message tag string. See Message Tags. |
FAQs
NodeJS lib to handle various instructions for an api-bot.
The npm package api-bot receives a total of 2 weekly downloads. As such, api-bot popularity was classified as not popular.
We found that api-bot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.