@tiledesk/tiledesk-whatsapp-connector 1.0.17 → 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 ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-whatsapp-connector",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Tiledesk Whatsapp connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/publish.sh CHANGED
@@ -1,4 +1,26 @@
1
- #npm version patch
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
 
@@ -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({