Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🎨 next release 0.1.35 #926

Merged
merged 31 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3acda44
Update Pruebalo
Trystan4861 Aug 31, 2023
c5b77c7
Correccion index.mdx
edgardorms Sep 24, 2023
3bcbb97
fix: se soluciona problemas con sendContacts para el provider meta
Nov 9, 2023
b148060
Merge pull request #909 from jorgechavarriaga/main
leifermendez Nov 10, 2023
abf89ff
feat: se adiciona la funcionalidad de enviar reacciones para el prove…
Nov 10, 2023
3f9942b
feat: se adiciona la funcionalidad de enviar una ubicacion para el pr…
Nov 10, 2023
82d05aa
fix(provider): :fire:
Nov 11, 2023
9e31174
Added option to not push private keys
NachoEstevo Nov 12, 2023
6caee26
Added file checker
NachoEstevo Nov 12, 2023
aa928f3
Merge pull request #843 from Trystan4861/patch-3
leifermendez Nov 13, 2023
0ed8467
Merge pull request #863 from edgardorms/patch-1
leifermendez Nov 13, 2023
205bb0f
Merge pull request #915 from NachoEstevo/patch-1
leifermendez Nov 13, 2023
5244191
Merge pull request #911 from jorgechavarriaga/main
leifermendez Nov 13, 2023
fbdc76c
Merge pull request #914 from C4rlos-Mor4n/main
leifermendez Nov 13, 2023
73f0c69
feat: se adiciona la funcionalidad de enviar ubicacion para provedor …
Nov 13, 2023
7787875
perf(hook): before pnpm audit
leifermendez Nov 17, 2023
2fe6bd5
fix: :zap: issue #865
leifermendez Nov 17, 2023
2355a46
test: :art: more test
leifermendez Nov 17, 2023
6edf373
fix: :zap: issue #910
leifermendez Nov 17, 2023
1eda39a
fix: :zap: delay after gotoFlow #877
leifermendez Nov 17, 2023
63df424
Merge pull request #922 from codigoencasa/leifermendez/issue877
leifermendez Nov 17, 2023
6b1bba7
refactor: :zap: implement eslint by default
leifermendez Nov 17, 2023
7b9b8eb
refactor: :zap: implement eslint by default
leifermendez Nov 17, 2023
9f586aa
Merge branch 'dev' of github.com:codigoencasa/bot-whatsapp into dev
leifermendez Nov 17, 2023
dfab218
Merge pull request #923 from codigoencasa/dev
leifermendez Nov 17, 2023
6cf2e8f
docs(remove): remove
leifermendez Nov 17, 2023
505d073
Merge pull request #917 from jorgechavarriaga/main
leifermendez Nov 19, 2023
cd8b0b6
Merge branch 'release/next' into dev
leifermendez Nov 19, 2023
9d24002
chore: :art: next release 0.1.35
leifermendez Nov 19, 2023
b7b358f
Merge branch 'dev' of github.com:codigoencasa/bot-whatsapp into dev
leifermendez Nov 19, 2023
62a490e
release 0.1.35
leifermendez Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
Empty file modified .husky/pre-push
100644 → 100755
Empty file.
21 changes: 11 additions & 10 deletions __test__/0.0.0-case.test.js → __test__/0.0.0-flow-simple.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ const assert = require('uvu/assert')
const { addKeyword, createBot, createFlow } = require('../packages/bot/index')
const { setup, clear, delay } = require('../__mocks__/env')

const suiteCase = suite('Flujo: Simple')
const testSuite = suite('Flujo: Simple')

suiteCase.before.each(setup)
suiteCase.after.each(clear)
testSuite.before.each(setup)
testSuite.after.each(clear)

