@netsendo/mcp-client 1.3.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 +166 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +157 -2
- package/dist/api-client.js.map +1 -1
- package/dist/index.js +108 -13
- package/dist/index.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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Notification Tools
|
|
3
|
+
*
|
|
4
|
+
* How an automated process reports back to the human who owns the account.
|
|
5
|
+
* These notifications land in NetSendo's notification centre — they are never
|
|
6
|
+
* sent to subscribers or anyone outside the account.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { ok, fail, compact } from './helpers.js';
|
|
10
|
+
export function registerNotificationTools(server, api) {
|
|
11
|
+
server.tool('send_notification', `Post a notification to the NetSendo account owner's notification centre.
|
|
12
|
+
|
|
13
|
+
Use it to report the outcome of unattended work, or to flag something that needs a human decision — "import finished: 1240 added, 18 invalid", "this list has 12% hard bounces, clean-up recommended", "3200 contacts match the deletion criteria, awaiting approval".
|
|
14
|
+
|
|
15
|
+
This reaches only the account owner. It cannot message subscribers or third parties — use campaigns or send_email for that.`, {
|
|
16
|
+
title: z.string().max(255).describe('Short headline'),
|
|
17
|
+
message: z.string().max(2000).optional().describe('Details — include the numbers that matter'),
|
|
18
|
+
type: z.enum(['info', 'success', 'warning', 'error']).optional().describe('Severity (default: info). Use "warning" for something needing attention, "error" for a failure.'),
|
|
19
|
+
list_id: z.number().optional().describe('Related list — makes the notification link straight to it'),
|
|
20
|
+
action_url: z.string().max(2048).optional().describe('Custom link target; overrides the list link'),
|
|
21
|
+
data: z.record(z.any()).optional().describe('Structured payload kept with the notification, e.g. the import counters'),
|
|
22
|
+
}, async (payload) => {
|
|
23
|
+
try {
|
|
24
|
+
const result = await api.createNotification(compact(payload));
|
|
25
|
+
return ok({ ...result.data, message: result.message });
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return fail(error);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
server.tool('list_notifications', 'Read the account owner\'s recent notifications, including how many are unread. Useful to check whether an earlier report was already delivered before sending another.', {
|
|
32
|
+
unread_only: z.boolean().optional().describe('Only unread notifications (default: false)'),
|
|
33
|
+
limit: z.number().min(1).max(100).optional().describe('How many to return (default: 25)'),
|
|
34
|
+
}, async (params) => {
|
|
35
|
+
try {
|
|
36
|
+
return ok(await api.listNotifications(compact(params)));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return fail(error);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,GAAsB;IAEjF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB;;;;4HAIwH,EACxH;QACE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACrD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QAC9F,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iGAAiG,CAAC;QAC5K,OAAO,EAAE,CAAC,C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,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -100,7 +100,7 @@ export function registerSubscriberTools(server, api) {
|
|
|
100
100
|
first_name: z.string().optional().describe('First name'),
|
|
101
101
|
last_name: z.string().optional().describe('Last name'),
|
|
102
102
|
phone: z.string().optional().describe('Phone number'),
|
|
103
|
-
lists: z.array(z.number()).
|
|
103
|
+
lists: z.array(z.number()).min(1).describe('Contact list IDs to subscribe to (at least one required)'),
|
|
104
104
|
tags: z.array(z.union([z.number(), z.string()])).optional().describe('Array of tag IDs or names'),
|
|
105
105
|
source: z.string().optional().describe('Subscription source (e.g., "mcp", "api")'),
|
|
106
106
|
custom_fields: z.record(z.union([z.string(), z.number(), z.boolean()])).optional().describe('Custom field values'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribers.js","sourceRoot":"","sources":["../../src/tools/subscribers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,GAAsB;IAE/E,mBAAmB;IACnB,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,sIAAsI,EACtI;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACjG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QACjE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QACpE,MAAM,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pE,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YAExE,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,OAAO,EAAE,IAAI;4BACb,OAAO,EAAE,8BAA8B,aAAa,EAAE;4BACtD,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;yBACpE,EAAE,IAAI,EAAE,CAAC,CAAC;qBACZ,CAAC;aACH,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAW,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC;gBAChF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Suppression Tools
|
|
3
|
+
*
|
|
4
|
+
* The account-wide do-not-mail list. Suppression outranks every list: a
|
|
5
|
+
* suppressed address is skipped on import and cannot be mailed again until it
|
|
6
|
+
* is explicitly lifted.
|
|
7
|
+
*/
|
|
8
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
+
import type { NetSendoApiClient } from '../api-client.js';
|
|
10
|
+
export declare function registerSuppressionTools(server: McpServer, api: NetSendoApiClient): void;
|
|
11
|
+
//# sourceMappingURL=suppressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppressions.d.ts","sourceRoot":"","sources":["../../src/tools/suppressions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,QA0DjF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Suppression Tools
|
|
3
|
+
*
|
|
4
|
+
* The account-wide do-not-mail list. Suppression outranks every list: a
|
|
5
|
+
* suppressed address is skipped on import and cannot be mailed again until it
|
|
6
|
+
* is explicitly lifted.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { ok, fail, compact } from './helpers.js';
|
|
10
|
+
export function registerSuppressionTools(server, api) {
|
|
11
|
+
server.tool('list_suppressions', 'Show the account-wide suppression list — addresses that must never be mailed again, with the reason and the date they were suppressed.', {
|
|
12
|
+
search: z.string().optional().describe('Filter by a fragment of the address'),
|
|
13
|
+
reason: z.string().optional().describe('Filter by reason, e.g. "gdpr_erasure"'),
|
|
14
|
+
per_page: z.number().min(1).max(200).optional().describe('Results per page (default: 50)'),
|
|
15
|
+
}, async (params) => {
|
|
16
|
+
try {
|
|
17
|
+
return ok(await api.listSuppressions(compact(params)));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return fail(error);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
server.tool('suppress_emails', `Add addresses to the account-wide do-not-mail list and, by default, unsubscribe them from every list they are on.
|
|
24
|
+
|
|
25
|
+
Use this for people who asked to be forgotten, complained, or must not be contacted again for legal reasons. Suppression is the strongest guarantee in the system: these addresses are also skipped by future imports.
|
|
26
|
+
|
|
27
|
+
Only suppress addresses when the user has asked for it or the person clearly requested it — it is a deliberate, account-wide block, not a clean-up shortcut.`, {
|
|
28
|
+
emails: z.array(z.string().email()).min(1).max(1000).describe('Addresses to suppress'),
|
|
29
|
+
reason: z.string().optional().describe('Why, e.g. "gdpr_erasure", "complaint", "user_request" (default: api)'),
|
|
30
|
+
unsubscribe_existing: z.boolean().optional().describe('Also unsubscribe them from every list (default: true)'),
|
|
31
|
+
}, async (payload) => {
|
|
32
|
+
try {
|
|
33
|
+
const result = await api.addSuppressions(payload);
|
|
34
|
+
return ok({ ...result.data, message: result.message });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return fail(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
server.tool('unsuppress_emails', `Lift suppression for addresses. This does NOT resubscribe anyone — it only removes the block, so consent has to be collected again through a normal signup.
|
|
41
|
+
|
|
42
|
+
Only do this when the person has renewed their consent.`, {
|
|
43
|
+
emails: z.array(z.string().email()).min(1).max(1000).describe('Addresses to remove from suppression'),
|
|
44
|
+
}, async ({ emails }) => {
|
|
45
|
+
try {
|
|
46
|
+
const result = await api.removeSuppressions(emails);
|
|
47
|
+
return ok({ ...result.data, message: result.message });
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return fail(error);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=suppressions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppressions.js","sourceRoot":"","sources":["../../src/tools/suppressions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,UAAU,wBAAwB,CAAC,MAAiB,EAAE,GAAsB;IAEhF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,w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AE,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB;;wDAEoD,EACpD;QACE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACtG,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACpD,OAAO,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -445,4 +445,435 @@ export interface ApiErrorResponse {
|
|
|
445
445
|
message: string;
|
|
446
446
|
errors?: Record<string, string[]>;
|
|
447
447
|
}
|
|
448
|
+
export type ImportFormat = 'csv' | 'tsv' | 'json' | 'emails';
|
|
449
|
+
export interface ListImportPayload {
|
|
450
|
+
format?: ImportFormat;
|
|
451
|
+
/** Raw text for csv/tsv/emails */
|
|
452
|
+
data?: string;
|
|
453
|
+
/** Array of objects for format=json */
|
|
454
|
+
records?: Array<Record<string, unknown>>;
|
|
455
|
+
delimiter?: string;
|
|
456
|
+
has_header?: boolean;
|
|
457
|
+
/** Column index (or header/key name) → field name, 'custom:<name>' or 'ignore' */
|
|
458
|
+
column_mapping?: Record<string, string>;
|
|
459
|
+
dry_run?: boolean;
|
|
460
|
+
update_existing?: boolean;
|
|
461
|
+
skip_invalid?: boolean;
|
|
462
|
+
skip_role?: boolean;
|
|
463
|
+
skip_disposable?: boolean;
|
|
464
|
+
skip_suppressed?: boolean;
|
|
465
|
+
fix_typos?: boolean;
|
|
466
|
+
trigger_automations?: boolean;
|
|
467
|
+
detect_gender?: boolean;
|
|
468
|
+
status?: 'active' | 'inactive' | 'unsubscribed';
|
|
469
|
+
source?: string;
|
|
470
|
+
tags?: Array<string | number>;
|
|
471
|
+
sample_size?: number;
|
|
472
|
+
}
|
|
473
|
+
export interface ImportPlanSummary {
|
|
474
|
+
total: number;
|
|
475
|
+
create: number;
|
|
476
|
+
update: number;
|
|
477
|
+
reactivate: number;
|
|
478
|
+
already_active: number;
|
|
479
|
+
skipped: number;
|
|
480
|
+
invalid: number;
|
|
481
|
+
duplicate_in_payload: number;
|
|
482
|
+
issues: Record<string, number>;
|
|
483
|
+
}
|
|
484
|
+
export interface ListImportPreview {
|
|
485
|
+
list: {
|
|
486
|
+
id: number;
|
|
487
|
+
name: string;
|
|
488
|
+
type: string;
|
|
489
|
+
};
|
|
490
|
+
detected: {
|
|
491
|
+
columns: string[];
|
|
492
|
+
header: string[] | null;
|
|
493
|
+
delimiter: string | null;
|
|
494
|
+
mapping: Record<string, string>;
|
|
495
|
+
};
|
|
496
|
+
summary: ImportPlanSummary;
|
|
497
|
+
warnings: string[];
|
|
498
|
+
sample: Array<{
|
|
499
|
+
row: number;
|
|
500
|
+
email: string | null;
|
|
501
|
+
phone: string | null;
|
|
502
|
+
first_name: string | null;
|
|
503
|
+
last_name: string | null;
|
|
504
|
+
action: string;
|
|
505
|
+
reason: string | null;
|
|
506
|
+
issues: string[];
|
|
507
|
+
suggestion: string | null;
|
|
508
|
+
}>;
|
|
509
|
+
problem_rows: Array<{
|
|
510
|
+
row: number;
|
|
511
|
+
email: string | null;
|
|
512
|
+
action: string;
|
|
513
|
+
reason: string | null;
|
|
514
|
+
issues: string[];
|
|
515
|
+
suggestion: string | null;
|
|
516
|
+
}>;
|
|
517
|
+
}
|
|
518
|
+
export interface ListImportResult {
|
|
519
|
+
created: number;
|
|
520
|
+
updated: number;
|
|
521
|
+
reactivated: number;
|
|
522
|
+
already_active: number;
|
|
523
|
+
skipped: number;
|
|
524
|
+
invalid: number;
|
|
525
|
+
failed: number;
|
|
526
|
+
errors: Array<{
|
|
527
|
+
row: number;
|
|
528
|
+
email: string | null;
|
|
529
|
+
error: string;
|
|
530
|
+
}>;
|
|
531
|
+
subscriber_ids: number[];
|
|
532
|
+
plan_summary: ImportPlanSummary;
|
|
533
|
+
warnings: string[];
|
|
534
|
+
}
|
|
535
|
+
export interface ListExportOptions {
|
|
536
|
+
format?: 'json' | 'csv' | 'ndjson';
|
|
537
|
+
fields?: string[];
|
|
538
|
+
status?: 'active' | 'inactive' | 'unsubscribed' | 'bounced' | 'all';
|
|
539
|
+
tag_ids?: number[];
|
|
540
|
+
subscribed_after?: string;
|
|
541
|
+
subscribed_before?: string;
|
|
542
|
+
engaged?: boolean;
|
|
543
|
+
limit?: number;
|
|
544
|
+
cursor?: number;
|
|
545
|
+
delimiter?: string;
|
|
546
|
+
}
|
|
547
|
+
export interface ListExportResult {
|
|
548
|
+
list: {
|
|
549
|
+
id: number;
|
|
550
|
+
name: string;
|
|
551
|
+
type: string;
|
|
552
|
+
};
|
|
553
|
+
format: string;
|
|
554
|
+
fields: string[];
|
|
555
|
+
filters: Record<string, unknown>;
|
|
556
|
+
count: number;
|
|
557
|
+
has_more: boolean;
|
|
558
|
+
next_cursor: number | null;
|
|
559
|
+
/** Present when format=json */
|
|
560
|
+
records?: Array<Record<string, unknown>>;
|
|
561
|
+
/** Present when format=csv or ndjson */
|
|
562
|
+
data?: string;
|
|
563
|
+
}
|
|
564
|
+
export type HygieneCategory = 'missing_contact' | 'invalid_syntax' | 'typo_domain' | 'disposable_domain' | 'role_address' | 'duplicate' | 'hard_bounced' | 'soft_bounce_risk' | 'unsubscribed' | 'unconfirmed' | 'suppressed' | 'globally_inactive' | 'never_engaged' | 'dormant';
|
|
565
|
+
export type HygieneAction = 'unsubscribe' | 'remove' | 'delete' | 'tag' | 'suppress';
|
|
566
|
+
export interface ListHygieneReport {
|
|
567
|
+
list: {
|
|
568
|
+
id: number;
|
|
569
|
+
name: string;
|
|
570
|
+
type: string;
|
|
571
|
+
double_opt_in: boolean;
|
|
572
|
+
};
|
|
573
|
+
scanned: number;
|
|
574
|
+
truncated: boolean;
|
|
575
|
+
totals: {
|
|
576
|
+
members: number;
|
|
577
|
+
active: number;
|
|
578
|
+
unsubscribed: number;
|
|
579
|
+
bounced: number;
|
|
580
|
+
other_status: number;
|
|
581
|
+
confirmed: number;
|
|
582
|
+
};
|
|
583
|
+
engagement: {
|
|
584
|
+
engaged: number;
|
|
585
|
+
never_engaged: number;
|
|
586
|
+
dormant: number;
|
|
587
|
+
engagement_rate: number;
|
|
588
|
+
};
|
|
589
|
+
issues: Record<HygieneCategory, {
|
|
590
|
+
count: number;
|
|
591
|
+
sample: Array<{
|
|
592
|
+
subscriber_id: number;
|
|
593
|
+
email: string | null;
|
|
594
|
+
status: string;
|
|
595
|
+
detail: string | null;
|
|
596
|
+
}>;
|
|
597
|
+
}>;
|
|
598
|
+
health_score: number;
|
|
599
|
+
thresholds: Record<string, number>;
|
|
600
|
+
recommendations: Array<{
|
|
601
|
+
category: HygieneCategory;
|
|
602
|
+
count: number;
|
|
603
|
+
share_percent: number;
|
|
604
|
+
suggested_action: HygieneAction;
|
|
605
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
606
|
+
description: string;
|
|
607
|
+
}>;
|
|
608
|
+
}
|
|
609
|
+
export interface ListCleanResult {
|
|
610
|
+
list: {
|
|
611
|
+
id: number;
|
|
612
|
+
name: string;
|
|
613
|
+
};
|
|
614
|
+
action: HygieneAction;
|
|
615
|
+
categories: HygieneCategory[];
|
|
616
|
+
dry_run: boolean;
|
|
617
|
+
matched: number;
|
|
618
|
+
limited_to: number;
|
|
619
|
+
affected: number;
|
|
620
|
+
failed: number;
|
|
621
|
+
by_category: Record<string, number>;
|
|
622
|
+
sample: Array<{
|
|
623
|
+
subscriber_id: number;
|
|
624
|
+
email: string | null;
|
|
625
|
+
categories: string[];
|
|
626
|
+
}>;
|
|
627
|
+
errors: Array<{
|
|
628
|
+
subscriber_id: number;
|
|
629
|
+
error: string;
|
|
630
|
+
}>;
|
|
631
|
+
}
|
|
632
|
+
export interface ListDedupeResult {
|
|
633
|
+
list: {
|
|
634
|
+
id: number;
|
|
635
|
+
name: string;
|
|
636
|
+
};
|
|
637
|
+
dry_run: boolean;
|
|
638
|
+
duplicate_groups: number;
|
|
639
|
+
duplicate_records: number;
|
|
640
|
+
merged: number;
|
|
641
|
+
failed: number;
|
|
642
|
+
keep_strategy: string;
|
|
643
|
+
groups: Array<{
|
|
644
|
+
canonical_email: string;
|
|
645
|
+
keep: {
|
|
646
|
+
id: number;
|
|
647
|
+
email: string;
|
|
648
|
+
};
|
|
649
|
+
merge: Array<{
|
|
650
|
+
id: number;
|
|
651
|
+
email: string;
|
|
652
|
+
}>;
|
|
653
|
+
}>;
|
|
654
|
+
errors: Array<{
|
|
655
|
+
subscriber_id: number;
|
|
656
|
+
error: string;
|
|
657
|
+
}>;
|
|
658
|
+
}
|
|
659
|
+
export interface ListVerifyResult {
|
|
660
|
+
list: {
|
|
661
|
+
id: number;
|
|
662
|
+
name: string;
|
|
663
|
+
};
|
|
664
|
+
checked: number;
|
|
665
|
+
status_filter: string;
|
|
666
|
+
verdicts: {
|
|
667
|
+
deliverable: number;
|
|
668
|
+
risky: number;
|
|
669
|
+
undeliverable: number;
|
|
670
|
+
unknown: number;
|
|
671
|
+
};
|
|
672
|
+
deliverable_rate: number;
|
|
673
|
+
domains: Array<{
|
|
674
|
+
domain: string;
|
|
675
|
+
addresses: number;
|
|
676
|
+
has_mx: boolean;
|
|
677
|
+
}>;
|
|
678
|
+
domains_without_mx: Array<{
|
|
679
|
+
domain: string;
|
|
680
|
+
addresses: number;
|
|
681
|
+
has_mx: boolean;
|
|
682
|
+
}>;
|
|
683
|
+
problems: Array<{
|
|
684
|
+
subscriber_id: number;
|
|
685
|
+
email: string | null;
|
|
686
|
+
verdict: string;
|
|
687
|
+
issues: string[];
|
|
688
|
+
suggestion: string | null;
|
|
689
|
+
}>;
|
|
690
|
+
}
|
|
691
|
+
export interface MemberSelection {
|
|
692
|
+
subscriber_ids?: number[];
|
|
693
|
+
emails?: string[];
|
|
694
|
+
filter?: {
|
|
695
|
+
status?: 'active' | 'inactive' | 'unsubscribed' | 'bounced' | 'all';
|
|
696
|
+
tag_ids?: number[];
|
|
697
|
+
engaged?: boolean;
|
|
698
|
+
subscribed_before?: string;
|
|
699
|
+
subscribed_after?: string;
|
|
700
|
+
never_opened?: boolean;
|
|
701
|
+
limit?: number;
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
export interface ListActivityFeed {
|
|
705
|
+
list: {
|
|
706
|
+
id: number;
|
|
707
|
+
name: string;
|
|
708
|
+
};
|
|
709
|
+
window_days: number;
|
|
710
|
+
since: string;
|
|
711
|
+
event_counts: Record<string, number>;
|
|
712
|
+
events: Array<{
|
|
713
|
+
type: string;
|
|
714
|
+
occurred_at: string;
|
|
715
|
+
subscriber_id: number;
|
|
716
|
+
email: string | null;
|
|
717
|
+
name: string | null;
|
|
718
|
+
detail: Record<string, unknown> | null;
|
|
719
|
+
}>;
|
|
720
|
+
note: string | null;
|
|
721
|
+
}
|
|
722
|
+
export interface ListEngagement {
|
|
723
|
+
list: {
|
|
724
|
+
id: number;
|
|
725
|
+
name: string;
|
|
726
|
+
type: string;
|
|
727
|
+
};
|
|
728
|
+
window_days: number;
|
|
729
|
+
since: string;
|
|
730
|
+
audience: {
|
|
731
|
+
members: number;
|
|
732
|
+
active: number;
|
|
733
|
+
unsubscribed: number;
|
|
734
|
+
bounced: number;
|
|
735
|
+
by_status: Record<string, number>;
|
|
736
|
+
};
|
|
737
|
+
growth: {
|
|
738
|
+
added: number;
|
|
739
|
+
lost: number;
|
|
740
|
+
net: number;
|
|
741
|
+
churn_rate: number;
|
|
742
|
+
daily: Array<{
|
|
743
|
+
date: string;
|
|
744
|
+
added: number;
|
|
745
|
+
lost: number;
|
|
746
|
+
}>;
|
|
747
|
+
};
|
|
748
|
+
delivery: {
|
|
749
|
+
sent: number;
|
|
750
|
+
total_opens: number;
|
|
751
|
+
unique_openers: number;
|
|
752
|
+
total_clicks: number;
|
|
753
|
+
unique_clickers: number;
|
|
754
|
+
open_rate: number;
|
|
755
|
+
click_rate: number;
|
|
756
|
+
click_to_open_rate: number;
|
|
757
|
+
};
|
|
758
|
+
top_messages: Array<{
|
|
759
|
+
message_id: number;
|
|
760
|
+
subject: string;
|
|
761
|
+
opens: number;
|
|
762
|
+
unique_openers: number;
|
|
763
|
+
}>;
|
|
764
|
+
top_links: Array<{
|
|
765
|
+
url: string;
|
|
766
|
+
clicks: number;
|
|
767
|
+
unique_clickers: number;
|
|
768
|
+
}>;
|
|
769
|
+
most_engaged: Array<{
|
|
770
|
+
subscriber_id: number;
|
|
771
|
+
email: string | null;
|
|
772
|
+
name: string | null;
|
|
773
|
+
opens: number;
|
|
774
|
+
clicks: number;
|
|
775
|
+
last_opened_at: string | null;
|
|
776
|
+
last_clicked_at: string | null;
|
|
777
|
+
}>;
|
|
778
|
+
inactive: {
|
|
779
|
+
never_engaged: number;
|
|
780
|
+
no_activity_90_days: number;
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
export interface SubscriberActivity {
|
|
784
|
+
subscriber: {
|
|
785
|
+
id: number;
|
|
786
|
+
email: string | null;
|
|
787
|
+
phone: string | null;
|
|
788
|
+
name: string | null;
|
|
789
|
+
is_active_global: boolean;
|
|
790
|
+
source: string | null;
|
|
791
|
+
language: string | null;
|
|
792
|
+
opens_count: number;
|
|
793
|
+
clicks_count: number;
|
|
794
|
+
last_opened_at: string | null;
|
|
795
|
+
last_clicked_at: string | null;
|
|
796
|
+
created_at: string | null;
|
|
797
|
+
};
|
|
798
|
+
tags: Array<{
|
|
799
|
+
id: number;
|
|
800
|
+
name: string;
|
|
801
|
+
}>;
|
|
802
|
+
lists: Array<{
|
|
803
|
+
id: number;
|
|
804
|
+
name: string;
|
|
805
|
+
status: string;
|
|
806
|
+
source: string | null;
|
|
807
|
+
subscribed_at: string | null;
|
|
808
|
+
confirmed_at: string | null;
|
|
809
|
+
unsubscribed_at: string | null;
|
|
810
|
+
}>;
|
|
811
|
+
pending_messages: number;
|
|
812
|
+
window_days: number;
|
|
813
|
+
events: Array<{
|
|
814
|
+
type: string;
|
|
815
|
+
occurred_at: string;
|
|
816
|
+
detail: Record<string, unknown>;
|
|
817
|
+
}>;
|
|
818
|
+
}
|
|
819
|
+
export interface ListStats {
|
|
820
|
+
id: number;
|
|
821
|
+
name: string;
|
|
822
|
+
type: string;
|
|
823
|
+
description: string | null;
|
|
824
|
+
group: string | null;
|
|
825
|
+
members: {
|
|
826
|
+
total: number;
|
|
827
|
+
active: number;
|
|
828
|
+
unsubscribed: number;
|
|
829
|
+
bounced: number;
|
|
830
|
+
by_status: Record<string, number>;
|
|
831
|
+
};
|
|
832
|
+
engagement: {
|
|
833
|
+
openers: number;
|
|
834
|
+
clickers: number;
|
|
835
|
+
confirmed: number;
|
|
836
|
+
open_share_percent: number;
|
|
837
|
+
click_share_percent: number;
|
|
838
|
+
};
|
|
839
|
+
last_30_days: {
|
|
840
|
+
added: number;
|
|
841
|
+
lost: number;
|
|
842
|
+
net: number;
|
|
843
|
+
};
|
|
844
|
+
configuration: Record<string, unknown>;
|
|
845
|
+
created_at: string | null;
|
|
846
|
+
}
|
|
847
|
+
export interface ContactListCreateInput {
|
|
848
|
+
name: string;
|
|
849
|
+
type?: 'email' | 'sms';
|
|
850
|
+
description?: string;
|
|
851
|
+
contact_list_group_id?: number;
|
|
852
|
+
default_mailbox_id?: number;
|
|
853
|
+
default_sms_provider_id?: number;
|
|
854
|
+
is_public?: boolean;
|
|
855
|
+
timezone?: string;
|
|
856
|
+
double_opt_in?: boolean;
|
|
857
|
+
resubscription_behavior?: 'reset_date' | 'keep_original_date';
|
|
858
|
+
max_subscribers?: number;
|
|
859
|
+
}
|
|
860
|
+
export interface ContactListUpdateInput extends Partial<ContactListCreateInput> {
|
|
861
|
+
signups_blocked?: boolean;
|
|
862
|
+
webhook_url?: string;
|
|
863
|
+
webhook_events?: string[];
|
|
864
|
+
}
|
|
865
|
+
export interface SuppressionEntry {
|
|
866
|
+
id: number;
|
|
867
|
+
email: string;
|
|
868
|
+
reason: string;
|
|
869
|
+
suppressed_at: string;
|
|
870
|
+
}
|
|
871
|
+
export interface NotificationInput {
|
|
872
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
873
|
+
title: string;
|
|
874
|
+
message?: string;
|
|
875
|
+
action_url?: string;
|
|
876
|
+
list_id?: number;
|
|
877
|
+
data?: Record<string, unknown>;
|
|
878
|
+
}
|
|
448
879
|
//# sourceMappingURL=types.d.ts.map
|