n8n-nodes-netsendo 1.0.1 → 1.2.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 +181 -39
- package/dist/nodes/NetSendo/NetSendo.node.d.ts +2 -1
- package/dist/nodes/NetSendo/NetSendo.node.js +271 -0
- package/dist/nodes/NetSendo/NetSendo.node.js.map +1 -1
- package/dist/nodes/NetSendo/NetSendoTrigger.node.d.ts +12 -0
- package/dist/nodes/NetSendo/NetSendoTrigger.node.js +136 -0
- package/dist/nodes/NetSendo/NetSendoTrigger.node.js.map +1 -0
- package/dist/nodes/NetSendo/NetSendoTrigger.node.json +14 -0
- package/dist/nodes/NetSendo/resources/list/index.js +31 -13
- package/dist/nodes/NetSendo/resources/list/index.js.map +1 -1
- package/dist/nodes/NetSendo/resources/sms/index.d.ts +2 -0
- package/dist/nodes/NetSendo/resources/sms/index.js +343 -0
- package/dist/nodes/NetSendo/resources/sms/index.js.map +1 -0
- package/dist/nodes/NetSendo/resources/subscriber/index.js +31 -13
- package/dist/nodes/NetSendo/resources/subscriber/index.js.map +1 -1
- package/dist/package.json +8 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -2,82 +2,217 @@
|
|
|
2
2
|
|
|
3
3
|
# n8n-nodes-netsendo
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/n8n-nodes-netsendo)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://n8n.io)
|
|
6
8
|
|
|
7
|
-
This
|
|
9
|
+
This is an n8n community node for **[NetSendo](https://netsendo.com)** – a powerful, self-hosted email & SMS marketing automation platform.
|
|
10
|
+
|
|
11
|
+
Automate your marketing workflows directly within [n8n](https://n8n.io), connecting NetSendo with thousands of other apps and services.
|
|
8
12
|
|
|
9
13
|
---
|
|
10
14
|
|
|
11
15
|
## 🚀 Features
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
| Feature | Description |
|
|
18
|
+
| ------------------------ | ----------------------------------------------- |
|
|
19
|
+
| 📧 **Email Marketing** | Manage subscribers, lists, and tags |
|
|
20
|
+
| 📱 **SMS Marketing** | Send single & batch SMS messages |
|
|
21
|
+
| 🔄 **Webhook Triggers** | React to subscriber and SMS events in real-time |
|
|
22
|
+
| 📋 **Dynamic Dropdowns** | Automatically loads your contact lists |
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
- **Manage Lists**: Retrieve contact lists and their subscribers.
|
|
17
|
-
- **Manage Tags**: Access and organize your tags.
|
|
18
|
-
- **Dynamic Dropdowns**: Automatically loads your contact lists for easy selection.
|
|
24
|
+
---
|
|
19
25
|
|
|
20
26
|
## 📦 Installation
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
### Via n8n UI (Recommended)
|
|
23
29
|
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
30
|
+
1. Go to **Settings > Community Nodes**
|
|
31
|
+
2. Click **Install**
|
|
32
|
+
3. Enter `n8n-nodes-netsendo`
|
|
33
|
+
4. Click **Install**
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
### Via npm
|
|
30
36
|
|
|
31
37
|
```bash
|
|
32
38
|
npm install n8n-nodes-netsendo
|
|
33
39
|
```
|
|
34
40
|
|
|
41
|
+
### Via Docker
|
|
42
|
+
|
|
43
|
+
Add to your `docker-compose.yml`:
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
environment:
|
|
47
|
+
- N8N_COMMUNITY_PACKAGES=n8n-nodes-netsendo
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 🔧 Development Setup
|
|
53
|
+
|
|
54
|
+
To test the node locally before publishing:
|
|
55
|
+
|
|
56
|
+
### 1. Clone and install dependencies
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/NetSendo/n8n-nodes-netsendo.git
|
|
60
|
+
cd n8n-nodes-netsendo
|
|
61
|
+
npm install
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. Build the project
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run build
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 3. Link to your local n8n
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# In the node project directory
|
|
74
|
+
npm link
|
|
75
|
+
|
|
76
|
+
# In your n8n installation directory (find with: which n8n)
|
|
77
|
+
cd ~/.n8n
|
|
78
|
+
npm link n8n-nodes-netsendo
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 4. Start n8n
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
n8n start
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 5. Alternative: Use n8n-node dev command
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This will watch for changes and automatically rebuild.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
35
97
|
## 🔐 Credentials Setup
|
|
36
98
|
|
|
37
|
-
|
|
99
|
+
1. In n8n, go to **Credentials > Create New**
|
|
100
|
+
2. Search for **NetSendo API**
|
|
101
|
+
3. Enter:
|
|
102
|
+
- **Base URL**: Your NetSendo installation URL (e.g., `https://your-domain.com`)
|
|
103
|
+
- **API Key**: Your API token from **Settings > API Keys** (format: `ns_live_...`)
|
|
38
104
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
105
|
+
> **Required permissions:**
|
|
106
|
+
>
|
|
107
|
+
> - For subscribers/lists: `subscribers:read`, `subscribers:write`, `lists:read`
|
|
108
|
+
> - For SMS: `sms:read`, `sms:write`
|
|
109
|
+
> - For triggers: `webhooks:read`, `webhooks:write`
|
|
110
|
+
|
|
111
|
+
---
|
|
44
112
|
|
|
45
113
|
## 🛠️ Operations
|
|
46
114
|
|
|
115
|
+
### ⚡ NetSendo Trigger
|
|
116
|
+
|
|
117
|
+
Start workflows automatically when events occur.
|
|
118
|
+
|
|
119
|
+
**Subscriber Events:**
|
|
120
|
+
|
|
121
|
+
- `subscriber.created` / `subscriber.updated` / `subscriber.deleted`
|
|
122
|
+
- `subscriber.subscribed` / `subscriber.unsubscribed` / `subscriber.bounced`
|
|
123
|
+
- `subscriber.tag_added` / `subscriber.tag_removed`
|
|
124
|
+
|
|
125
|
+
**SMS Events:**
|
|
126
|
+
|
|
127
|
+
- `sms.queued` – SMS message queued for sending
|
|
128
|
+
- `sms.sent` – SMS successfully delivered
|
|
129
|
+
- `sms.failed` – SMS delivery failed
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
47
133
|
### 📂 Resource: List
|
|
48
134
|
|
|
49
|
-
|
|
135
|
+
| Operation | Description |
|
|
136
|
+
| ------------------- | --------------------------------- |
|
|
137
|
+
| **Get Many** | Retrieve all contact lists |
|
|
138
|
+
| **Get** | Get a specific list by ID |
|
|
139
|
+
| **Get Subscribers** | Fetch all subscribers from a list |
|
|
50
140
|
|
|
51
|
-
|
|
52
|
-
- **Get**: Get details of a specific list by ID.
|
|
53
|
-
- **Get Subscribers**: Fetch all subscribers belonging to a specific list.
|
|
141
|
+
---
|
|
54
142
|
|
|
55
143
|
### 👤 Resource: Subscriber
|
|
56
144
|
|
|
57
|
-
|
|
145
|
+
| Operation | Description |
|
|
146
|
+
| ---------------- | -------------------------------------------------- |
|
|
147
|
+
| **Get Many** | List subscribers with filters (status, pagination) |
|
|
148
|
+
| **Get** | Get subscriber by ID |
|
|
149
|
+
| **Get by Email** | Find subscriber by email address |
|
|
150
|
+
| **Create** | Add new subscriber |
|
|
151
|
+
| **Update** | Update subscriber data |
|
|
152
|
+
| **Delete** | Remove subscriber (soft delete) |
|
|
58
153
|
|
|
59
|
-
|
|
60
|
-
- _Filters available_: Contact List, Status (Active, Inactive, etc.), Pagination, Sorting.
|
|
61
|
-
- **Get**: Get details of a single subscriber by ID.
|
|
62
|
-
- **Get by Email**: Find a subscriber using their email address.
|
|
63
|
-
- **Create**: Add a new subscriber.
|
|
64
|
-
- _Required_: Email, Contact List.
|
|
65
|
-
- _Optional_: First Name, Last Name, Phone, Status, Source, Tags.
|
|
66
|
-
- **Update**: Update an existing subscriber's data.
|
|
67
|
-
- **Delete**: Remove a subscriber (soft delete).
|
|
154
|
+
---
|
|
68
155
|
|
|
69
156
|
### 🏷️ Resource: Tag
|
|
70
157
|
|
|
71
|
-
|
|
158
|
+
| Operation | Description |
|
|
159
|
+
| ------------ | --------------------------- |
|
|
160
|
+
| **Get Many** | Retrieve all available tags |
|
|
161
|
+
| **Get** | Get tag details by ID |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### 📱 Resource: SMS
|
|
166
|
+
|
|
167
|
+
| Operation | Description |
|
|
168
|
+
| ------------------ | --------------------------------------- |
|
|
169
|
+
| **Send** | Send a single SMS message |
|
|
170
|
+
| **Send Batch** | Send SMS to a contact list or tag group |
|
|
171
|
+
| **Get Status** | Check delivery status of an SMS |
|
|
172
|
+
| **List Providers** | Get available SMS providers |
|
|
173
|
+
|
|
174
|
+
**Send SMS Example:**
|
|
72
175
|
|
|
73
|
-
|
|
74
|
-
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"phone_number": "+48123456789",
|
|
179
|
+
"message": "Hello from NetSendo!"
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Send Batch SMS Example:**
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"contact_list_id": 1,
|
|
188
|
+
"message": "Batch message to all subscribers"
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
75
193
|
|
|
76
194
|
## 📚 Resources
|
|
77
195
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
196
|
+
| Resource | Link |
|
|
197
|
+
| -------------------- | -------------------------------------------------- |
|
|
198
|
+
| 🌐 NetSendo Website | [netsendo.com](https://netsendo.com) |
|
|
199
|
+
| 📖 NetSendo Docs | [docs.netsendo.com](https://docs.netsendo.com) |
|
|
200
|
+
| 💻 GitHub Repository | [github.com/NetSendo](https://github.com/NetSendo) |
|
|
201
|
+
| 🔗 n8n Website | [n8n.io](https://n8n.io) |
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 🤝 Contributing
|
|
206
|
+
|
|
207
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
208
|
+
|
|
209
|
+
1. Fork the repository
|
|
210
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
211
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
212
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
213
|
+
5. Open a Pull Request
|
|
214
|
+
|
|
215
|
+
---
|
|
81
216
|
|
|
82
217
|
## 📄 License
|
|
83
218
|
|
|
@@ -85,4 +220,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) f
|
|
|
85
220
|
|
|
86
221
|
---
|
|
87
222
|
|
|
223
|
+
## 💬 Support
|
|
224
|
+
|
|
225
|
+
- 📧 Email: [contact@netsendo.com](mailto:contact@netsendo.com)
|
|
226
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/NetSendo/n8n-nodes-netsendo/issues)
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
88
230
|
_Built with ❤️ for the NetSendo Community._
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
1
|
+
import { type IExecuteFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
import { getLists } from './listSearch/getLists';
|
|
3
3
|
export declare class NetSendo implements INodeType {
|
|
4
4
|
description: INodeTypeDescription;
|
|
@@ -7,4 +7,5 @@ export declare class NetSendo implements INodeType {
|
|
|
7
7
|
getLists: typeof getLists;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
10
11
|
}
|
|
@@ -3,9 +3,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NetSendo = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const list_1 = require("./resources/list");
|
|
6
|
+
const sms_1 = require("./resources/sms");
|
|
6
7
|
const subscriber_1 = require("./resources/subscriber");
|
|
7
8
|
const tag_1 = require("./resources/tag");
|
|
8
9
|
const getLists_1 = require("./listSearch/getLists");
|
|
10
|
+
async function fetchAllPages(context, baseUrl, endpoint, qs, returnAll, limit) {
|
|
11
|
+
const allResults = [];
|
|
12
|
+
let page = 1;
|
|
13
|
+
let lastPage = 1;
|
|
14
|
+
do {
|
|
15
|
+
qs.page = page;
|
|
16
|
+
const response = await context.helpers.httpRequestWithAuthentication.call(context, 'netSendoApi', {
|
|
17
|
+
method: 'GET',
|
|
18
|
+
url: `${baseUrl}${endpoint}`,
|
|
19
|
+
qs,
|
|
20
|
+
});
|
|
21
|
+
const data = response.data;
|
|
22
|
+
if (data && data.length > 0) {
|
|
23
|
+
allResults.push(...data);
|
|
24
|
+
}
|
|
25
|
+
if (response.meta && response.meta.last_page) {
|
|
26
|
+
lastPage = response.meta.last_page;
|
|
27
|
+
}
|
|
28
|
+
if (!returnAll && allResults.length >= limit) {
|
|
29
|
+
allResults.splice(limit);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
page++;
|
|
33
|
+
} while (page <= lastPage);
|
|
34
|
+
return allResults;
|
|
35
|
+
}
|
|
9
36
|
class NetSendo {
|
|
10
37
|
constructor() {
|
|
11
38
|
this.description = {
|
|
@@ -47,6 +74,11 @@ class NetSendo {
|
|
|
47
74
|
value: 'list',
|
|
48
75
|
description: 'Manage contact lists',
|
|
49
76
|
},
|
|
77
|
+
{
|
|
78
|
+
name: 'SMS',
|
|
79
|
+
value: 'sms',
|
|
80
|
+
description: 'Send and manage SMS messages',
|
|
81
|
+
},
|
|
50
82
|
{
|
|
51
83
|
name: 'Subscriber',
|
|
52
84
|
value: 'subscriber',
|
|
@@ -61,6 +93,7 @@ class NetSendo {
|
|
|
61
93
|
default: 'subscriber',
|
|
62
94
|
},
|
|
63
95
|
...list_1.listDescription,
|
|
96
|
+
...sms_1.smsDescription,
|
|
64
97
|
...subscriber_1.subscriberDescription,
|
|
65
98
|
...tag_1.tagDescription,
|
|
66
99
|
],
|
|
@@ -71,6 +104,244 @@ class NetSendo {
|
|
|
71
104
|
},
|
|
72
105
|
};
|
|
73
106
|
}
|
|
107
|
+
async execute() {
|
|
108
|
+
const items = this.getInputData();
|
|
109
|
+
const returnData = [];
|
|
110
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
111
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
112
|
+
const credentials = await this.getCredentials('netSendoApi');
|
|
113
|
+
const baseUrl = `${credentials.baseUrl.replace(/\/$/, '')}/api/v1`;
|
|
114
|
+
for (let i = 0; i < items.length; i++) {
|
|
115
|
+
try {
|
|
116
|
+
if (resource === 'subscriber') {
|
|
117
|
+
if (operation === 'getMany') {
|
|
118
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
119
|
+
const limit = returnAll ? 0 : this.getNodeParameter('limit', i, 50);
|
|
120
|
+
const contactListId = this.getNodeParameter('contactListId', i);
|
|
121
|
+
const options = this.getNodeParameter('options', i, {});
|
|
122
|
+
const qs = {
|
|
123
|
+
per_page: 100,
|
|
124
|
+
contact_list_id: contactListId,
|
|
125
|
+
};
|
|
126
|
+
if (options.status)
|
|
127
|
+
qs.status = options.status;
|
|
128
|
+
if (options.sort_by)
|
|
129
|
+
qs.sort_by = options.sort_by;
|
|
130
|
+
if (options.sort_order)
|
|
131
|
+
qs.sort_order = options.sort_order;
|
|
132
|
+
const results = await fetchAllPages(this, baseUrl, '/subscribers', qs, returnAll, limit);
|
|
133
|
+
for (const item of results) {
|
|
134
|
+
returnData.push({ json: item });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else if (operation === 'get') {
|
|
138
|
+
const subscriberId = this.getNodeParameter('subscriberId', i);
|
|
139
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
140
|
+
method: 'GET',
|
|
141
|
+
url: `${baseUrl}/subscribers/${subscriberId}`,
|
|
142
|
+
});
|
|
143
|
+
returnData.push({ json: response.data || response });
|
|
144
|
+
}
|
|
145
|
+
else if (operation === 'getByEmail') {
|
|
146
|
+
const email = this.getNodeParameter('email', i);
|
|
147
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
148
|
+
method: 'GET',
|
|
149
|
+
url: `${baseUrl}/subscribers/by-email/${encodeURIComponent(email)}`,
|
|
150
|
+
});
|
|
151
|
+
returnData.push({ json: response.data || response });
|
|
152
|
+
}
|
|
153
|
+
else if (operation === 'create') {
|
|
154
|
+
const email = this.getNodeParameter('email', i);
|
|
155
|
+
const contactListId = this.getNodeParameter('contactListId', i);
|
|
156
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
157
|
+
const body = {
|
|
158
|
+
email,
|
|
159
|
+
contact_list_id: contactListId,
|
|
160
|
+
...additionalFields,
|
|
161
|
+
};
|
|
162
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
163
|
+
method: 'POST',
|
|
164
|
+
url: `${baseUrl}/subscribers`,
|
|
165
|
+
body,
|
|
166
|
+
});
|
|
167
|
+
returnData.push({ json: response.data || response });
|
|
168
|
+
}
|
|
169
|
+
else if (operation === 'update') {
|
|
170
|
+
const subscriberId = this.getNodeParameter('subscriberId', i);
|
|
171
|
+
const updateFields = this.getNodeParameter('updateFields', i, {});
|
|
172
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
173
|
+
method: 'PUT',
|
|
174
|
+
url: `${baseUrl}/subscribers/${subscriberId}`,
|
|
175
|
+
body: updateFields,
|
|
176
|
+
});
|
|
177
|
+
returnData.push({ json: response.data || response });
|
|
178
|
+
}
|
|
179
|
+
else if (operation === 'delete') {
|
|
180
|
+
const subscriberId = this.getNodeParameter('subscriberId', i);
|
|
181
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
182
|
+
method: 'DELETE',
|
|
183
|
+
url: `${baseUrl}/subscribers/${subscriberId}`,
|
|
184
|
+
});
|
|
185
|
+
returnData.push({ json: response.data || response || { success: true } });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (resource === 'list') {
|
|
189
|
+
if (operation === 'getMany') {
|
|
190
|
+
const options = this.getNodeParameter('options', i, {});
|
|
191
|
+
const qs = {};
|
|
192
|
+
if (options.per_page)
|
|
193
|
+
qs.per_page = options.per_page;
|
|
194
|
+
if (options.sort_by)
|
|
195
|
+
qs.sort_by = options.sort_by;
|
|
196
|
+
if (options.sort_order)
|
|
197
|
+
qs.sort_order = options.sort_order;
|
|
198
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
199
|
+
method: 'GET',
|
|
200
|
+
url: `${baseUrl}/lists`,
|
|
201
|
+
qs,
|
|
202
|
+
});
|
|
203
|
+
const data = response.data || response;
|
|
204
|
+
if (Array.isArray(data)) {
|
|
205
|
+
for (const item of data) {
|
|
206
|
+
returnData.push({ json: item });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
returnData.push({ json: data });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else if (operation === 'get') {
|
|
214
|
+
const listId = this.getNodeParameter('listId', i);
|
|
215
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
216
|
+
method: 'GET',
|
|
217
|
+
url: `${baseUrl}/lists/${listId}`,
|
|
218
|
+
});
|
|
219
|
+
returnData.push({ json: response.data || response });
|
|
220
|
+
}
|
|
221
|
+
else if (operation === 'getSubscribers') {
|
|
222
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
223
|
+
const limit = returnAll ? 0 : this.getNodeParameter('limit', i, 50);
|
|
224
|
+
const listId = this.getNodeParameter('listId', i);
|
|
225
|
+
const options = this.getNodeParameter('options', i, {});
|
|
226
|
+
const qs = {
|
|
227
|
+
per_page: 100,
|
|
228
|
+
};
|
|
229
|
+
if (options.status)
|
|
230
|
+
qs.status = options.status;
|
|
231
|
+
if (options.sort_by)
|
|
232
|
+
qs.sort_by = options.sort_by;
|
|
233
|
+
if (options.sort_order)
|
|
234
|
+
qs.sort_order = options.sort_order;
|
|
235
|
+
const results = await fetchAllPages(this, baseUrl, `/lists/${listId}/subscribers`, qs, returnAll, limit);
|
|
236
|
+
for (const item of results) {
|
|
237
|
+
returnData.push({ json: item });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (resource === 'sms') {
|
|
242
|
+
if (operation === 'send') {
|
|
243
|
+
const phoneNumber = this.getNodeParameter('phoneNumber', i);
|
|
244
|
+
const message = this.getNodeParameter('message', i);
|
|
245
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
246
|
+
const body = {
|
|
247
|
+
phone_number: phoneNumber,
|
|
248
|
+
message,
|
|
249
|
+
...additionalFields,
|
|
250
|
+
};
|
|
251
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
252
|
+
method: 'POST',
|
|
253
|
+
url: `${baseUrl}/sms/send`,
|
|
254
|
+
body,
|
|
255
|
+
});
|
|
256
|
+
returnData.push({ json: response.data || response });
|
|
257
|
+
}
|
|
258
|
+
else if (operation === 'sendBatch') {
|
|
259
|
+
const message = this.getNodeParameter('message', i);
|
|
260
|
+
const targetType = this.getNodeParameter('targetType', i);
|
|
261
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
262
|
+
const body = {
|
|
263
|
+
message,
|
|
264
|
+
...additionalFields,
|
|
265
|
+
};
|
|
266
|
+
if (targetType === 'list') {
|
|
267
|
+
body.contact_list_id = this.getNodeParameter('contactListId', i);
|
|
268
|
+
}
|
|
269
|
+
else if (targetType === 'tags') {
|
|
270
|
+
const tagsString = this.getNodeParameter('tags', i);
|
|
271
|
+
body.tags = tagsString.split(',').map((tag) => tag.trim());
|
|
272
|
+
}
|
|
273
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
274
|
+
method: 'POST',
|
|
275
|
+
url: `${baseUrl}/sms/batch`,
|
|
276
|
+
body,
|
|
277
|
+
});
|
|
278
|
+
returnData.push({ json: response.data || response });
|
|
279
|
+
}
|
|
280
|
+
else if (operation === 'getStatus') {
|
|
281
|
+
const smsId = this.getNodeParameter('smsId', i);
|
|
282
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
283
|
+
method: 'GET',
|
|
284
|
+
url: `${baseUrl}/sms/status/${smsId}`,
|
|
285
|
+
});
|
|
286
|
+
returnData.push({ json: response.data || response });
|
|
287
|
+
}
|
|
288
|
+
else if (operation === 'listProviders') {
|
|
289
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
290
|
+
method: 'GET',
|
|
291
|
+
url: `${baseUrl}/sms/providers`,
|
|
292
|
+
});
|
|
293
|
+
const data = response.data || response;
|
|
294
|
+
if (Array.isArray(data)) {
|
|
295
|
+
for (const item of data) {
|
|
296
|
+
returnData.push({ json: item });
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
returnData.push({ json: data });
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (resource === 'tag') {
|
|
305
|
+
if (operation === 'getMany') {
|
|
306
|
+
const options = this.getNodeParameter('options', i, {});
|
|
307
|
+
const qs = {};
|
|
308
|
+
if (options.per_page)
|
|
309
|
+
qs.per_page = options.per_page;
|
|
310
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
311
|
+
method: 'GET',
|
|
312
|
+
url: `${baseUrl}/tags`,
|
|
313
|
+
qs,
|
|
314
|
+
});
|
|
315
|
+
const data = response.data || response;
|
|
316
|
+
if (Array.isArray(data)) {
|
|
317
|
+
for (const item of data) {
|
|
318
|
+
returnData.push({ json: item });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
returnData.push({ json: data });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
else if (operation === 'get') {
|
|
326
|
+
const tagId = this.getNodeParameter('tagId', i);
|
|
327
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'netSendoApi', {
|
|
328
|
+
method: 'GET',
|
|
329
|
+
url: `${baseUrl}/tags/${tagId}`,
|
|
330
|
+
});
|
|
331
|
+
returnData.push({ json: response.data || response });
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
if (this.continueOnFail()) {
|
|
337
|
+
returnData.push({ json: { error: error.message } });
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
throw error;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return [returnData];
|
|
344
|
+
}
|
|
74
345
|
}
|
|
75
346
|
exports.NetSendo = NetSendo;
|
|
76
347
|
//# sourceMappingURL=NetSendo.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetSendo.node.js","sourceRoot":"","sources":["../../../nodes/NetSendo/NetSendo.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAC9F,2CAAmD;AACnD,uDAA+D;AAC/D,yCAAiD;AACjD,oDAAiD;AAEjD,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,+B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EACJ,aAAa,EACb;4BACC,MAAM,EAAE,KAA4B;4BACpC,GAAG,EAAE,GAAG,OAAO,SAAS,KAAK,EAAE;yBAC/B,CACD,CAAC;wBACF,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC,CAAC;oBACtD,CAAC;gBACF,CAAC;YACF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAC/D,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA1XD,4BA0XC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class NetSendoTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|