@tiledesk/tiledesk-server 2.10.85 → 2.10.86

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.
@@ -8,8 +8,8 @@ var winston = require('../config/winston');
8
8
  async function up () {
9
9
  await new Promise((resolve, reject) => {
10
10
 
11
- // { $exists: true } to fix: The positional operator did not find the match needed from the query.
12
- Label.updateMany({$where: "this.data.length == 1","data": { $exists: true } }, {"$set": {"data.$.default": true}}, function (err, updates) {
11
+ // { $exists: true } to fix: The positional operator did not find the match needed from the query.
12
+ Label.updateMany({ data: { $exists: true }, "data.1": { $exists: false } }, {"$set": {"data.$.default": true}}, function (err, updates) {
13
13
  if (err) {
14
14
  winston.error("Schema migration: label err1", err);
15
15
  }
@@ -19,19 +19,19 @@ async function up () {
19
19
  // {"data": { $elemMatch: {"lang": { $ne: "EN" }}}}
20
20
  // Label.updateMany({$where: "this.data.length > 1", 'data.lang': {$ne: "EN"}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
21
21
  // Label.updateMany({$where: "this.data.length > 1", 'data.lang': {$nin: ["EN"]}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
22
- Label.updateMany({$where: "this.data.length > 1", "data": { $elemMatch: {"lang": { $ne: "EN" }}}} , {"$set": {"data.$[].default": false}}, function (err, updates) {
23
- if (err) {
24
- winston.error("Schema migration: label err2", err);
25
- }
26
- winston.info("Schema updated for " + updates.nModified + " label to default false field")
22
+ Label.updateMany({ data: { $elemMatch: { "lang": { $ne: "EN" } } }, "data.1": { $exists: true } } , {"$set": {"data.$[].default": false}}, function (err, updates) {
23
+ if (err) {
24
+ winston.error("Schema migration: label err2", err);
25
+ }
26
+ winston.info("Schema updated for " + updates.nModified + " label to default false field")
27
27
 
28
- Label.updateMany({$where: "this.data.length > 1", "data.lang": "EN"}, {"$set": {"data.$.default": true}}, function (err, updates) {
29
- if (err) {
30
- winston.error("Schema migration: label err3", err);
31
- }
32
- winston.info("Schema updated for " + updates.nModified + " label with multiple data to default field")
33
- return resolve('ok');
34
- });
28
+ Label.updateMany({"data.lang": "EN", "data.1": { $exists: true } }, {"$set": {"data.$.default": true}}, function (err, updates) {
29
+ if (err) {
30
+ winston.error("Schema migration: label err3", err);
31
+ }
32
+ winston.info("Schema updated for " + updates.nModified + " label with multiple data to default field")
33
+ return resolve('ok');
34
+ });
35
35
 
36
36
  // return resolve('ok');
37
37
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.10.85",
4
+ "version": "2.10.86",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -52,7 +52,7 @@
52
52
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.12",
53
53
  "@tiledesk/tiledesk-sms-connector": "^0.1.11",
54
54
  "@tiledesk/tiledesk-vxml-connector": "^0.1.76",
55
- "@tiledesk/tiledesk-voice-twilio-connector": "^0.1.12",
55
+ "@tiledesk/tiledesk-voice-twilio-connector": "^0.1.16",
56
56
  "@tiledesk/tiledesk-multi-worker": "^0.1.20",
57
57
  "passport-oauth2": "^1.8.0",
58
58
  "amqplib": "^0.5.5",
@@ -31,6 +31,11 @@ class Listener {
31
31
  brand_name = process.env.BRAND_NAME
32
32
  }
33
33
 
34
+ let openai_endpoint = process.env.OPENAI_ENDPOINT;
35
+ winston.debug("OpenAI Endpoint: ", openai_endpoint);
36
+
37
+ let gpt_key = process.env.GPTKEY;
38
+
34
39
  let log = process.env.VOICE_TWILIO_LOG || false
35
40
  winston.debug("Voice log: "+ log);
36
41
 
@@ -42,6 +47,8 @@ class Listener {
42
47
  REDIS_PORT: port,
43
48
  REDIS_PASSWORD: password,
44
49
  BRAND_NAME: brand_name,
50
+ OPENAI_ENDPOINT: openai_endpoint,
51
+ GPT_KEY: gpt_key,
45
52
  log: log
46
53
  }, (err) => {
47
54
  if (!err) {