n8n-nodes-syncmate 1.1.0 → 1.1.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/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Send WhatsApp messages or media using **SyncMate Assistro API** in n8n workflows
|
|
|
11
11
|
|
|
12
12
|
- Send text messages via WhatsApp
|
|
13
13
|
- Send images, videos, documents, and other media
|
|
14
|
-
-
|
|
14
|
+
- API Token authentication with Assistro API
|
|
15
15
|
- Designed for **n8n workflows**
|
|
16
16
|
- Easy to integrate into existing automation
|
|
17
17
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import { ICredentialType, INodeProperties, IAuthenticateGeneric } from 'n8n-workflow';
|
|
2
2
|
export declare class AssistroTokenApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
5
|
documentationUrl: string;
|
|
6
6
|
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
7
8
|
}
|
|
@@ -16,6 +16,14 @@ class AssistroTokenApi {
|
|
|
16
16
|
description: 'The JWT Access Token provided by Assistro',
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
|
+
this.authenticate = {
|
|
20
|
+
type: 'generic',
|
|
21
|
+
properties: {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: '={{"Bearer " + $credentials.accessToken}}',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
exports.AssistroTokenApi = AssistroTokenApi;
|
package/dist/index.js
ADDED
|
@@ -208,7 +208,7 @@ class WhatsAuto {
|
|
|
208
208
|
const phoneNumber = this.getNodeParameter('phoneNumber', i);
|
|
209
209
|
const message = this.getNodeParameter('message', i);
|
|
210
210
|
const mediaFiles = this.getNodeParameter('mediaFiles', i);
|
|
211
|
-
const cleanNumber = phoneNumber.trim().replace(/\s+/g, '');
|
|
211
|
+
const cleanNumber = String(phoneNumber).trim().replace(/\s+/g, '');
|
|
212
212
|
const msgObj = {
|
|
213
213
|
number: cleanNumber,
|
|
214
214
|
message: message,
|
|
@@ -226,7 +226,7 @@ class WhatsAuto {
|
|
|
226
226
|
const groupId = this.getNodeParameter('groupId', i);
|
|
227
227
|
const message = this.getNodeParameter('message', i);
|
|
228
228
|
const mediaFiles = this.getNodeParameter('mediaFiles', i);
|
|
229
|
-
let cleanGroupId = groupId.trim();
|
|
229
|
+
let cleanGroupId = String(groupId).trim();
|
|
230
230
|
if (!cleanGroupId.endsWith('@g.us')) {
|
|
231
231
|
cleanGroupId = cleanGroupId.replace('@g.us', '') + '@g.us';
|
|
232
232
|
}
|
|
@@ -246,7 +246,7 @@ class WhatsAuto {
|
|
|
246
246
|
else if (operation === 'newsletter') {
|
|
247
247
|
const newsletterId = this.getNodeParameter('newsletterId', i);
|
|
248
248
|
const message = this.getNodeParameter('newsletterMessage', i);
|
|
249
|
-
let cleanNewsletterId = newsletterId.trim();
|
|
249
|
+
let cleanNewsletterId = String(newsletterId).trim();
|
|
250
250
|
if (!cleanNewsletterId.endsWith('@newsletter')) {
|
|
251
251
|
cleanNewsletterId = cleanNewsletterId.replace('@newsletter', '') + '@newsletter';
|
|
252
252
|
}
|