@tiledesk/tiledesk-whatsapp-connector 0.1.88 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -518,9 +518,9 @@ router.post("/disconnect", async (req, res) => {
518
518
  let token = req.body.token;
519
519
  let subscriptionId = req.body.subscription_id;
520
520
 
521
- let deleted = await deleteSettingsByProjectId(project_id);
521
+ let deleted = await utils.deleteSettingsByProjectId(project_id);
522
522
  if (!deleted) {
523
- deleted = deleteSettings(project_id, null)
523
+ deleted = utils.deleteSettings(project_id, null)
524
524
  }
525
525
 
526
526
  if (!deleted) {
package/logs/app.log CHANGED
@@ -4788,3 +4788,60 @@ info: (wab api) JOB_TOPIC_EXCHANGE is present
4788
4788
  info: (wab) Redis ready!
4789
4789
  info: (wab) KVBaseMongo successfully connected.
4790
4790
  info: (wab) Mongoose DB Connected
4791
+ info: (wab) Starting Whatsapp App
4792
+ info: (wab) API_URL: https://tiledesk-server-pre.herokuapp.com
4793
+ info: (wab) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4794
+ info: (wab) BASE_URL: https://3f2a5d6f5bef.ngrok-free.app
4795
+ info: (wab) GRAPH_URL: https://graph.facebook.com/v23.0/
4796
+ info: (wab) APPS_API_URL: https://tiledesk-apps.herokuapp.com
4797
+ info: (wab) AMQP_MANAGER_URL is present
4798
+ info: (wab) JOB_TOPIC_EXCHANGE is present
4799
+ info: (wab) FB_APP_ID is present
4800
+ info: (wab) CONFIGURATION_ID is present
4801
+ info: (wab api) Starting api route
4802
+ info: (wab api) GRAPH_URL: https://graph.facebook.com/v23.0/
4803
+ info: (wab api) API_URL: https://tiledesk-server-pre.herokuapp.com
4804
+ info: (wab api) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4805
+ info: (wab api) AMQP_MANAGER_URL is present
4806
+ info: (wab api) JOB_TOPIC_EXCHANGE is present
4807
+ info: (wab) Redis ready!
4808
+ info: (wab) Mongoose DB Connected
4809
+ info: (wab) KVBaseMongo successfully connected.
4810
+ info: (wab) Starting Whatsapp App
4811
+ info: (wab) API_URL: https://tiledesk-server-pre.herokuapp.com
4812
+ info: (wab) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4813
+ info: (wab) BASE_URL: https://3f2a5d6f5bef.ngrok-free.app
4814
+ info: (wab) GRAPH_URL: https://graph.facebook.com/v23.0/
4815
+ info: (wab) APPS_API_URL: https://tiledesk-apps.herokuapp.com
4816
+ info: (wab) AMQP_MANAGER_URL is present
4817
+ info: (wab) JOB_TOPIC_EXCHANGE is present
4818
+ info: (wab) FB_APP_ID is present
4819
+ info: (wab) CONFIGURATION_ID is present
4820
+ info: (wab api) Starting api route
4821
+ info: (wab api) GRAPH_URL: https://graph.facebook.com/v23.0/
4822
+ info: (wab api) API_URL: https://tiledesk-server-pre.herokuapp.com
4823
+ info: (wab api) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4824
+ info: (wab api) AMQP_MANAGER_URL is present
4825
+ info: (wab api) JOB_TOPIC_EXCHANGE is present
4826
+ info: (wab) Redis ready!
4827
+ info: (wab) Mongoose DB Connected
4828
+ info: (wab) KVBaseMongo successfully connected.
4829
+ info: (wab) Starting Whatsapp App
4830
+ info: (wab) API_URL: https://tiledesk-server-pre.herokuapp.com
4831
+ info: (wab) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4832
+ info: (wab) BASE_URL: https://3f2a5d6f5bef.ngrok-free.app
4833
+ info: (wab) GRAPH_URL: https://graph.facebook.com/v23.0/
4834
+ info: (wab) APPS_API_URL: https://tiledesk-apps.herokuapp.com
4835
+ info: (wab) AMQP_MANAGER_URL is present
4836
+ info: (wab) JOB_TOPIC_EXCHANGE is present
4837
+ info: (wab) FB_APP_ID is present
4838
+ info: (wab) CONFIGURATION_ID is present
4839
+ info: (wab api) Starting api route
4840
+ info: (wab api) GRAPH_URL: https://graph.facebook.com/v23.0/
4841
+ info: (wab api) API_URL: https://tiledesk-server-pre.herokuapp.com
4842
+ info: (wab api) BASE_FILE_URL: https://tiledesk-server-pre.herokuapp.com
4843
+ info: (wab api) AMQP_MANAGER_URL is present
4844
+ info: (wab api) JOB_TOPIC_EXCHANGE is present
4845
+ info: (wab) Mongoose DB Connected
4846
+ info: (wab) KVBaseMongo successfully connected.
4847
+ info: (wab) Redis ready!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-whatsapp-connector",
3
- "version": "0.1.88",
3
+ "version": "1.0.1",
4
4
  "description": "Tiledesk Whatsapp connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -513,38 +513,42 @@
513
513
  </script>
514
514
 
515
515
  <script>
516
- document.getElementById('connection-type').addEventListener('change', function () {
517
- const type = this.value; // "oauth" o "manual"
518
- const params = new URLSearchParams(window.location.search);
519
- params.set('type', type);
520
- //window.location.href = '/configure?' + params.toString();
521
- window.location.href = window.location.pathname + '?' + params.toString();
522
-
523
- });
516
+ let connection_select = document.getElementById('connection-type');
517
+ if (connection_select) {
518
+ connection_select.addEventListener('change', function () {
519
+ const type = this.value; // "oauth" o "manual"
520
+ const params = new URLSearchParams(window.location.search);
521
+ params.set('type', type);
522
+ window.location.href = window.location.pathname + '?' + params.toString();
523
+ })
524
+ }
524
525
  </script>
525
526
 
526
527
  <script>
527
- document.getElementById('department-select').addEventListener('change', function() {
528
- document.getElementById('loader').style.display = 'flex';
529
- const dep_id = this.value;
530
- const params = new URLSearchParams(window.location.search);
531
-
532
- fetch('/update/department?' + params, {
533
- method: 'PUT',
534
- headers: {
535
- 'Content-Type': 'application/json'
536
- },
537
- body: JSON.stringify({
538
- department_id: dep_id
528
+ let department_select = document.getElementById('department-select');
529
+ if (department_select) {
530
+ department_select.addEventListener('change', function() {
531
+ document.getElementById('loader').style.display = 'flex';
532
+ const dep_id = this.value;
533
+ const params = new URLSearchParams(window.location.search);
534
+
535
+ fetch('/update/department?' + params, {
536
+ method: 'PUT',
537
+ headers: {
538
+ 'Content-Type': 'application/json'
539
+ },
540
+ body: JSON.stringify({
541
+ department_id: dep_id
542
+ })
539
543
  })
544
+ .then(res => {
545
+ document.getElementById('loader').style.display = 'none';
546
+ }).catch(err => {
547
+ document.getElementById('loader').innerHTML = '<p>Errore durante il caricamento</p>';
548
+ console.error("Error: ", err)
549
+ });
540
550
  })
541
- .then(res => {
542
- document.getElementById('loader').style.display = 'none';
543
- }).catch(err => {
544
- document.getElementById('loader').innerHTML = '<p>Errore durante il caricamento</p>';
545
- console.error("Error: ", err)
546
- });
547
- })
551
+ }
548
552
  </script>
549
553
 
550
554
  <script>