Skip to content

Commit

Permalink
chore: next 0.1.24
Browse files Browse the repository at this point in the history
chore: next 0.1.24
  • Loading branch information
leifermendez committed Feb 26, 2023
2 parents 2472ee3 + 2d001c8 commit c716173
Show file tree
Hide file tree
Showing 10 changed files with 980 additions and 69 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ yarn-error.log
.npmrc
# Local Netlify folder
.netlify
.secrets
.secrets

# managed
**.data.json
**.node-persist**
**_IGNORE_**
# end managed
90 changes: 90 additions & 0 deletions __test__/0.1.4-case.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,94 @@ suiteCase(`Responder con un "object"`, async ({ database, provider }) => {
assert.is(undefined, getHistory[3])
})

suiteCase(`FlowDynamic con capture`, async ({ database, provider }) => {
const flow = addKeyword(['hola'])
.addAnswer(
'Como vas?: dime "bien" sino entro en fallback',
{ capture: true },
async (ctx, { flowDynamic, fallBack }) => {
if (ctx.body !== 'bien') return fallBack()
return flowDynamic([{ body: 'Todo bien!' }])
}
)
.addAnswer('fin!')

createBot({
database,
provider,
flow: createFlow([flow]),
})

await provider.delaySendMessage(0, 'message', {
from: '000',
body: 'hola',
})

await provider.delaySendMessage(10, 'message', {
from: '000',
body: 'mal',
})

await provider.delaySendMessage(20, 'message', {
from: '000',
body: 'bien',
})

await delay(100)
const getHistory = database.listHistory.map((i) => i.answer)
assert.is('Como vas?: dime "bien" sino entro en fallback', getHistory[0])
assert.is('mal', getHistory[1])
assert.is('Como vas?: dime "bien" sino entro en fallback', getHistory[2])
assert.is('bien', getHistory[3])
assert.is('Todo bien!', getHistory[4])
assert.is('fin!', getHistory[5])
assert.is(undefined, getHistory[6])
})

suiteCase.skip(`FlowDynamic con capture en hijo`, async ({ database, provider }) => {
// const flowTres = addKeyword('flowTres').addAnswer('Soy flujo 3',null,null,[flowTres]).addAnswer('Soy flujo 3-1')

const flowDos = addKeyword('flowDos').addAnswer('Soy flujo 2').addAnswer('Soy flujo 2-1')

const flow = addKeyword(['hola']).addAnswer(
'Buenas!',
{ capture: true },
async (_, { flowDynamic }) => {
return flowDynamic('Escribe flowDos')
},
[flowDos]
)

createBot({
database,
provider,
flow: createFlow([flow]),
})

await provider.delaySendMessage(0, 'message', {
from: '000',
body: 'hola',
})

await provider.delaySendMessage(10, 'message', {
from: '000',
body: 'mirame',
})

await provider.delaySendMessage(20, 'message', {
from: '000',
body: 'flowDos',
})

await delay(100)
const getHistory = database.listHistory.map((i) => i.answer)
assert.is('Buenas!', getHistory[0])
assert.is('mirame', getHistory[1])
assert.is('Escribe flowDos', getHistory[2])
assert.is('flowDos', getHistory[3])
assert.is('Soy flujo 2', getHistory[4])
// assert.is('Soy flujo 2-1', getHistory[5])
// assert.is(undefined, getHistory[7])
})

