Merge commit '41de8b9b5af5ffa31d8a1212c03d446d3611f24d' into feat/ci-02

This commit is contained in:
Leifer Mendez
2023-01-08 16:11:33 +01:00
50 changed files with 617 additions and 0 deletions

4
.gitignore vendored
View File

@@ -14,6 +14,10 @@ mediaSend/*
!mediaSend/nota-de-voz.mp3
.env
.wwebjs_auth
/session
/session/*
/tokens
/tokens/*
packages/cli/config.json
config.json
.yarnrc.yml

View File

@@ -24,6 +24,7 @@ class WebWhatsappProvider extends ProviderClass {
super()
this.vendor = new Client({
authStrategy: new LocalAuth(),
puppeteer: { headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--unhandled-rejections=strict'] }
})
const listEvents = this.busEvents()

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
const JsonFileAdapter = require('@bot-whatsapp/database/json')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
const MockAdapter = require('@bot-whatsapp/database/mock')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
const MongoAdapter = require('@bot-whatsapp/database/mongo')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
const MySQLAdapter = require('@bot-whatsapp/database/mysql')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const VenomProvider = require('@bot-whatsapp/provider/venom')
const JsonFileAdapter = require('@bot-whatsapp/database/json')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const VenomProvider = require('@bot-whatsapp/provider/venom')
const MockAdapter = require('@bot-whatsapp/database/mock')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const VenomProvider = require('@bot-whatsapp/provider/venom')
const MongoAdapter = require('@bot-whatsapp/database/mongo')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const VenomProvider = require('@bot-whatsapp/provider/venom')
const MySQLAdapter = require('@bot-whatsapp/database/mysql')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const WebWhatsappProvider = require('@bot-whatsapp/provider/web-whatsapp')
const JsonFileAdapter = require('@bot-whatsapp/database/json')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const WebWhatsappProvider = require('@bot-whatsapp/provider/web-whatsapp')
const MockAdapter = require('@bot-whatsapp/database/mock')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -8,6 +8,8 @@ const {
const WebWhatsappProvider = require('@bot-whatsapp/provider/web-whatsapp')
const MongoAdapter = require('@bot-whatsapp/database/mongo')
require('./server.http')
/**
* Declaramos las conexiones de Mongo
*/

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))

View File

@@ -0,0 +1,7 @@
FROM node:lts-bullseye as bot
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
ARG PORT
CMD ["npm", "start"]

View File

@@ -5,6 +5,8 @@ const {
addKeyword,
} = require('@bot-whatsapp/bot')
require('./server.http')
const WebWhatsappProvider = require('@bot-whatsapp/provider/web-whatsapp')
const MySQLAdapter = require('@bot-whatsapp/database/mysql')

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<img src="qr.png" alt="" />
</body>
</html>

View File

@@ -0,0 +1,30 @@
var http = require('http')
var fs = require('fs')
var path = require('path')
const PORT = process.env.PORT || 3000
/**
* Levantar un HTTP Server
*/
http.createServer(function (req, res) {
if (req.url === '/') {
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
} else if (req.url.match('.css$')) {
var cssPath = path.join(__dirname, 'public', req.url)
var fileStream = fs.createReadStream(cssPath, 'UTF-8')
res.writeHead(200, { 'Content-Type': 'text/css' })
fileStream.pipe(res)
} else if (req.url.match('.png$')) {
var imagePath = path.join(__dirname, req.url)
var fileStream = fs.createReadStream(imagePath)
res.writeHead(200, { 'Content-Type': 'image/png' })
fileStream.pipe(res)
} else {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end('No Page Found')
}
}).listen(PORT, () => console.log(`Ready HTTP http://localhost:${PORT}`))