suiteCase(`Responder a "hola"`, async ({ database, provider }) => {
const flow = addKeyword('hola').addAnswer('Buenas!').addAnswer('Como vamos!')
testSuite(`Responder a "hola"`, async ({ database, provider }) => {
const helloFlow = addKeyword('hola').addAnswer('Buenas!').addAnswer('Como vamos!')

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

await provider.delaySendMessage(0, 'message', {
Expand All @@ -23,18 +23,19 @@ suiteCase(`Responder a "hola"`, async ({ database, provider }) => {
})

await delay(50)

assert.is('Buenas!', database.listHistory[0].answer)
assert.is('Como vamos!', database.listHistory[1].answer)
assert.is(undefined, database.listHistory[2])
})

suiteCase(`NO reponder a "pepe"`, async ({ database, provider }) => {
const flow = addKeyword('hola').addAnswer('Buenas!').addAnswer('Como vamos!')
testSuite(`NO responder a "pepe"`, async ({ database, provider }) => {
const helloFlow = addKeyword('hola').addAnswer('Buenas!').addAnswer('Como vamos!')

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

await provider.delaySendMessage(0, 'message', {
Expand All @@ -48,4 +49,4 @@ suiteCase(`NO reponder a "pepe"`, async ({ database, provider }) => {
assert.is(undefined, database.listHistory[1])
})

suiteCase.run()
testSuite.run()
111 changes: 0 additions & 111 deletions __test__/0.0.1-case.test.js

This file was deleted.

111 changes: 111 additions & 0 deletions __test__/0.0.1-flow-events.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
const { suite } = require('uvu')
const assert = require('uvu/assert')
const { addKeyword, createBot, createFlow, EVENTS } = require('../packages/bot/index')
const { setup, clear, delay } = require('../__mocks__/env')

const testSuite = suite('Flujo: enviando eventos')

testSuite.before.each(setup)
testSuite.after.each(clear)

testSuite(`Responder a "EVENTS.LOCATION"`, async ({ database, provider }) => {
const locationFlow = addKeyword(EVENTS.LOCATION).addAnswer('Gracias por tu location')

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

await provider.delaySendMessage(0, 'message', {
from: '000',
body: '_event_location__f405d946-cf07-uutt-l7e0-b6d475bc7f81',
})

await delay(200)
const history = database.listHistory.map((item) => item.answer)
assert.is('Gracias por tu location', history[0])
assert.is(undefined, history[1])
})

testSuite(`Responder a "EVENTS.DOCUMENT"`, async ({ database, provider }) => {
const documentFlow = addKeyword(EVENTS.DOCUMENT).addAnswer('Gracias por tu documento')

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

await provider.delaySendMessage(0, 'message', {
from: '000',
body: '_event_document__f405d946-cf07-uutt-l7e0-b6d475bc7f81',
})

await delay(200)
const history = database.listHistory.map((item) => item.answer)
assert.is('Gracias por tu documento', history[0])
assert.is(undefined, history[1])
})

testSuite(`Responder a "EVENTS.WELCOME"`, async ({ database, provider }) => {
const welcomeFlow = addKeyword(EVENTS.WELCOME).addAnswer('Bienvenido!')

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

await provider.delaySendMessage(0, 'message', {
from: '000',
body: '_event_welcome__f405d946-cf07-uutt-l7e0-b6d475bc7f81',
})

await delay(200)
const history = database.listHistory.map((item) => item.answer)
assert.is('Bienvenido!', history[0])
assert.is(undefined, history[1])
})

testSuite(`Responder a "EVENTS.MEDIA"`, async ({ database, provider }) => {
const mediaFlow = addKeyword(EVENTS.MEDIA).addAnswer('gracias por la imagen o video!')

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

await provider.delaySendMessage(0, 'message', {
from: '000',
body: '_event_media__f405d946-cf07-uutt-l7e0-b6d475bc7f81',
})

await delay(200)
const history = database.listHistory.map((item) => item.answer)
assert.is('gracias por la imagen o video!', history[0])
assert.is(undefined, history[1])
})

testSuite(`Responder a "EVENTS.VOICE_NOTE"`, async ({ database, provider }) => {
const voiceNoteFlow = addKeyword(EVENTS.VOICE_NOTE).addAnswer('gracias por la nota de voz!')

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

await provider.delaySendMessage(0, 'message', {
from: '000',
body: '_event_voice_note__f405d946-cf07-uutt-l7e0-b6d475bc7f81',
})

await delay(200)
const history = database.listHistory.map((item) => item.answer)
assert.is('gracias por la nota de voz!', history[0])
assert.is(undefined, history[1])
})

testSuite.run()
119 changes: 0 additions & 119 deletions __test__/0.0.2-case.test.js

This file was deleted.

Loading