mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 20:49:15 +00:00
monorepo/cli
This commit is contained in:
82
package-lock.json
generated
82
package-lock.json
generated
@@ -8,6 +8,11 @@
|
|||||||
"name": "bot-whatsapp",
|
"name": "bot-whatsapp",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
"workspaces": [
|
||||||
|
"packages/cli",
|
||||||
|
"packages/io",
|
||||||
|
"packages/providers"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google-cloud/dialogflow": "^5.2.0",
|
"@google-cloud/dialogflow": "^5.2.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
@@ -27,8 +32,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"pm2": "^5.2.0",
|
"pm2": "^5.2.0",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1"
|
||||||
"rollup": "^3.2.3"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "16.x"
|
"node": "16.x"
|
||||||
@@ -1133,6 +1137,10 @@
|
|||||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/cli": {
|
||||||
|
"resolved": "packages/cli",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
"node_modules/cli-tableau": {
|
"node_modules/cli-tableau": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz",
|
||||||
@@ -2728,6 +2736,15 @@
|
|||||||
"graceful-fs": "^4.1.9"
|
"graceful-fs": "^4.1.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/kleur": {
|
||||||
|
"version": "4.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
|
||||||
|
"integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lazy": {
|
"node_modules/lazy": {
|
||||||
"version": "1.0.11",
|
"version": "1.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz",
|
||||||
@@ -4242,22 +4259,6 @@
|
|||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
|
||||||
"version": "3.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.2.3.tgz",
|
|
||||||
"integrity": "sha512-qfadtkY5kl0F5e4dXVdj2D+GtOdifasXHFMiL1SMf9ADQDv5Eti6xReef9FKj+iQPR2pvtqWna57s/PjARY4fg==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"rollup": "dist/bin/rollup"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0",
|
|
||||||
"npm": ">=8.0.0"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"fsevents": "~2.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/run-series": {
|
"node_modules/run-series": {
|
||||||
"version": "1.1.9",
|
"version": "1.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz",
|
||||||
@@ -5126,6 +5127,15 @@
|
|||||||
"which": "bin/which"
|
"which": "bin/which"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which-pm-runs": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wmf": {
|
"node_modules/wmf": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
||||||
@@ -5319,6 +5329,14 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"packages/cli": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"kleur": "^4.1.5",
|
||||||
|
"which-pm-runs": "^1.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -6192,6 +6210,13 @@
|
|||||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||||
},
|
},
|
||||||
|
"cli": {
|
||||||
|
"version": "file:packages/cli",
|
||||||
|
"requires": {
|
||||||
|
"kleur": "*",
|
||||||
|
"which-pm-runs": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"cli-tableau": {
|
"cli-tableau": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cli-tableau/-/cli-tableau-2.0.1.tgz",
|
||||||
@@ -7435,6 +7460,12 @@
|
|||||||
"graceful-fs": "^4.1.9"
|
"graceful-fs": "^4.1.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"kleur": {
|
||||||
|
"version": "4.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
|
||||||
|
"integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"lazy": {
|
"lazy": {
|
||||||
"version": "1.0.11",
|
"version": "1.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz",
|
||||||
@@ -8598,15 +8629,6 @@
|
|||||||
"glob": "^7.1.3"
|
"glob": "^7.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rollup": {
|
|
||||||
"version": "3.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.2.3.tgz",
|
|
||||||
"integrity": "sha512-qfadtkY5kl0F5e4dXVdj2D+GtOdifasXHFMiL1SMf9ADQDv5Eti6xReef9FKj+iQPR2pvtqWna57s/PjARY4fg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fsevents": "~2.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"run-series": {
|
"run-series": {
|
||||||
"version": "1.1.9",
|
"version": "1.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.9.tgz",
|
||||||
@@ -9260,6 +9282,12 @@
|
|||||||
"isexe": "^2.0.0"
|
"isexe": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"which-pm-runs": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"wmf": {
|
"wmf": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"start": "node ./app.js",
|
"start": "node ./app.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"workspaces":[
|
"workspaces": [
|
||||||
"packages/cli",
|
"packages/cli",
|
||||||
"packages/io",
|
"packages/io",
|
||||||
"packages/providers"
|
"packages/providers"
|
||||||
|
|||||||
4
packages/cli/TODO.md
Normal file
4
packages/cli/TODO.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- [X] Revisar version de NODE
|
||||||
|
- [X] Revisar OS
|
||||||
|
- Obtener Package Manager
|
||||||
|
- Revisar las libreria de WhatsappWeb para obtener version reciente
|
||||||
34
packages/cli/check.js
Normal file
34
packages/cli/check.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const {red, yellow} = require('kleur')
|
||||||
|
|
||||||
|
const checkNodeVersion = () => {
|
||||||
|
const version = process.version;
|
||||||
|
const majorVersion = parseInt(version.replace('v','').split('.').shift())
|
||||||
|
if(majorVersion < 16){
|
||||||
|
console.error(
|
||||||
|
red(`🔴 Se require Node.js 16 o superior. Actualmente esta ejecutando Node.js ${version}`)
|
||||||
|
)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkOs = () => {
|
||||||
|
const os = process.platform
|
||||||
|
if(!os.includes('win32')){
|
||||||
|
const messages = [
|
||||||
|
`El sistema operativo actual (${os}) posiblemente requiera`,
|
||||||
|
`una confiuración adicional referente al puppeter`,
|
||||||
|
``,
|
||||||
|
`Recuerda pasar por el WIKI`,
|
||||||
|
`🔗 https://github.com/leifermendez/bot-whatsapp/wiki/Instalaci%C3%B3n`,
|
||||||
|
``
|
||||||
|
]
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
yellow(messages.join(' \n'))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports ={ checkNodeVersion, checkOs }
|
||||||
0
packages/cli/index.js
Normal file
0
packages/cli/index.js
Normal file
15
packages/cli/package.json
Normal file
15
packages/cli/package.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "cli",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"kleur": "^4.1.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
packages/cli/tool.js
Normal file
0
packages/cli/tool.js
Normal file
Reference in New Issue
Block a user