@netsendo/mcp-client 1.2.0 → 1.4.0
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 +148 -12
- package/dist/api-client.d.ts +167 -2
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +163 -4
- package/dist/api-client.js.map +1 -1
- package/dist/index.js +108 -13
- package/dist/index.js.map +1 -1
- package/dist/tools/campaigns.d.ts +2 -2
- package/dist/tools/campaigns.d.ts.map +1 -1
- package/dist/tools/campaigns.js +271 -115
- package/dist/tools/campaigns.js.map +1 -1
- package/dist/tools/helpers.d.ts +28 -0
- package/dist/tools/helpers.d.ts.map +1 -0
- package/dist/tools/helpers.js +53 -0
- package/dist/tools/helpers.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +29 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list-activity.d.ts +10 -0
- package/dist/tools/list-activity.d.ts.map +1 -0
- package/dist/tools/list-activity.js +58 -0
- package/dist/tools/list-activity.js.map +1 -0
- package/dist/tools/list-export.d.ts +10 -0
- package/dist/tools/list-export.d.ts.map +1 -0
- package/dist/tools/list-export.js +60 -0
- package/dist/tools/list-export.js.map +1 -0
- package/dist/tools/list-hygiene.d.ts +11 -0
- package/dist/tools/list-hygiene.d.ts.map +1 -0
- package/dist/tools/list-hygiene.js +143 -0
- package/dist/tools/list-hygiene.js.map +1 -0
- package/dist/tools/list-import.d.ts +11 -0
- package/dist/tools/list-import.d.ts.map +1 -0
- package/dist/tools/list-import.js +88 -0
- package/dist/tools/list-import.js.map +1 -0
- package/dist/tools/list-members.d.ts +10 -0
- package/dist/tools/list-members.d.ts.map +1 -0
- package/dist/tools/list-members.js +144 -0
- package/dist/tools/list-members.js.map +1 -0
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +79 -0
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/notifications.d.ts +11 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +43 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/subscribers.js +1 -1
- package/dist/tools/subscribers.js.map +1 -1
- package/dist/tools/suppressions.d.ts +11 -0
- package/dist/tools/suppressions.d.ts.map +1 -0
- package/dist/tools/suppressions.js +54 -0
- package/dist/tools/suppressions.js.map +1 -0
- package/dist/types.d.ts +431 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,13 +133,112 @@ Best for connecting to NetSendo hosted on a server (e.g., `https://app.example.c
|
|
|
133
133
|
|
|
134
134
|
### Contact Lists & Tags
|
|
135
135
|
|
|
136
|
-
| Tool | Description
|
|
137
|
-
| ---------------------- |
|
|
138
|
-
| `list_contact_lists` | Get all contact lists
|
|
139
|
-
| `get_contact_list` | Get list details
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
| ---------------------- | -------------------------------------------------------------- |
|
|
138
|
+
| `list_contact_lists` | Get all contact lists |
|
|
139
|
+
| `get_contact_list` | Get list details |
|
|
140
|
+
| `get_list_stats` | Membership breakdown, engagement share, 30-day growth, config |
|
|
141
|
+
| `create_contact_list` | Create a list (`type`: email or sms) |
|
|
142
|
+
| `update_contact_list` | Update list settings (partial — untouched settings preserved) |
|
|
143
|
+
| `delete_contact_list` | Delete a list (**`confirm: true` required if it has members**) |
|
|
144
|
+
| `get_list_subscribers` | Get subscribers in a list |
|
|
145
|
+
| `list_tags` | Get all available tags |
|
|
146
|
+
| `list_custom_fields` | Get custom field definitions |
|
|
147
|
+
|
|
148
|
+
### List Import
|
|
149
|
+
|
|
150
|
+
| Tool | Description |
|
|
151
|
+
| ----------------------- | ----------------------------------------------------------------- |
|
|
152
|
+
| `preview_list_import` | Dry-run: detected mapping, per-action counts, problem rows |
|
|
153
|
+
| `import_subscribers` | Import CSV / TSV / JSON records / plain address list (≤5000 rows) |
|
|
154
|
+
|
|
155
|
+
Accepted shapes:
|
|
156
|
+
|
|
157
|
+
| `format` | Where the data goes | Notes |
|
|
158
|
+
| ---------- | ------------------- | -------------------------------------------------------------------- |
|
|
159
|
+
| `csv` | `data` (string) | Delimiter and header row auto-detected (`,` `;` tab `|`) |
|
|
160
|
+
| `tsv` | `data` (string) | Tab-separated |
|
|
161
|
+
| `json` | `records` (array) | Objects keyed by field name; supports `custom_fields` and `tags` |
|
|
162
|
+
| `emails` | `data` (string) | One per line; accepts `Anna Kowalska <anna@example.com>` |
|
|
163
|
+
|
|
164
|
+
Column mapping is automatic for common PL/EN/DE/ES headers (`email`, `e-mail`, `imię`,
|
|
165
|
+
`nazwisko`, `telefon`, `first_name`, …). Override it with
|
|
166
|
+
`column_mapping: {"0":"email","1":"first_name","3":"custom:city","2":"ignore"}`.
|
|
167
|
+
|
|
168
|
+
Import safeguards, all tunable per call: skip invalid syntax (default on), skip
|
|
169
|
+
disposable domains (on), skip suppressed addresses (on), skip role addresses (off),
|
|
170
|
+
auto-correct typo domains (off). Duplicates fold by real mailbox, so `JAN@x.pl`,
|
|
171
|
+
`jan@x.pl` and `j.an+news@gmail.com` collapse onto one contact.
|
|
172
|
+
|
|
173
|
+
### List Export
|
|
174
|
+
|
|
175
|
+
| Tool | Description |
|
|
176
|
+
| ------------------- | ---------------------------------------------------------------------- |
|
|
177
|
+
| `export_list` | Inline export, filtered and cursor-paged; `json`, `csv` or `ndjson` |
|
|
178
|
+
| `get_export_fields` | Available columns, including the account's custom fields |
|
|
179
|
+
| `queue_list_export` | Queue the classic full CSV export; owner receives a download link |
|
|
180
|
+
|
|
181
|
+
Filters: status, tag IDs, signup date range, and `engaged` (`false` isolates contacts
|
|
182
|
+
who never opened or clicked). Up to 5000 rows per call — when `has_more` is true,
|
|
183
|
+
call again with `cursor: next_cursor`.
|
|
184
|
+
|
|
185
|
+
### List Hygiene
|
|
186
|
+
|
|
187
|
+
| Tool | Description |
|
|
188
|
+
| --------------------- | ---------------------------------------------------------------------- |
|
|
189
|
+
| `analyze_list_health` | Health score 0–100, per-category counts with samples, recommendations |
|
|
190
|
+
| `clean_list` | Act on matched categories (**dry run by default**) |
|
|
191
|
+
| `dedupe_list` | Merge contacts sharing one real mailbox (**dry run by default**) |
|
|
192
|
+
| `verify_list_emails` | Syntax + MX/DNS deliverability check, per domain |
|
|
193
|
+
| `get_hygiene_options` | Exact category and action names accepted by `clean_list` |
|
|
194
|
+
|
|
195
|
+
Categories: `invalid_syntax`, `typo_domain`, `disposable_domain`, `role_address`,
|
|
196
|
+
`missing_contact`, `duplicate`, `hard_bounced`, `soft_bounce_risk`, `suppressed`,
|
|
197
|
+
`unsubscribed`, `unconfirmed`, `globally_inactive`, `never_engaged`, `dormant`.
|
|
198
|
+
|
|
199
|
+
Actions: `unsubscribe`, `remove`, `tag`, and the irreversible `delete` / `suppress`.
|
|
200
|
+
|
|
201
|
+
> **Safety.** `clean_list` and `dedupe_list` default to `dry_run: true`. Writing needs
|
|
202
|
+
> `dry_run: false`, and `delete` / `suppress` additionally need `confirm: true`.
|
|
203
|
+
> Deleting a list with members needs `confirm: true`. A filter-based
|
|
204
|
+
> `remove_list_members` needs `confirm: true`.
|
|
205
|
+
|
|
206
|
+
### List Membership
|
|
207
|
+
|
|
208
|
+
| Tool | Description |
|
|
209
|
+
| ---------------------- | -------------------------------------------------------- |
|
|
210
|
+
| `add_list_members` | Attach existing contacts to a list |
|
|
211
|
+
| `remove_list_members` | Detach from a list (contacts and other lists untouched) |
|
|
212
|
+
| `set_member_status` | Bulk status change: active / inactive / unsubscribed / bounced |
|
|
213
|
+
| `copy_list_members` | Copy to another list of the same channel |
|
|
214
|
+
| `move_list_members` | Move to another list of the same channel |
|
|
215
|
+
| `tag_list_members` | Add or remove tags across a segment |
|
|
216
|
+
|
|
217
|
+
All six take the same selection block — `subscriber_ids`, `emails`, or a `filter`
|
|
218
|
+
such as `{"status":"active","never_opened":true,"subscribed_before":"2025-01-01","limit":500}` —
|
|
219
|
+
capped at 5000 contacts per call. Pass `trigger_automations: false` to migrate an
|
|
220
|
+
audience without restarting the target list's welcome sequence.
|
|
221
|
+
|
|
222
|
+
### Activity & Engagement
|
|
223
|
+
|
|
224
|
+
| Tool | Description |
|
|
225
|
+
| ------------------------- | ----------------------------------------------------------------- |
|
|
226
|
+
| `get_list_activity` | Event feed: signups, confirmations, unsubscribes, bounces, sends, opens, clicks |
|
|
227
|
+
| `get_list_engagement` | Growth, churn, open/click/CTOR, top messages and links, most engaged |
|
|
228
|
+
| `get_subscriber_activity` | One contact's full timeline, memberships, tags and queued messages |
|
|
229
|
+
|
|
230
|
+
### Suppression & Notifications
|
|
231
|
+
|
|
232
|
+
| Tool | Description |
|
|
233
|
+
| -------------------- | -------------------------------------------------------------------- |
|
|
234
|
+
| `list_suppressions` | The account-wide do-not-mail list |
|
|
235
|
+
| `suppress_emails` | Suppress addresses and unsubscribe them everywhere |
|
|
236
|
+
| `unsuppress_emails` | Lift suppression (does **not** resubscribe anyone) |
|
|
237
|
+
| `send_notification` | Report back to the account owner's notification centre |
|
|
238
|
+
| `list_notifications` | Read recent notifications and the unread count |
|
|
239
|
+
|
|
240
|
+
Suppression outranks every list: suppressed addresses are skipped by future imports.
|
|
241
|
+
`send_notification` reaches only the account owner — it cannot message subscribers.
|
|
143
242
|
|
|
144
243
|
### Messaging
|
|
145
244
|
|
|
@@ -202,11 +301,21 @@ Best for connecting to NetSendo hosted on a server (e.g., `https://app.example.c
|
|
|
202
301
|
|
|
203
302
|
## 💡 Pre-built Prompts
|
|
204
303
|
|
|
205
|
-
| Prompt | Description
|
|
206
|
-
| --------------------- |
|
|
207
|
-
| `analyze_subscribers` | Analyze subscriber list quality
|
|
208
|
-
| `send_newsletter` | Help compose and send a newsletter
|
|
209
|
-
| `
|
|
304
|
+
| Prompt | Description |
|
|
305
|
+
| --------------------- | --------------------------------------------------------------- |
|
|
306
|
+
| `analyze_subscribers` | Analyze subscriber list quality |
|
|
307
|
+
| `send_newsletter` | Help compose and send a newsletter |
|
|
308
|
+
| `import_contacts` | Import contacts safely, with a preview before anything is written |
|
|
309
|
+
| `cleanup_list` | Audit a list and propose an approved-only clean-up plan |
|
|
310
|
+
| `list_report` | Performance report with prioritised next steps |
|
|
311
|
+
|
|
312
|
+
## 📚 Resources
|
|
313
|
+
|
|
314
|
+
| Resource | Description |
|
|
315
|
+
| ------------------- | ------------------------------------------------- |
|
|
316
|
+
| `netsendo://info` | Instance information and capabilities |
|
|
317
|
+
| `netsendo://stats` | Quick statistics overview |
|
|
318
|
+
| `netsendo://lists` | Contact list directory with sizes and channels |
|
|
210
319
|
|
|
211
320
|
---
|
|
212
321
|
|
|
@@ -240,6 +349,33 @@ CLI arguments take priority over environment variables.
|
|
|
240
349
|
- Rate limiting: 60 requests/minute
|
|
241
350
|
- Sensitive data never returned
|
|
242
351
|
|
|
352
|
+
### Required API key permissions
|
|
353
|
+
|
|
354
|
+
| Scope | Unlocks |
|
|
355
|
+
| --------------------- | ------------------------------------------------------------------ |
|
|
356
|
+
| `lists:read` | List details, stats, import preview, health report, activity, engagement |
|
|
357
|
+
| `lists:write` | Create/update/delete lists, import, clean, dedupe, membership changes |
|
|
358
|
+
| `subscribers:read` | Inline export, subscriber timeline, suppression list |
|
|
359
|
+
| `subscribers:write` | Suppression changes, subscriber CRUD |
|
|
360
|
+
| `notifications:write` | `send_notification` |
|
|
361
|
+
|
|
362
|
+
`lists:write` and `notifications:write` were added in 1.4.0. Keys created before the
|
|
363
|
+
upgrade are migrated automatically **if** they already held `subscribers:write`;
|
|
364
|
+
deliberately narrow keys keep their original scope and must be updated by hand under
|
|
365
|
+
**NetSendo → API keys**. A missing scope returns a `403` naming the exact permission.
|
|
366
|
+
|
|
367
|
+
### Destructive operations
|
|
368
|
+
|
|
369
|
+
Tools that can lose data refuse to act until they are told to twice:
|
|
370
|
+
|
|
371
|
+
- `clean_list`, `dedupe_list` — run as a dry run unless `dry_run: false`
|
|
372
|
+
- `clean_list` with `action: delete` or `suppress` — additionally needs `confirm: true`
|
|
373
|
+
- `delete_contact_list` on a non-empty list — needs `confirm: true`
|
|
374
|
+
- `remove_list_members` selected by `filter` — needs `confirm: true`
|
|
375
|
+
|
|
376
|
+
The intent is that an assistant always shows the user the affected count from the dry
|
|
377
|
+
run before anything is written.
|
|
378
|
+
|
|
243
379
|
---
|
|
244
380
|
|
|
245
381
|
## 🐛 Troubleshooting
|
package/dist/api-client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* HTTP client for communicating with NetSendo REST API v1
|
|
5
5
|
*/
|
|
6
6
|
import type { Config } from './config.js';
|
|
7
|
-
import type { Subscriber, SubscriberCreateInput, SubscriberUpdateInput, ContactList, Tag, EmailSendInput, EmailStatus, Mailbox, SmsSendInput, SmsStatus, SmsProvider, CustomField, PaginatedResponse, Message, MessageCreateInput, MessageUpdateInput, MessageStats, AbTest, AbTestCreateInput, AbTestVariant, AbTestVariantInput, AbTestVariantResult, Funnel, FunnelCreateInput, FunnelStep, FunnelStepInput, FunnelStats } from './types.js';
|
|
7
|
+
import type { Subscriber, SubscriberCreateInput, SubscriberUpdateInput, ContactList, Tag, EmailSendInput, EmailStatus, Mailbox, SmsSendInput, SmsStatus, SmsProvider, CustomField, PaginatedResponse, Message, MessageCreateInput, MessageUpdateInput, MessageStats, AbTest, AbTestCreateInput, AbTestVariant, AbTestVariantInput, AbTestVariantResult, Funnel, FunnelCreateInput, FunnelStep, FunnelStepInput, FunnelStats, ContactListCreateInput, ContactListUpdateInput, ListStats, ListImportPayload, ListImportPreview, ListImportResult, ListExportOptions, ListExportResult, ListHygieneReport, ListCleanResult, ListDedupeResult, ListVerifyResult, HygieneCategory, HygieneAction, MemberSelection, ListActivityFeed, ListEngagement, SubscriberActivity, SuppressionEntry, NotificationInput } from './types.js';
|
|
8
8
|
export declare class NetSendoApiError extends Error {
|
|
9
9
|
statusCode: number;
|
|
10
10
|
errors?: Record<string, string[]> | undefined;
|
|
@@ -35,7 +35,172 @@ export declare class NetSendoApiClient {
|
|
|
35
35
|
getListSubscribers(listId: number, params?: {
|
|
36
36
|
page?: number;
|
|
37
37
|
per_page?: number;
|
|
38
|
+
status?: string;
|
|
38
39
|
}): Promise<PaginatedResponse<Subscriber>>;
|
|
40
|
+
createContactList(data: ContactListCreateInput): Promise<ContactList>;
|
|
41
|
+
updateContactList(id: number, data: ContactListUpdateInput): Promise<ContactList>;
|
|
42
|
+
deleteContactList(id: number, confirm?: boolean): Promise<{
|
|
43
|
+
message: string;
|
|
44
|
+
list_id: number;
|
|
45
|
+
}>;
|
|
46
|
+
getListStats(id: number): Promise<ListStats>;
|
|
47
|
+
previewListImport(listId: number, payload: ListImportPayload): Promise<ListImportPreview>;
|
|
48
|
+
importToList(listId: number, payload: ListImportPayload): Promise<{
|
|
49
|
+
data: ListImportResult | ListImportPreview;
|
|
50
|
+
message?: string;
|
|
51
|
+
}>;
|
|
52
|
+
exportList(listId: number, options?: ListExportOptions): Promise<ListExportResult>;
|
|
53
|
+
getExportFields(listId: number): Promise<{
|
|
54
|
+
standard: string[];
|
|
55
|
+
custom_fields: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
label: string;
|
|
59
|
+
type: string;
|
|
60
|
+
}>;
|
|
61
|
+
}>;
|
|
62
|
+
/** Queue the classic CSV export; the account owner receives a download link. */
|
|
63
|
+
queueListExport(listId: number): Promise<{
|
|
64
|
+
message: string;
|
|
65
|
+
list_id: number;
|
|
66
|
+
}>;
|
|
67
|
+
analyzeListHygiene(listId: number, params?: {
|
|
68
|
+
unconfirmed_after_days?: number;
|
|
69
|
+
never_engaged_after_days?: number;
|
|
70
|
+
dormant_after_days?: number;
|
|
71
|
+
soft_bounce_threshold?: number;
|
|
72
|
+
sample_size?: number;
|
|
73
|
+
max_scan?: number;
|
|
74
|
+
}): Promise<ListHygieneReport>;
|
|
75
|
+
cleanList(listId: number, payload: {
|
|
76
|
+
categories: HygieneCategory[];
|
|
77
|
+
action: HygieneAction;
|
|
78
|
+
tag?: string;
|
|
79
|
+
dry_run?: boolean;
|
|
80
|
+
confirm?: boolean;
|
|
81
|
+
limit?: number;
|
|
82
|
+
reason?: string;
|
|
83
|
+
unconfirmed_after_days?: number;
|
|
84
|
+
never_engaged_after_days?: number;
|
|
85
|
+
dormant_after_days?: number;
|
|
86
|
+
soft_bounce_threshold?: number;
|
|
87
|
+
}): Promise<{
|
|
88
|
+
data: ListCleanResult;
|
|
89
|
+
message: string;
|
|
90
|
+
}>;
|
|
91
|
+
dedupeList(listId: number, payload?: {
|
|
92
|
+
dry_run?: boolean;
|
|
93
|
+
confirm?: boolean;
|
|
94
|
+
limit?: number;
|
|
95
|
+
keep?: 'oldest' | 'most_engaged';
|
|
96
|
+
}): Promise<{
|
|
97
|
+
data: ListDedupeResult;
|
|
98
|
+
message: string;
|
|
99
|
+
}>;
|
|
100
|
+
verifyListEmails(listId: number, payload?: {
|
|
101
|
+
limit?: number;
|
|
102
|
+
status?: string;
|
|
103
|
+
check_mx?: boolean;
|
|
104
|
+
max_domains?: number;
|
|
105
|
+
}): Promise<ListVerifyResult>;
|
|
106
|
+
getHygieneOptions(): Promise<{
|
|
107
|
+
categories: string[];
|
|
108
|
+
actions: string[];
|
|
109
|
+
destructive_actions: string[];
|
|
110
|
+
max_scan: number;
|
|
111
|
+
}>;
|
|
112
|
+
addListMembers(listId: number, payload: MemberSelection & {
|
|
113
|
+
source_list_id?: number;
|
|
114
|
+
source?: string;
|
|
115
|
+
trigger_automations?: boolean;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
data: Record<string, number>;
|
|
118
|
+
message: string;
|
|
119
|
+
}>;
|
|
120
|
+
removeListMembers(listId: number, payload: MemberSelection & {
|
|
121
|
+
confirm?: boolean;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
data: Record<string, number>;
|
|
124
|
+
message: string;
|
|
125
|
+
}>;
|
|
126
|
+
setListMemberStatus(listId: number, payload: MemberSelection & {
|
|
127
|
+
status: 'active' | 'inactive' | 'unsubscribed' | 'bounced';
|
|
128
|
+
reason?: string;
|
|
129
|
+
trigger_automations?: boolean;
|
|
130
|
+
}): Promise<{
|
|
131
|
+
data: Record<string, unknown>;
|
|
132
|
+
message: string;
|
|
133
|
+
}>;
|
|
134
|
+
transferListMembers(listId: number, mode: 'move' | 'copy', payload: MemberSelection & {
|
|
135
|
+
target_list_id: number;
|
|
136
|
+
source?: string;
|
|
137
|
+
trigger_automations?: boolean;
|
|
138
|
+
}): Promise<{
|
|
139
|
+
data: Record<string, unknown>;
|
|
140
|
+
message: string;
|
|
141
|
+
}>;
|
|
142
|
+
tagListMembers(listId: number, payload: MemberSelection & {
|
|
143
|
+
add?: string[];
|
|
144
|
+
remove?: string[];
|
|
145
|
+
}): Promise<{
|
|
146
|
+
data: Record<string, unknown>;
|
|
147
|
+
message: string;
|
|
148
|
+
}>;
|
|
149
|
+
getListActivity(listId: number, params?: {
|
|
150
|
+
days?: number;
|
|
151
|
+
limit?: number;
|
|
152
|
+
types?: string[];
|
|
153
|
+
}): Promise<ListActivityFeed>;
|
|
154
|
+
getListEngagement(listId: number, params?: {
|
|
155
|
+
days?: number;
|
|
156
|
+
}): Promise<ListEngagement>;
|
|
157
|
+
getSubscriberActivity(subscriberId: number, params?: {
|
|
158
|
+
days?: number;
|
|
159
|
+
limit?: number;
|
|
160
|
+
}): Promise<SubscriberActivity>;
|
|
161
|
+
listSuppressions(params?: {
|
|
162
|
+
search?: string;
|
|
163
|
+
reason?: string;
|
|
164
|
+
per_page?: number;
|
|
165
|
+
}): Promise<{
|
|
166
|
+
data: SuppressionEntry[];
|
|
167
|
+
meta: {
|
|
168
|
+
total: number;
|
|
169
|
+
current_page: number;
|
|
170
|
+
last_page: number;
|
|
171
|
+
};
|
|
172
|
+
}>;
|
|
173
|
+
addSuppressions(payload: {
|
|
174
|
+
emails: string[];
|
|
175
|
+
reason?: string;
|
|
176
|
+
unsubscribe_existing?: boolean;
|
|
177
|
+
}): Promise<{
|
|
178
|
+
data: {
|
|
179
|
+
suppressed: number;
|
|
180
|
+
memberships_unsubscribed: number;
|
|
181
|
+
reason: string;
|
|
182
|
+
};
|
|
183
|
+
message: string;
|
|
184
|
+
}>;
|
|
185
|
+
removeSuppressions(emails: string[]): Promise<{
|
|
186
|
+
data: {
|
|
187
|
+
removed: number;
|
|
188
|
+
};
|
|
189
|
+
message: string;
|
|
190
|
+
}>;
|
|
191
|
+
listNotifications(params?: {
|
|
192
|
+
unread_only?: boolean;
|
|
193
|
+
limit?: number;
|
|
194
|
+
}): Promise<{
|
|
195
|
+
data: Array<Record<string, unknown>>;
|
|
196
|
+
meta: {
|
|
197
|
+
unread: number;
|
|
198
|
+
};
|
|
199
|
+
}>;
|
|
200
|
+
createNotification(payload: NotificationInput): Promise<{
|
|
201
|
+
data: Record<string, unknown>;
|
|
202
|
+
message: string;
|
|
203
|
+
}>;
|
|
39
204
|
listTags(): Promise<Tag[]>;
|
|
40
205
|
getTag(id: number): Promise<Tag>;
|
|
41
206
|
listCustomFields(): Promise<CustomField[]>;
|
|
@@ -71,7 +236,7 @@ export declare class NetSendoApiClient {
|
|
|
71
236
|
message: Message;
|
|
72
237
|
planned_recipients: number;
|
|
73
238
|
}>;
|
|
74
|
-
scheduleMessage(id: number, scheduledAt: string): Promise<Message>;
|
|
239
|
+
scheduleMessage(id: number, scheduledAt: string, timezone?: string): Promise<Message>;
|
|
75
240
|
sendMessage(id: number): Promise<{
|
|
76
241
|
message: Message;
|
|
77
242
|
recipients_added?: number;
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,GAAG,EAOH,cAAc,EAC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b,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,WAAW,CAAC;QACnB,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACvE,CAAC;IAKI,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvC,gBAAgB,IAAI,OAAO,CAAC;QAChC,MAAM,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAClF,MAAM,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACvG,CAAC;IASI,cAAc,IAAI,OAAO,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAKF;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAqBzF"}
|
package/dist/api-client.js
CHANGED
|
@@ -60,8 +60,23 @@ export class NetSendoApiClient {
|
|
|
60
60
|
return response.data.data;
|
|
61
61
|
}
|
|
62
62
|
async createSubscriber(data) {
|
|
63
|
-
const
|
|
64
|
-
|
|
63
|
+
const { lists, ...rest } = data;
|
|
64
|
+
const listIds = lists ?? [];
|
|
65
|
+
if (listIds.length === 0) {
|
|
66
|
+
throw new Error('At least one contact list ID is required (lists parameter)');
|
|
67
|
+
}
|
|
68
|
+
// The REST endpoint accepts a single contact_list_id — call it once per
|
|
69
|
+
// list: the first call creates (or finds) the subscriber, subsequent calls
|
|
70
|
+
// attach the remaining lists (each attach starts that list's sequences).
|
|
71
|
+
let subscriber;
|
|
72
|
+
for (const listId of listIds) {
|
|
73
|
+
const response = await this.client.post('/subscribers', {
|
|
74
|
+
...rest,
|
|
75
|
+
contact_list_id: listId,
|
|
76
|
+
});
|
|
77
|
+
subscriber = response.data.data;
|
|
78
|
+
}
|
|
79
|
+
return subscriber;
|
|
65
80
|
}
|
|
66
81
|
async updateSubscriber(id, data) {
|
|
67
82
|
const response = await this.client.put(`/subscribers/${id}`, data);
|
|
@@ -89,6 +104,146 @@ export class NetSendoApiClient {
|
|
|
89
104
|
const response = await this.client.get(`/lists/${listId}/subscribers`, { params });
|
|
90
105
|
return response.data;
|
|
91
106
|
}
|
|
107
|
+
async createContactList(data) {
|
|
108
|
+
const response = await this.client.post('/lists', data);
|
|
109
|
+
return response.data.data;
|
|
110
|
+
}
|
|
111
|
+
async updateContactList(id, data) {
|
|
112
|
+
const response = await this.client.put(`/lists/${id}`, data);
|
|
113
|
+
return response.data.data;
|
|
114
|
+
}
|
|
115
|
+
async deleteContactList(id, confirm = false) {
|
|
116
|
+
const response = await this.client.delete(`/lists/${id}`, { params: { confirm: confirm ? 1 : 0 } });
|
|
117
|
+
return response.data;
|
|
118
|
+
}
|
|
119
|
+
async getListStats(id) {
|
|
120
|
+
const response = await this.client.get(`/lists/${id}/stats`);
|
|
121
|
+
return response.data.data;
|
|
122
|
+
}
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// List Import
|
|
125
|
+
// ============================================================================
|
|
126
|
+
async previewListImport(listId, payload) {
|
|
127
|
+
const response = await this.client.post(`/lists/${listId}/import/preview`, payload);
|
|
128
|
+
return response.data.data;
|
|
129
|
+
}
|
|
130
|
+
async importToList(listId, payload) {
|
|
131
|
+
const response = await this.client.post(`/lists/${listId}/import`, payload);
|
|
132
|
+
return response.data;
|
|
133
|
+
}
|
|
134
|
+
// ============================================================================
|
|
135
|
+
// List Export
|
|
136
|
+
// ============================================================================
|
|
137
|
+
async exportList(listId, options = {}) {
|
|
138
|
+
const response = await this.client.get(`/lists/${listId}/export`, {
|
|
139
|
+
params: options,
|
|
140
|
+
// PHP only builds an array from bracketed keys (fields[]=a&fields[]=b);
|
|
141
|
+
// without the brackets each repeat overwrites the last. axios emits the
|
|
142
|
+
// bracketed form with indexes: false.
|
|
143
|
+
paramsSerializer: { indexes: false },
|
|
144
|
+
});
|
|
145
|
+
return response.data.data;
|
|
146
|
+
}
|
|
147
|
+
async getExportFields(listId) {
|
|
148
|
+
const response = await this.client.get(`/lists/${listId}/export/fields`);
|
|
149
|
+
return response.data.data;
|
|
150
|
+
}
|
|
151
|
+
/** Queue the classic CSV export; the account owner receives a download link. */
|
|
152
|
+
async queueListExport(listId) {
|
|
153
|
+
const response = await this.client.post(`/lists/${listId}/export`);
|
|
154
|
+
return response.data;
|
|
155
|
+
}
|
|
156
|
+
// ============================================================================
|
|
157
|
+
// List Hygiene
|
|
158
|
+
// ============================================================================
|
|
159
|
+
async analyzeListHygiene(listId, params) {
|
|
160
|
+
const response = await this.client.get(`/lists/${listId}/hygiene`, { params });
|
|
161
|
+
return response.data.data;
|
|
162
|
+
}
|
|
163
|
+
async cleanList(listId, payload) {
|
|
164
|
+
const response = await this.client.post(`/lists/${listId}/hygiene/clean`, payload);
|
|
165
|
+
return response.data;
|
|
166
|
+
}
|
|
167
|
+
async dedupeList(listId, payload = {}) {
|
|
168
|
+
const response = await this.client.post(`/lists/${listId}/hygiene/dedupe`, payload);
|
|
169
|
+
return response.data;
|
|
170
|
+
}
|
|
171
|
+
async verifyListEmails(listId, payload = {}) {
|
|
172
|
+
const response = await this.client.post(`/lists/${listId}/hygiene/verify`, payload);
|
|
173
|
+
return response.data.data;
|
|
174
|
+
}
|
|
175
|
+
async getHygieneOptions() {
|
|
176
|
+
const response = await this.client.get('/lists/hygiene-options');
|
|
177
|
+
return response.data.data;
|
|
178
|
+
}
|
|
179
|
+
// ============================================================================
|
|
180
|
+
// List Membership
|
|
181
|
+
// ============================================================================
|
|
182
|
+
async addListMembers(listId, payload) {
|
|
183
|
+
const response = await this.client.post(`/lists/${listId}/members`, payload);
|
|
184
|
+
return response.data;
|
|
185
|
+
}
|
|
186
|
+
async removeListMembers(listId, payload) {
|
|
187
|
+
const response = await this.client.post(`/lists/${listId}/members/remove`, payload);
|
|
188
|
+
return response.data;
|
|
189
|
+
}
|
|
190
|
+
async setListMemberStatus(listId, payload) {
|
|
191
|
+
const response = await this.client.post(`/lists/${listId}/members/status`, payload);
|
|
192
|
+
return response.data;
|
|
193
|
+
}
|
|
194
|
+
async transferListMembers(listId, mode, payload) {
|
|
195
|
+
const response = await this.client.post(`/lists/${listId}/members/${mode}`, payload);
|
|
196
|
+
return response.data;
|
|
197
|
+
}
|
|
198
|
+
async tagListMembers(listId, payload) {
|
|
199
|
+
const response = await this.client.post(`/lists/${listId}/members/tags`, payload);
|
|
200
|
+
return response.data;
|
|
201
|
+
}
|
|
202
|
+
// ============================================================================
|
|
203
|
+
// Activity & Engagement
|
|
204
|
+
// ============================================================================
|
|
205
|
+
async getListActivity(listId, params) {
|
|
206
|
+
const response = await this.client.get(`/lists/${listId}/activity`, {
|
|
207
|
+
params,
|
|
208
|
+
// Bracketed array keys — see exportList().
|
|
209
|
+
paramsSerializer: { indexes: false },
|
|
210
|
+
});
|
|
211
|
+
return response.data.data;
|
|
212
|
+
}
|
|
213
|
+
async getListEngagement(listId, params) {
|
|
214
|
+
const response = await this.client.get(`/lists/${listId}/engagement`, { params });
|
|
215
|
+
return response.data.data;
|
|
216
|
+
}
|
|
217
|
+
async getSubscriberActivity(subscriberId, params) {
|
|
218
|
+
const response = await this.client.get(`/subscribers/${subscriberId}/activity`, { params });
|
|
219
|
+
return response.data.data;
|
|
220
|
+
}
|
|
221
|
+
// ============================================================================
|
|
222
|
+
// Suppression List
|
|
223
|
+
// ============================================================================
|
|
224
|
+
async listSuppressions(params) {
|
|
225
|
+
const response = await this.client.get('/suppressions', { params });
|
|
226
|
+
return response.data;
|
|
227
|
+
}
|
|
228
|
+
async addSuppressions(payload) {
|
|
229
|
+
const response = await this.client.post('/suppressions', payload);
|
|
230
|
+
return response.data;
|
|
231
|
+
}
|
|
232
|
+
async removeSuppressions(emails) {
|
|
233
|
+
const response = await this.client.delete('/suppressions', { data: { emails } });
|
|
234
|
+
return response.data;
|
|
235
|
+
}
|
|
236
|
+
// ============================================================================
|
|
237
|
+
// Notifications
|
|
238
|
+
// ============================================================================
|
|
239
|
+
async listNotifications(params) {
|
|
240
|
+
const response = await this.client.get('/notifications', { params });
|
|
241
|
+
return response.data;
|
|
242
|
+
}
|
|
243
|
+
async createNotification(payload) {
|
|
244
|
+
const response = await this.client.post('/notifications', payload);
|
|
245
|
+
return response.data;
|
|
246
|
+
}
|
|
92
247
|
// ============================================================================
|
|
93
248
|
// Tags
|
|
94
249
|
// ============================================================================
|
|
@@ -167,8 +322,12 @@ export class NetSendoApiClient {
|
|
|
167
322
|
const response = await this.client.post(`/messages/${id}/exclusions`, { excluded_list_ids: excludedListIds });
|
|
168
323
|
return response.data;
|
|
169
324
|
}
|
|
170
|
-
async scheduleMessage(id, scheduledAt) {
|
|
171
|
-
const
|
|
325
|
+
async scheduleMessage(id, scheduledAt, timezone) {
|
|
326
|
+
const payload = { scheduled_at: scheduledAt };
|
|
327
|
+
if (timezone) {
|
|
328
|
+
payload.timezone = timezone;
|
|
329
|
+
}
|
|
330
|
+
const response = await this.client.post(`/messages/${id}/schedule`, payload);
|
|
172
331
|
return response.data.data;
|
|
173
332
|
}
|
|
174
333
|
async sendMessage(id) {
|