suiteCase.run()
33 changes: 0 additions & 33 deletions packages/docs/src/components/core/Social.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
export const Social = () => {
return (
<>
{/* <title>
💻 Conviértete en un Programador Backend aprendiendo todo de
Cloud y Nodejs
</title>
<meta
property="og:site_name"
content="💻 Conviértete en un Programador Backend aprendiendo todo de Cloud y Nodejs"
/>

<meta
name="description"
content="🚀 Comienza haciendo tus despliegues directamente a la Nube. 🙌 Qué esperas mejorar tus habilidades en la programación ahora mismo."
/>
<meta property="og:type" content="website" />
<meta
name="keywords"
content="cursos programacion, cursos backend, curso de aws, curso de cloud computing, curso de node, curso de typescript, curso de api rest con node, curso de api rest con mongo, curso de api rest con aws"
/>
<meta
property="og:title"
content="💻 Conviértete en un Programador Backend aprendiendo todo de Cloud Computing y Nodejs"
/>
<meta
property="og:description"
content="🚀 Comienza haciendo tus despliegues directamente a la Nube. 🙌 Qué esperas mejorar tus habilidades en la programación ahora mismo."
/>
<meta property="og:type" content="article" />
<meta property="og:locale" content="es_ES" />
<meta
property="og:url"
content="https://campaign.codigoencasa.com"
/>
<meta property="og:site_name" content="campaign.codigoencasa.com" /> */}
<meta property="og:image" content="https://i.imgur.com/0HpzsEm.png"></meta>
<meta property="og:image:secure_url" content="https://i.imgur.com/0HpzsEm.png" />
<meta property="og:image:type" content="image/png"></meta>
Expand Down
11 changes: 6 additions & 5 deletions packages/provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bot-whatsapp/provider",
"version": "0.0.96-alpha.0",
"version": "0.0.92-alpha.0",
"description": "Esto es el conector a Twilio, Meta, etc...",
"main": "./lib/mock/index.cjs",
"keywords": [],
Expand All @@ -11,19 +11,20 @@
],
"dependencies": {
"@bot-whatsapp/bot": "*",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"fluent-ffmpeg": "^2.1.2",
"combine-image": "^1.0.3",
"qr-image": "^3.2.0",
"rimraf": "^3.0.2",
"sharp": "^0.31.3"
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"fluent-ffmpeg": "^2.1.2"
},
"exports": {
"./mock": "./lib/mock/index.cjs",
"./twilio": "./lib/twilio/index.cjs",
"./web-whatsapp": "./lib/web-whatsapp/index.cjs",
"./venom": "./lib/venom/index.cjs",
"./baileys": "./lib/baileys/index.cjs",
"./meta": "./lib/meta/index.cjs"
"./meta": "./lib/meta/index.cjs",
"./wppconnect": "./lib/wppconnect/index.cjs"
},
"repository": {
"type": "git",
Expand Down
19 changes: 12 additions & 7 deletions packages/provider/rollup-provider.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const banner = require('../../config/banner.rollup.json')
const { join } = require('path')
const strip = require('@rollup/plugin-strip')
const commonjs = require('@rollup/plugin-commonjs')

module.exports = [
Expand All @@ -10,17 +9,15 @@ module.exports = [
banner: banner['banner.output'].join(''),
file: join(__dirname, 'lib', 'web-whatsapp', 'index.cjs'),
format: 'cjs',
sourcemap: true,
},
plugins: [strip(), commonjs()],
plugins: [commonjs()],
},
{
input: join(__dirname, 'src', 'twilio', 'index.js'),
output: {
banner: banner['banner.output'].join(''),
file: join(__dirname, 'lib', 'twilio', 'index.cjs'),
format: 'cjs',
sourcemap: true,
},
plugins: [commonjs()],
},
Expand All @@ -30,7 +27,6 @@ module.exports = [
banner: banner['banner.output'].join(''),
file: join(__dirname, 'lib', 'mock', 'index.cjs'),
format: 'cjs',
sourcemap: true,
},
plugins: [commonjs()],
},
Expand All @@ -41,7 +37,7 @@ module.exports = [
file: join(__dirname, 'lib', 'venom', 'index.cjs'),
format: 'cjs',
},
plugins: [strip(), commonjs()],
plugins: [commonjs()],
},
{
input: join(__dirname, 'src', 'baileys', 'index.js'),
Expand All @@ -50,7 +46,7 @@ module.exports = [
file: join(__dirname, 'lib', 'baileys', 'index.cjs'),
format: 'cjs',
},
plugins: [strip(), commonjs()],
plugins: [commonjs()],
},
{
input: join(__dirname, 'src', 'meta', 'index.js'),
Expand All @@ -61,4 +57,13 @@ module.exports = [
},
plugins: [commonjs()],
},
{
input: join(__dirname, 'src', 'wppconnect', 'index.js'),
output: {
banner: banner['banner.output'].join(''),
file: join(__dirname, 'lib', 'wppconnect', 'index.cjs'),
format: 'cjs',
},
plugins: [commonjs()],
},
]
2 changes: 1 addition & 1 deletion packages/provider/src/baileys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BaileysProvider extends ProviderClass {
if (qr) {
this.emit('require_action', {
instructions: [
`Debes escanear el QR Code para iniciar ${this.globalVendorArgs.name}.qr.png`,
`Debes escanear el QR Code 👌 ${this.globalVendorArgs.name}.qr.png`,
`Recuerda que el QR se actualiza cada minuto `,
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
],
Expand Down
Loading

0 comments on commit c716173

Please sign in to comment.