@tiledesk/tiledesk-server 2.13.42 → 2.13.44
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/CHANGELOG.md +7 -1
- package/deploynew.sh +43 -0
- package/package.json +2 -2
- package/services/requestService.js +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
🚀 IN PRODUCTION 🚀
|
|
6
6
|
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
|
|
7
7
|
|
|
8
|
-
# 2.13.
|
|
8
|
+
# 2.13.44
|
|
9
|
+
- Updated tybot-connector to 2.0.39
|
|
10
|
+
|
|
11
|
+
# 2.13.43
|
|
12
|
+
- Updated requestService to improve fully abandoned management
|
|
13
|
+
|
|
14
|
+
# 2.13.42
|
|
9
15
|
- Updated whatsapp-connector to 1.0.17
|
|
10
16
|
|
|
11
17
|
# 2.13.40
|
package/deploynew.sh
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Load .env variables
|
|
4
|
+
if [ -f .env ]; then
|
|
5
|
+
export $(grep -v '^#' .env | xargs)
|
|
6
|
+
fi
|
|
7
|
+
|
|
8
|
+
# Check if the token is set
|
|
9
|
+
if [ -z "$NPM_PUBLISH_TOKEN" ]; then
|
|
10
|
+
echo "⚠️ Missing NPM_PUBLISH_TOKEN in environment."
|
|
11
|
+
echo "You can speed up the process by setting the environment variable with your publish token."
|
|
12
|
+
read -p "Do you want to continue with manual login? (y/n): " choice
|
|
13
|
+
if [[ "$choice" != "y" && "$choice" != "Y" ]]; then
|
|
14
|
+
echo "❌ Deploy aborted."
|
|
15
|
+
exit 1
|
|
16
|
+
else
|
|
17
|
+
echo "💡 Proceed with 'npm login' manually..."
|
|
18
|
+
npm login
|
|
19
|
+
fi
|
|
20
|
+
else
|
|
21
|
+
# Create temporary .npmrc with the token
|
|
22
|
+
echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}" > ~/.npmrc
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
git pull
|
|
26
|
+
npm version patch
|
|
27
|
+
version=`node -e 'console.log(require("./package.json").version)'`
|
|
28
|
+
echo "version $version"
|
|
29
|
+
|
|
30
|
+
if [ "$version" != "" ]; then
|
|
31
|
+
git tag -a "$version" -m "`git log -1 --format=%s`"
|
|
32
|
+
echo "Created a new tag, $version"
|
|
33
|
+
git push --tags
|
|
34
|
+
npm publish --access public
|
|
35
|
+
fi
|
|
36
|
+
git push
|
|
37
|
+
|
|
38
|
+
# Remove temporary .npmrc if created
|
|
39
|
+
if [ -f ~/.npmrc ]; then
|
|
40
|
+
rm ~/.npmrc
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
echo "🎉 Deploy completed!"
|
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.13.
|
|
4
|
+
"version": "2.13.44",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node ./bin/www",
|
|
7
7
|
"pretest": "mongodb-runner start",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
|
|
50
50
|
"@tiledesk/tiledesk-sms-connector": "^0.1.11",
|
|
51
51
|
"@tiledesk/tiledesk-telegram-connector": "^0.1.14",
|
|
52
|
-
"@tiledesk/tiledesk-tybot-connector": "^2.0.
|
|
52
|
+
"@tiledesk/tiledesk-tybot-connector": "^2.0.39",
|
|
53
53
|
"@tiledesk/tiledesk-voice-twilio-connector": "^0.1.22",
|
|
54
54
|
"@tiledesk/tiledesk-vxml-connector": "^0.1.87",
|
|
55
55
|
"@tiledesk/tiledesk-whatsapp-connector": "1.0.17",
|
|
@@ -345,6 +345,29 @@ class RequestService {
|
|
|
345
345
|
.execPopulate(function (err, requestComplete) {
|
|
346
346
|
winston.debug("requestComplete", requestComplete);
|
|
347
347
|
|
|
348
|
+
var oldParticipants = beforeParticipants;
|
|
349
|
+
winston.debug("oldParticipants ", oldParticipants);
|
|
350
|
+
|
|
351
|
+
let newParticipants = requestComplete.participants;
|
|
352
|
+
winston.debug("newParticipants ", newParticipants);
|
|
353
|
+
|
|
354
|
+
var removedParticipants = oldParticipants.filter(d => !newParticipants.includes(d));
|
|
355
|
+
winston.debug("removedParticipants ", removedParticipants);
|
|
356
|
+
|
|
357
|
+
var addedParticipants = newParticipants.filter(d => !oldParticipants.includes(d));
|
|
358
|
+
winston.debug("addedParticipants ", addedParticipants);
|
|
359
|
+
|
|
360
|
+
requestEvent.emit('request.update', requestComplete);
|
|
361
|
+
requestEvent.emit("request.update.comment", { comment: "REROUTE", request: requestComplete });//Deprecated
|
|
362
|
+
requestEvent.emit("request.updated", { comment: "REROUTE", request: requestComplete, patch: { removedParticipants: removedParticipants, addedParticipants: addedParticipants } });
|
|
363
|
+
|
|
364
|
+
requestEvent.emit('request.participants.update', {
|
|
365
|
+
beforeRequest: request,
|
|
366
|
+
removedParticipants: removedParticipants,
|
|
367
|
+
addedParticipants: addedParticipants,
|
|
368
|
+
request: requestComplete
|
|
369
|
+
});
|
|
370
|
+
|
|
348
371
|
return resolve(requestComplete);
|
|
349
372
|
});
|
|
350
373
|
}
|