From 0dffd83c5798e4a9155ab39c5bcad17e74cf5d71 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Tue, 7 Feb 2023 19:12:27 +0100 Subject: [PATCH] updated whatsapp connector version fix GRAPH_URL error --- package-lock.json | 142 +++++++++++++++++++++++--------- package.json | 2 +- pubmodules/kaleyra/listener.js | 26 +++--- pubmodules/whatsapp/listener.js | 24 +++--- 4 files changed, 131 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index 952899fd8dc..66c70ddf5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1722,7 +1722,7 @@ "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" }, "@protobufjs/base64": { "version": "1.1.2", @@ -1737,12 +1737,12 @@ "@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" }, "@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", "requires": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -1751,27 +1751,69 @@ "@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" }, "@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" }, "@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" }, "@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" }, "@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==" + }, + "@redis/client": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.5.tgz", + "integrity": "sha512-fuMnpDYSjT5JXR9rrCW1YWA4L8N/9/uS4ImT3ZEC/hcaQRI1D/9FvwjriRj1UvepIgzZXthFVKMNRzP/LNL7BQ==", + "requires": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "@redis/graph": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.0.tgz", + "integrity": "sha512-16yZWngxyXPd+MJxeSr0dqh2AIOi8j9yXKcKCwVaKDbH3HTuETpDVPcLujhFYVPtYrngSco31BUcSa9TH31Gqg==" + }, + "@redis/json": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.4.tgz", + "integrity": "sha512-LUZE2Gdrhg0Rx7AN+cZkb1e6HjoSKaeeW8rYnt89Tly13GBI5eP4CwDVr+MY8BAYfCg4/N15OUrtLoona9uSgw==" + }, + "@redis/search": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.1.1.tgz", + "integrity": "sha512-pqCXTc5e7wJJgUuJiC3hBgfoFRoPxYzwn0BEfKgejTM7M/9zP3IpUcqcjgfp8hF+LoV8rHZzcNTz7V+pEIY7LQ==" + }, + "@redis/time-series": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.0.4.tgz", + "integrity": "sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng==" }, "@selderee/plugin-htmlparser2": { "version": "0.6.0", @@ -2641,9 +2683,9 @@ } }, "@tiledesk/tiledesk-whatsapp-connector": { - "version": "0.1.22", - "resolved": "https://registry.npmjs.org/@tiledesk/tiledesk-whatsapp-connector/-/tiledesk-whatsapp-connector-0.1.22.tgz", - "integrity": "sha512-HlCAbNGFKk4S9JyF3IEI4HITuniZG8i0kHNK9CTUOodBOKX5fsis7FOhAVjINDR2FBq9/gUNBIp3W7xdtHW7SQ==", + "version": "0.1.24", + "resolved": "https://registry.npmjs.org/@tiledesk/tiledesk-whatsapp-connector/-/tiledesk-whatsapp-connector-0.1.24.tgz", + "integrity": "sha512-5+Klqf9zshbGOuQyLoEq/53kQJX3SKSRp24ALgFa9ftMoZYgX/LsFft3dly055x7MdNpzOLDvMyof4ssnpsW8Q==", "requires": { "@tiledesk/tiledesk-client": "^0.8.29", "@tiledesk/tiledesk-kvbasemongo": "^1.0.0", @@ -2657,13 +2699,14 @@ "jsonwebtoken": "^8.5.1", "mongoose": "^6.5.0", "multer": "^1.4.5-lts.1", + "redis": "^4.5.1", "uuid": "^8.3.2" }, "dependencies": { "@tiledesk/tiledesk-client": { - "version": "0.8.36", - "resolved": "https://registry.npmjs.org/@tiledesk/tiledesk-client/-/tiledesk-client-0.8.36.tgz", - "integrity": "sha512-PHBtU05Weg9t38dJGUqN88vze0voJKFU1mETgPk8xCL465QOdE3KFnFsf57Q3rNsU539iQCvluZqESWIL/TvlA==", + "version": "0.8.42", + "resolved": "https://registry.npmjs.org/@tiledesk/tiledesk-client/-/tiledesk-client-0.8.42.tgz", + "integrity": "sha512-QwwKREwkM88mOaUlg2DRm8QzZb892W5/NpSxPNSvd2P151SI8VS9qwfQbM3qgUolGnHrJ5+aa0Xf5yRtGsXokA==", "requires": { "axios": "^0.21.1", "dotenv": "^10.0.0", @@ -2695,9 +2738,9 @@ } }, "bson": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.0.tgz", - "integrity": "sha512-VrlEE4vuiO1WTpfof4VmaVolCVYkYTgB9iWgYNOrVlnifpME/06fhFRmONgBhClD5pFC1t9ZWqFUQEQAzY43bA==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", + "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", "requires": { "buffer": "^5.6.0" } @@ -2731,11 +2774,6 @@ "ms": "2.0.0" } }, - "denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" - }, "dotenv": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", @@ -2825,9 +2863,9 @@ } }, "kareem": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.4.1.tgz", - "integrity": "sha512-aJ9opVoXroQUPfovYP5kaj2lM7Jn02Gw13bL0lg9v0V7SaUc0qavPs0Eue7d2DcC3NjqI6QAUElXNsuZSeM+EA==" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", + "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==" }, "mime": { "version": "1.6.0", @@ -2835,26 +2873,25 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mongodb": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.11.0.tgz", - "integrity": "sha512-9l9n4Nk2BYZzljW3vHah3Z0rfS5npKw6ktnkmFgTcnzaXH1DRm3pDl6VMHu84EVb1lzmSaJC4OzWZqTkB5i2wg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.13.0.tgz", + "integrity": "sha512-+taZ/bV8d1pYuHL4U+gSwkhmDrwkWbH1l4aah4YpmpscMwgFBkufIKxgP/G7m87/NUuQzc2Z75ZTI7ZOyqZLbw==", "requires": { "@aws-sdk/credential-providers": "^3.186.0", "bson": "^4.7.0", - "denque": "^2.1.0", "mongodb-connection-string-url": "^2.5.4", "saslprep": "^1.0.3", "socks": "^2.7.1" } }, "mongoose": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.7.2.tgz", - "integrity": "sha512-lrP2V5U1qhaf+z33fiIn7aYAZZ1fVDly+TkFRjTujNBF/FIHESATj2RbgAOSlWqv32fsZXkXejXzeVfjbv35Ow==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.9.1.tgz", + "integrity": "sha512-hOz1ZWV0w6WEVLrj89Wpk7PXDYtDDF6k7/NX79lY5iKqeFtZsceBXW8xW59YFNcW5O3cH32hQ8IbDlhgyBsDMA==", "requires": { "bson": "^4.7.0", - "kareem": "2.4.1", - "mongodb": "4.11.0", + "kareem": "2.5.1", + "mongodb": "4.13.0", "mpath": "0.9.0", "mquery": "4.0.3", "ms": "2.1.3", @@ -2931,6 +2968,19 @@ "side-channel": "^1.0.4" } }, + "redis": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.6.4.tgz", + "integrity": "sha512-wi2tgDdQ+Q8q+PR5FLRx4QvDiWaA+PoJbrzsyFqlClN5R4LplHqN3scs/aGjE//mbz++W19SgxiEnQ27jnCRaA==", + "requires": { + "@redis/bloom": "1.2.0", + "@redis/client": "1.5.5", + "@redis/graph": "1.1.0", + "@redis/json": "1.0.4", + "@redis/search": "1.1.1", + "@redis/time-series": "1.0.4" + } + }, "send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -4621,6 +4671,11 @@ "cli-color": "0.3.2" } }, + "cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==" + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -5952,7 +6007,7 @@ "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "optional": true }, "entities": { @@ -6703,7 +6758,7 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "optional": true }, "functions-have-names": { @@ -6815,6 +6870,11 @@ "json-bigint": "^1.0.0" } }, + "generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==" + }, "geoip-lite": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/geoip-lite/-/geoip-lite-1.4.5.tgz", @@ -8753,12 +8813,12 @@ "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" }, "lodash.defaults": { "version": "4.2.0", @@ -9006,7 +9066,7 @@ "lru-cache": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", + "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", "requires": { "pseudomap": "^1.0.1", "yallist": "^2.0.0" @@ -12290,7 +12350,7 @@ "stubs": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=", "optional": true }, "superagent": { @@ -13291,7 +13351,7 @@ "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==" + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" }, "xtend": { "version": "4.0.2", diff --git a/package.json b/package.json index 8744d4310cb..b72fe5a68cd 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@tiledesk/tiledesk-kaleyra-proxy": "^0.1.6", "@tiledesk/tiledesk-rasa-connector": "^1.0.10", "@tiledesk/tiledesk-tybot-connector": "^0.1.55", - "@tiledesk/tiledesk-whatsapp-connector": "^0.1.19", + "@tiledesk/tiledesk-whatsapp-connector": "^0.1.24", "amqplib": "^0.5.5", "app-root-path": "^3.0.0", "bcrypt-nodejs": "0.0.3", diff --git a/pubmodules/kaleyra/listener.js b/pubmodules/kaleyra/listener.js index a41a575b5a2..e1b7b54f81e 100644 --- a/pubmodules/kaleyra/listener.js +++ b/pubmodules/kaleyra/listener.js @@ -13,17 +13,21 @@ class Listener { winston.debug("kaleyra config databaseUri: " + config.databaseUri); } - kaleyra.startApp({ - MONGODB_URL: config.databaseUri, - API_URL: apiUrl, - BASE_URL: apiUrl + "/modules/kaleyra", - APPS_API_URL: apiUrl + "/modules/apps", - KALEYRA_API_URL: process.env.KALEYRA_API_URL, - API_KEY: process.env.API_KEY, - log: process.env.KALEYRA_LOG - }, () => { - winston.info("Tiledesk Kaleyra proxy server succesfully started."); - }) + if (!process.env.KALEYRA_API_URL || !process.env.API_KEY) { + winston.info("Skip Kaleyra startApp") + } else { + kaleyra.startApp({ + MONGODB_URL: config.databaseUri, + API_URL: apiUrl, + BASE_URL: apiUrl + "/modules/kaleyra", + APPS_API_URL: apiUrl + "/modules/apps", + KALEYRA_API_URL: process.env.KALEYRA_API_URL, + API_KEY: process.env.API_KEY, + log: process.env.KALEYRA_LOG + }, () => { + winston.info("Tiledesk Kaleyra proxy server succesfully started."); + }) + } } } diff --git a/pubmodules/whatsapp/listener.js b/pubmodules/whatsapp/listener.js index 3717225c0b9..aa84bdeb0ff 100644 --- a/pubmodules/whatsapp/listener.js +++ b/pubmodules/whatsapp/listener.js @@ -13,16 +13,20 @@ class Listener { winston.debug("whatsapp config databaseUri: " + config.databaseUri); } - whatsapp.startApp({ - MONGODB_URL: config.databaseUri, - API_URL: apiUrl, - GRAPH_URL: process.env.META_GRAPH_URL || config.graphUrl, - BASE_URL: apiUrl + "/modules/whatsapp", - APPS_API_URL: apiUrl + "/modules/apps", - log: process.env.WHATSAPP_LOG - }, () => { - winston.info("Tiledesk WhatsApp Connector proxy server succesfully started."); - }) + if (!process.env.GRAPH_URL || !config.graphUrl) { + winston.info("Skip WhatsApp startApp") + } else { + whatsapp.startApp({ + MONGODB_URL: config.databaseUri, + API_URL: apiUrl, + GRAPH_URL: process.env.META_GRAPH_URL || config.graphUrl, + BASE_URL: apiUrl + "/modules/whatsapp", + APPS_API_URL: apiUrl + "/modules/apps", + log: process.env.WHATSAPP_LOG + }, () => { + winston.info("Tiledesk WhatsApp Connector proxy server succesfully started."); + }) + } } }