Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@zoomus/chatbot-cli
Advanced tools
This is a cli package that automatically sets up a Node.js Zoom chatbot project for you. This allows you to quickly start developing chatbots without having to worry about setting up a project, doing Zoom side oauth, and other boilerplate logic and allows you to immediately concentrate on developing your business logic.
npm i @zoomus/chatbot-cli -g
zoomchatbot create examplebot
//Choose one development deployment method in terminalcd examplebot
npm run start
// start your app demo.If you select demo type in terminal, use npm run dynamodb
to create local dynamodb tables first(before install dynamodb local,need to ensure have java env && bind aws key secret first,you can use fake aws key&secret for test)npm run test
//use jest to test appSee marketplace docs to learn how to create bot and get information you need to paste into your code's environment variables file: .development.env for general mode, serverless.development.json for serverless mode
Here you will see either .development.env for general mode or serverless.development.json for serverless mode. You will need to fill this out with your bot's information. Below is an example screenshot:
You will also see a file called botConfig.js. In this file, we can add features to our bot. Let's go over the sections of botConfig.js:
//zoomType = 'command'|'auth'
//command type is match to zoom marketplace botendpoint url bind,just like https://.../command
//auth type is match to zoom marketplace auth redirect url bind,like https://.../auth
//will auto inject zoomApp & zoomWebhook & zoomError in command type callback(callback details in botCommands and botActions)
//will auto inject zoomApp & zoomError in auth type callback.If zoomError not toBeFalsy,you can see zoomError about error message from middleware
//zoomApp can use for sendMessage,request zoom openapi,you can see ./src example code and @zoomus/chatbot for more details
apis: [
{ url: '/command', method: 'post', zoomType: 'command' },//callbacks see botCommands&botActions
{ url: '/auth', method: 'get', callback: require('./src/auth'), zoomType: 'auth' },
{url:'/test',method:'get',callback:function(req,res,next){}}//it is a general api
]
botCommands: [
{
command: 'help',
callback: require('./src/help.js')
},
{
callback:require('./src/noCommand.js') // no matched command,will call this function
}
]
botActions: [
{
command:'interactive_message_actions',
callback:require('./src/interactive_message_actions.js')
}
]
//auto support three types log which you can see in this function
info:{
type:'http',
message:{
request:{url,body,headers},
response:{status,body},
error //also trigger in error_notice when it not be falsely
}
}
info:{
type:'webhook',
message:{
request:{url},
error
}
}
info:{
type:'error_notice',
message:{error} //only happen when we have http error and webhook verify fail
}
log:function(info){
console.log(info.type,info.message.request.url);
}
you can also log information in callback function,we will inject botLog instance after you bind log in botConfig
module.exports=function(req,res){
let {botLog} = res.locals;
botLog({//will call result in log function of botConfig.js
type:'your log type',
message:{
error,
...
}
});
}
If you wish to quickly see a demo of how to use this package.
Prereqs:
The demo runs DynamoDB, so you must have Java installed on your computer, as well as AWS CLI set up. To Install AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
After installing, run aws configure
, then configure your access key Id, and secret access key, (These two values don’t have to be real, can just be made up for local testing).
To run demo:
zoomchatbot create app
npm run dynamodb
to start dynamoDB.npm run start
to start your appuseDatabase: Although you can write database code in your callback function directly, we also support database config in botConfig.js. Once you declare your database functions in useDatabases, we will auto inject an object called databaseModels into res.locals of each callback. databaseModels will contain the functions you defined in useDatabase. Below is an example code using DynamoDB as an example:(see botdynamodb for how to write a custom database package,see botdblocal for how to create local dynamodb tables)
useDatabase: {
lib: require('some database library for zoom bot'),
option: {
tables: {
zoom: {
tableName: 'zoomtable',
hashKey: 'zoom_account_id',
schema: {
zoom_account_id: joi.string(),
zoom_access_token: joi.string()
}
}
},
port: 8089,
region: 'us-east-1'
}
}
And will auto inject databaseModels into res.locals of each callback:
let { zoomApp, zoomError, databaseModels } = res.locals;
await databaseModels.zoom.save({
zoom_account_id: accountId
});
The first place to look for help is on our Developer Forum, where Zoom Marketplace Developers can ask questions for public answers.
If you can’t find the answer in the Developer Forum or your request requires sensitive information to be relayed, please email us at developersupport@zoom.us.
FAQs
Zoom Node.js Chatbot Command Line Interface
The npm package @zoomus/chatbot-cli receives a total of 1 weekly downloads. As such, @zoomus/chatbot-cli popularity was classified as not popular.
We found that @zoomus/chatbot-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.