@tiledesk/tiledesk-whatsapp-connector 1.0.15 → 1.0.18
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/.env +0 -0
- package/package.json +1 -1
- package/publish.sh +23 -1
- package/tiledesk/TiledeskWhatsappTranslator.js +2 -2
package/.env
ADDED
|
File without changes
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Load .env variables
|
|
2
|
+
if [ -f .env ]; then
|
|
3
|
+
export $(grep -v '^#' .env | xargs)
|
|
4
|
+
fi
|
|
5
|
+
|
|
6
|
+
# Check if the token is set
|
|
7
|
+
if [ -z "$NPM_PUBLISH_TOKEN" ]; then
|
|
8
|
+
echo "⚠️ Missing NPM_PUBLISH_TOKEN in environment."
|
|
9
|
+
echo "You can speed up the process by setting the environment variable with your publish token."
|
|
10
|
+
read -p "Do you want to continue with manual login? (y/n): " choice
|
|
11
|
+
if [[ "$choice" != "y" && "$choice" != "Y" ]]; then
|
|
12
|
+
echo "❌ Deploy aborted."
|
|
13
|
+
exit 1
|
|
14
|
+
else
|
|
15
|
+
echo "💡 Proceed with 'npm login' manually..."
|
|
16
|
+
npm login
|
|
17
|
+
fi
|
|
18
|
+
else
|
|
19
|
+
# Create temporary .npmrc with the token
|
|
20
|
+
echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}" > ~/.npmrc
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
npm version patch
|
|
2
24
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
25
|
echo "version $version"
|
|
4
26
|
|
|
@@ -603,7 +603,7 @@ const path = require('path');
|
|
|
603
603
|
}*/
|
|
604
604
|
|
|
605
605
|
var tiledeskMessage = {
|
|
606
|
-
text:
|
|
606
|
+
text: text,
|
|
607
607
|
senderFullname: from,
|
|
608
608
|
channel: { name: TiledeskWhatsappTranslator.CHANNEL_NAME },
|
|
609
609
|
type: "file",
|
|
@@ -727,7 +727,7 @@ const path = require('path');
|
|
|
727
727
|
if (!value || key === 'phone_number') continue;
|
|
728
728
|
|
|
729
729
|
if (key.startsWith('header')) {
|
|
730
|
-
const type = detectMediaType(value);
|
|
730
|
+
const type = this.detectMediaType(value);
|
|
731
731
|
|
|
732
732
|
if (type === "text") {
|
|
733
733
|
header_params.push({
|