n8n-nodes-whatsapp-retentionstack 0.1.1 → 0.1.2
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/dist/credentials/WhatsAppRetentionStackApi.credentials.d.ts +2 -1
- package/dist/credentials/WhatsAppRetentionStackApi.credentials.js +1 -0
- package/dist/credentials/whatsapp.dark.svg +1 -0
- package/dist/credentials/whatsapp.svg +1 -0
- package/dist/nodes/WhatsAppRetentionStack/WhatsAppRetentionStack.node.js +4 -4
- package/dist/nodes/WhatsAppRetentionStack/WhatsAppRetentionStackTrigger.node.js +10 -5
- package/dist/nodes/WhatsAppRetentionStack/whatsapp.dark.svg +1 -0
- package/dist/nodes/WhatsAppRetentionStack/whatsapp.svg +1 -1
- package/package.json +10 -5
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import type { Icon, IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare const BASE_URL = "https://whatsapp-messaging-bot.p.rapidapi.com";
|
|
3
3
|
export declare const RAPIDAPI_HOST = "whatsapp-messaging-bot.p.rapidapi.com";
|
|
4
4
|
export declare class WhatsAppRetentionStackApi implements ICredentialType {
|
|
5
5
|
name: string;
|
|
6
6
|
displayName: string;
|
|
7
|
+
icon: Icon;
|
|
7
8
|
documentationUrl: string;
|
|
8
9
|
properties: INodeProperties[];
|
|
9
10
|
authenticate: IAuthenticateGeneric;
|
|
@@ -7,6 +7,7 @@ class WhatsAppRetentionStackApi {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = 'whatsAppRetentionStackApi';
|
|
9
9
|
this.displayName = 'WhatsApp by Retention Stack API';
|
|
10
|
+
this.icon = { light: 'file:whatsapp.svg', dark: 'file:whatsapp.dark.svg' };
|
|
10
11
|
this.documentationUrl = 'https://whatsapp-messaging.retentionstack.agency/docs';
|
|
11
12
|
this.properties = [
|
|
12
13
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><circle cx="32" cy="32" r="32" fill="#25D366"/><path fill="#0b141a" d="M35.5 12 20 36h10l-3.5 16L44 28H34z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><circle cx="32" cy="32" r="32" fill="#128C7E"/><path fill="#fff" d="M35.5 12 20 36h10l-3.5 16L44 28H34z"/></svg>
|
|
@@ -13,7 +13,7 @@ const op = (name, value, method, url) => {
|
|
|
13
13
|
const route = `${method} ${url.replace(/\{\{\$parameter\.(\w+)\}\}/g, '{$1}')}`;
|
|
14
14
|
const action = endpoints_1.ENDPOINTS[route];
|
|
15
15
|
if (!action)
|
|
16
|
-
throw new
|
|
16
|
+
throw new n8n_workflow_1.UserError(`No summary in openapi.json for ${route}; run npm run gen`);
|
|
17
17
|
return { name, value, action, description: route, routing: { request: { method, url: url.includes('{{') ? `=${url}` : url } } };
|
|
18
18
|
};
|
|
19
19
|
const show = (resource, operation) => ({
|
|
@@ -133,7 +133,7 @@ const message = [
|
|
|
133
133
|
str('Options', 'pollOptions', 'message', ['sendPoll'], { required: true, placeholder: 'Yes, No, Maybe', description: 'Comma-separated poll options (2 to 12)', ...csv('poll.options') }),
|
|
134
134
|
{ displayName: 'Allow Multiple Answers', name: 'multipleAnswers', type: 'boolean', default: false, ...show('message', ['sendPoll']), ...body('poll.multipleAnswers') },
|
|
135
135
|
// get many
|
|
136
|
-
{ displayName: 'Limit', name: 'limit', type: 'number', default:
|
|
136
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', default: 50, typeOptions: { minValue: 1 }, description: 'Max number of results to return', ...show('message', ['getMany']), ...query('limit') },
|
|
137
137
|
{ displayName: 'Download Media', name: 'downloadMedia', type: 'boolean', default: false, ...show('message', ['getMany']), ...query('downloadMedia') },
|
|
138
138
|
// additional fields, scoped so nothing unsupported is sent
|
|
139
139
|
extra('message', ['sendText'], [
|
|
@@ -259,7 +259,7 @@ const group = [
|
|
|
259
259
|
default: {},
|
|
260
260
|
...show('group', ['getMany']),
|
|
261
261
|
options: [
|
|
262
|
-
{ displayName: 'Limit', name: 'limit', type: 'number', default:
|
|
262
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', default: 50, typeOptions: { minValue: 1 }, description: 'Max number of results to return', ...query('limit') },
|
|
263
263
|
{ displayName: 'Offset', name: 'offset', type: 'number', default: 0, ...query('offset') },
|
|
264
264
|
{ displayName: 'Sort By', name: 'sortBy', type: 'options', options: [{ name: 'ID', value: 'id' }, { name: 'Subject', value: 'subject' }], default: 'subject', ...query('sortBy') },
|
|
265
265
|
{ displayName: 'Sort Order', name: 'sortOrder', type: 'options', options: [{ name: 'Ascending', value: 'asc' }, { name: 'Descending', value: 'desc' }], default: 'asc', ...query('sortOrder') },
|
|
@@ -295,7 +295,7 @@ class WhatsAppRetentionStack {
|
|
|
295
295
|
this.description = {
|
|
296
296
|
displayName: 'WhatsApp by Retention Stack',
|
|
297
297
|
name: 'whatsAppRetentionStack',
|
|
298
|
-
icon: 'file:whatsapp.svg',
|
|
298
|
+
icon: { light: 'file:whatsapp.svg', dark: 'file:whatsapp.dark.svg' },
|
|
299
299
|
group: ['output'],
|
|
300
300
|
version: 1,
|
|
301
301
|
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
|
@@ -12,14 +12,14 @@ const EVENTS = [
|
|
|
12
12
|
{ name: 'Message Revoked', value: 'message.revoked' },
|
|
13
13
|
{ name: 'Group Join', value: 'group.join' },
|
|
14
14
|
{ name: 'Group Leave', value: 'group.leave' },
|
|
15
|
-
{ name: 'Session Status', value: 'session.status', description: 'Session connected, disconnected,
|
|
15
|
+
{ name: 'Session Status', value: 'session.status', description: 'Session connected, disconnected, or other state changes' },
|
|
16
16
|
];
|
|
17
17
|
class WhatsAppRetentionStackTrigger {
|
|
18
18
|
constructor() {
|
|
19
19
|
this.description = {
|
|
20
20
|
displayName: 'WhatsApp by Retention Stack Trigger',
|
|
21
21
|
name: 'whatsAppRetentionStackTrigger',
|
|
22
|
-
icon: 'file:whatsapp.svg',
|
|
22
|
+
icon: { light: 'file:whatsapp.svg', dark: 'file:whatsapp.dark.svg' },
|
|
23
23
|
group: ['trigger'],
|
|
24
24
|
version: 1,
|
|
25
25
|
subtitle: '={{ $parameter["events"].join(", ") }}',
|
|
@@ -61,7 +61,10 @@ class WhatsAppRetentionStackTrigger {
|
|
|
61
61
|
});
|
|
62
62
|
return JSON.stringify(res).includes(url);
|
|
63
63
|
}
|
|
64
|
-
catch {
|
|
64
|
+
catch (error) {
|
|
65
|
+
// Not proof the webhook is absent — the lookup itself failed. Log it so a
|
|
66
|
+
// bad session or key is visible, and report "not registered" so create() runs.
|
|
67
|
+
this.logger.warn(`WhatsApp trigger: could not check webhooks for session "${session}": ${error instanceof Error ? error.message : String(error)}`);
|
|
65
68
|
return false;
|
|
66
69
|
}
|
|
67
70
|
},
|
|
@@ -88,8 +91,10 @@ class WhatsAppRetentionStackTrigger {
|
|
|
88
91
|
json: true,
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
|
-
catch {
|
|
92
|
-
// webhook already gone
|
|
94
|
+
catch (error) {
|
|
95
|
+
// Deactivation should still succeed if the webhook is already gone, but a
|
|
96
|
+
// real failure would otherwise leave it registered silently.
|
|
97
|
+
this.logger.warn(`WhatsApp trigger: could not remove webhook for session "${session}": ${error instanceof Error ? error.message : String(error)}`);
|
|
93
98
|
}
|
|
94
99
|
return true;
|
|
95
100
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><circle cx="32" cy="32" r="32" fill="#25D366"/><path fill="#0b141a" d="M35.5 12 20 36h10l-3.5 16L44 28H34z"/></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><circle cx="32" cy="32" r="32" fill="#
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><circle cx="32" cy="32" r="32" fill="#128C7E"/><path fill="#fff" d="M35.5 12 20 36h10l-3.5 16L44 28H34z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-whatsapp-retentionstack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "n8n nodes for the WhatsApp Messaging API by Retention Stack. Send WhatsApp text, images, files and OTPs, and trigger workflows on incoming messages. No Meta approval needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "rm -rf dist && tsc && cp nodes/WhatsAppRetentionStack/*.svg dist/nodes/WhatsAppRetentionStack/",
|
|
29
|
+
"build": "rm -rf dist && tsc && cp nodes/WhatsAppRetentionStack/*.svg dist/nodes/WhatsAppRetentionStack/ && cp credentials/*.svg dist/credentials/",
|
|
30
30
|
"dev": "tsc --watch",
|
|
31
|
-
"test": "npm run build && node test/smoke.mjs",
|
|
31
|
+
"test": "npm run build && npm run lint && node test/smoke.mjs",
|
|
32
32
|
"prepublishOnly": "npm test",
|
|
33
|
-
"gen": "node scripts/gen.mjs"
|
|
33
|
+
"gen": "node scripts/gen.mjs",
|
|
34
|
+
"lint": "eslint credentials nodes package.json"
|
|
34
35
|
},
|
|
35
36
|
"n8n": {
|
|
36
37
|
"n8nNodesApiVersion": 1,
|
|
@@ -46,8 +47,12 @@
|
|
|
46
47
|
"n8n-workflow": "*"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
50
|
+
"@n8n/eslint-plugin-community-nodes": "^0.31.0",
|
|
49
51
|
"@types/node": "^22.0.0",
|
|
52
|
+
"eslint": "9.29.0",
|
|
53
|
+
"eslint-plugin-n8n-nodes-base": "^2.0.0",
|
|
50
54
|
"n8n-workflow": "^2.16.0",
|
|
51
|
-
"typescript": "^5.5.4"
|
|
55
|
+
"typescript": "^5.5.4",
|
|
56
|
+
"typescript-eslint": "^8.69.0"
|
|
52
57
|
}
|
|
53
58
|
}
|