@netsendo/mcp-client 1.5.1 → 1.6.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 +125 -2
- package/dist/api-client.d.ts +10 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +20 -1
- package/dist/api-client.js.map +1 -1
- package/dist/config.d.ts +1 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/automations.d.ts +12 -0
- package/dist/tools/automations.d.ts.map +1 -0
- package/dist/tools/automations.js +184 -0
- package/dist/tools/automations.js.map +1 -0
- package/dist/tools/campaign-extras.d.ts +175 -0
- package/dist/tools/campaign-extras.d.ts.map +1 -0
- package/dist/tools/campaign-extras.js +283 -0
- package/dist/tools/campaign-extras.js.map +1 -0
- package/dist/tools/campaigns.d.ts.map +1 -1
- package/dist/tools/campaigns.js +81 -93
- package/dist/tools/campaigns.js.map +1 -1
- package/dist/tools/custom-fields.d.ts +12 -0
- package/dist/tools/custom-fields.d.ts.map +1 -0
- package/dist/tools/custom-fields.js +94 -0
- package/dist/tools/custom-fields.js.map +1 -0
- package/dist/tools/forms.d.ts +10 -0
- package/dist/tools/forms.d.ts.map +1 -0
- package/dist/tools/forms.js +163 -0
- package/dist/tools/forms.js.map +1 -0
- package/dist/tools/funnels.js +3 -3
- package/dist/tools/funnels.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +16 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list-import.js +4 -4
- package/dist/tools/list-import.js.map +1 -1
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +206 -97
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/notifications.js +1 -1
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/subscribers.js +2 -2
- package/dist/tools/subscribers.js.map +1 -1
- package/dist/tools/system-content.d.ts +12 -0
- package/dist/tools/system-content.d.ts.map +1 -0
- package/dist/tools/system-content.js +150 -0
- package/dist/tools/system-content.js.map +1 -0
- package/dist/tools/tags.d.ts +11 -0
- package/dist/tools/tags.d.ts.map +1 -0
- package/dist/tools/tags.js +61 -0
- package/dist/tools/tags.js.map +1 -0
- package/dist/tools/templates.d.ts +10 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +294 -0
- package/dist/tools/templates.js.map +1 -0
- package/dist/tools/webhooks.d.ts +11 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +130 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Campaign editor extras
|
|
3
|
+
*
|
|
4
|
+
* The editor fields shared by create_campaign / update_campaign (trigger,
|
|
5
|
+
* tags, translations, tracked links, CRM contacts, audience field filters,
|
|
6
|
+
* A/B config) and the campaign actions: test send, preview, duplicate,
|
|
7
|
+
* activation, recipient count, re-sending failed / missed recipients.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
|
+
import type { NetSendoApiClient } from '../api-client.js';
|
|
12
|
+
export declare const TRIGGER_TYPES: readonly ["signup", "anniversary", "birthday", "inactivity", "page_visit", "custom", "recent_subscribers", "opened_message", "not_opened_message"];
|
|
13
|
+
/**
|
|
14
|
+
* Optional editor fields accepted by POST/PUT /messages. Every key is
|
|
15
|
+
* optional; on update an omitted key leaves the stored value untouched and an
|
|
16
|
+
* empty array clears it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const campaignEditorShape: {
|
|
19
|
+
template_id: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
send_in_subscriber_timezone: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
trigger_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
22
|
+
signup: "signup";
|
|
23
|
+
page_visit: "page_visit";
|
|
24
|
+
custom: "custom";
|
|
25
|
+
anniversary: "anniversary";
|
|
26
|
+
birthday: "birthday";
|
|
27
|
+
inactivity: "inactivity";
|
|
28
|
+
recent_subscribers: "recent_subscribers";
|
|
29
|
+
opened_message: "opened_message";
|
|
30
|
+
not_opened_message: "not_opened_message";
|
|
31
|
+
}>>>;
|
|
32
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
list_id: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
message_id: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
tag_id: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
inactive_days: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
recent_days: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
url_pattern: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
40
|
+
tag_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
41
|
+
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
language: z.ZodString;
|
|
43
|
+
subject: z.ZodString;
|
|
44
|
+
preheader: z.ZodOptional<z.ZodString>;
|
|
45
|
+
content: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
tracked_links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
48
|
+
url: z.ZodString;
|
|
49
|
+
tracking_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
share_data_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
shared_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
subscribe_to_list_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
53
|
+
unsubscribe_from_list_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
crm_contact_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
56
|
+
excluded_crm_contact_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
57
|
+
include_field_filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
custom_field_id: z.ZodNumber;
|
|
59
|
+
operator: z.ZodEnum<{
|
|
60
|
+
any_of: "any_of";
|
|
61
|
+
none_of: "none_of";
|
|
62
|
+
contains: "contains";
|
|
63
|
+
not_contains: "not_contains";
|
|
64
|
+
starts_with: "starts_with";
|
|
65
|
+
ends_with: "ends_with";
|
|
66
|
+
is_set: "is_set";
|
|
67
|
+
is_empty: "is_empty";
|
|
68
|
+
gt: "gt";
|
|
69
|
+
gte: "gte";
|
|
70
|
+
lt: "lt";
|
|
71
|
+
lte: "lte";
|
|
72
|
+
between: "between";
|
|
73
|
+
}>;
|
|
74
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>>>;
|
|
76
|
+
include_field_filter_match: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
all: "all";
|
|
78
|
+
any: "any";
|
|
79
|
+
}>>;
|
|
80
|
+
exclude_field_filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
81
|
+
custom_field_id: z.ZodNumber;
|
|
82
|
+
operator: z.ZodEnum<{
|
|
83
|
+
any_of: "any_of";
|
|
84
|
+
none_of: "none_of";
|
|
85
|
+
contains: "contains";
|
|
86
|
+
not_contains: "not_contains";
|
|
87
|
+
starts_with: "starts_with";
|
|
88
|
+
ends_with: "ends_with";
|
|
89
|
+
is_set: "is_set";
|
|
90
|
+
is_empty: "is_empty";
|
|
91
|
+
gt: "gt";
|
|
92
|
+
gte: "gte";
|
|
93
|
+
lt: "lt";
|
|
94
|
+
lte: "lte";
|
|
95
|
+
between: "between";
|
|
96
|
+
}>;
|
|
97
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
exclude_field_filter_match: z.ZodOptional<z.ZodEnum<{
|
|
100
|
+
all: "all";
|
|
101
|
+
any: "any";
|
|
102
|
+
}>>;
|
|
103
|
+
ab_test_config: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
enabled: z.ZodBoolean;
|
|
105
|
+
test_type: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
subject: "subject";
|
|
107
|
+
content: "content";
|
|
108
|
+
sender: "sender";
|
|
109
|
+
send_time: "send_time";
|
|
110
|
+
full: "full";
|
|
111
|
+
}>>;
|
|
112
|
+
winning_metric: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
open_rate: "open_rate";
|
|
114
|
+
click_rate: "click_rate";
|
|
115
|
+
conversion_rate: "conversion_rate";
|
|
116
|
+
}>>;
|
|
117
|
+
sample_percentage: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
test_duration_hours: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
auto_select_winner: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
confidence_threshold: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
122
|
+
variant_letter: z.ZodString;
|
|
123
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
124
|
+
preheader: z.ZodOptional<z.ZodString>;
|
|
125
|
+
is_control: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
}, z.core.$strip>>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
};
|
|
129
|
+
/** Compact, agent-oriented view of a campaign returned by the API. */
|
|
130
|
+
export declare function summarizeCampaign(c: Record<string, unknown>, contentChars?: number): {
|
|
131
|
+
id: unknown;
|
|
132
|
+
subject: unknown;
|
|
133
|
+
preheader: unknown;
|
|
134
|
+
channel: unknown;
|
|
135
|
+
type: unknown;
|
|
136
|
+
status: unknown;
|
|
137
|
+
is_active: unknown;
|
|
138
|
+
mailbox_id: unknown;
|
|
139
|
+
template_id: unknown;
|
|
140
|
+
day: unknown;
|
|
141
|
+
time_of_day: unknown;
|
|
142
|
+
timezone: unknown;
|
|
143
|
+
send_in_subscriber_timezone: unknown;
|
|
144
|
+
scheduled_at: unknown;
|
|
145
|
+
trigger_type: unknown;
|
|
146
|
+
trigger_config: unknown;
|
|
147
|
+
automation_rule: unknown;
|
|
148
|
+
contact_lists: {
|
|
149
|
+
id: number;
|
|
150
|
+
name: string;
|
|
151
|
+
}[];
|
|
152
|
+
excluded_lists: {
|
|
153
|
+
id: number;
|
|
154
|
+
name: string;
|
|
155
|
+
}[];
|
|
156
|
+
crm_contact_ids: unknown;
|
|
157
|
+
excluded_crm_contact_ids: unknown;
|
|
158
|
+
field_filters: unknown;
|
|
159
|
+
include_field_filter_match: unknown;
|
|
160
|
+
exclude_field_filter_match: unknown;
|
|
161
|
+
tag_ids: unknown;
|
|
162
|
+
translations: {
|
|
163
|
+
language: unknown;
|
|
164
|
+
subject: unknown;
|
|
165
|
+
preheader: unknown;
|
|
166
|
+
}[];
|
|
167
|
+
tracked_links: unknown;
|
|
168
|
+
ab_test_config: unknown;
|
|
169
|
+
sent_count: unknown;
|
|
170
|
+
planned_recipients: unknown;
|
|
171
|
+
content_length: number;
|
|
172
|
+
content: string;
|
|
173
|
+
};
|
|
174
|
+
export declare function registerCampaignExtraTools(server: McpServer, api: NetSendoApiClient): void;
|
|
175
|
+
//# sourceMappingURL=campaign-extras.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-extras.d.ts","sourceRoot":"","sources":["../../src/tools/campaign-extras.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAK1D,eAAO,MAAM,aAAa,oJAUhB,CAAC;AAgBX;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoG/B,CAAC;AAEF,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,SAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC/E;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,QAqJnF"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Campaign editor extras
|
|
3
|
+
*
|
|
4
|
+
* The editor fields shared by create_campaign / update_campaign (trigger,
|
|
5
|
+
* tags, translations, tracked links, CRM contacts, audience field filters,
|
|
6
|
+
* A/B config) and the campaign actions: test send, preview, duplicate,
|
|
7
|
+
* activation, recipient count, re-sending failed / missed recipients.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { ok, fail, compact } from './helpers.js';
|
|
11
|
+
export const TRIGGER_TYPES = [
|
|
12
|
+
'signup',
|
|
13
|
+
'anniversary',
|
|
14
|
+
'birthday',
|
|
15
|
+
'inactivity',
|
|
16
|
+
'page_visit',
|
|
17
|
+
'custom',
|
|
18
|
+
'recent_subscribers',
|
|
19
|
+
'opened_message',
|
|
20
|
+
'not_opened_message',
|
|
21
|
+
];
|
|
22
|
+
const FIELD_FILTER_OPERATORS = [
|
|
23
|
+
'any_of', 'none_of', 'contains', 'not_contains', 'starts_with', 'ends_with',
|
|
24
|
+
'is_set', 'is_empty', 'gt', 'gte', 'lt', 'lte', 'between',
|
|
25
|
+
];
|
|
26
|
+
const fieldFilter = z.object({
|
|
27
|
+
custom_field_id: z.number().describe('Custom field ID (list_custom_fields)'),
|
|
28
|
+
operator: z.enum(FIELD_FILTER_OPERATORS),
|
|
29
|
+
values: z
|
|
30
|
+
.array(z.string())
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Values to compare with; omit for is_set/is_empty; two values for between'),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Optional editor fields accepted by POST/PUT /messages. Every key is
|
|
36
|
+
* optional; on update an omitted key leaves the stored value untouched and an
|
|
37
|
+
* empty array clears it.
|
|
38
|
+
*/
|
|
39
|
+
export const campaignEditorShape = {
|
|
40
|
+
template_id: z
|
|
41
|
+
.number()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Template ID (list_templates) — your own or a public system template. It is only a REFERENCE: sending always uses the campaign\'s own `content`. To build from a template, call get_template and copy its `html` into `content` (then edit it).'),
|
|
44
|
+
send_in_subscriber_timezone: z
|
|
45
|
+
.boolean()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Send at time_of_day in each subscriber\'s own timezone instead of the campaign timezone'),
|
|
48
|
+
trigger_type: z
|
|
49
|
+
.enum(TRIGGER_TYPES)
|
|
50
|
+
.nullable()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe(`Optional trigger (mostly for autoresponders). Saving it creates/updates an automation rule "Auto: <subject>" that sends this message; null removes the trigger and its rule. The rule is active only while the message is scheduled/active.
|
|
53
|
+
- signup: when someone joins the list (trigger_config.list_id, defaults to the first recipient list)
|
|
54
|
+
- anniversary: yearly on the subscription date
|
|
55
|
+
- birthday: on the subscriber's birthday field
|
|
56
|
+
- inactivity: after trigger_config.inactive_days without activity (7/14/30/60/90)
|
|
57
|
+
- page_visit: when a tracked page matching trigger_config.url_pattern is visited
|
|
58
|
+
- custom: when the tag trigger_config.tag_id is added
|
|
59
|
+
- recent_subscribers: audience filter — only people who joined in the last trigger_config.recent_days days
|
|
60
|
+
- opened_message / not_opened_message: audience filter — only people who did / did not open trigger_config.message_id`),
|
|
61
|
+
trigger_config: z
|
|
62
|
+
.object({
|
|
63
|
+
list_id: z.number().optional(),
|
|
64
|
+
message_id: z.number().optional().describe('For opened_message / not_opened_message: a sent campaign ID'),
|
|
65
|
+
tag_id: z.number().optional().describe('For custom (list_tags)'),
|
|
66
|
+
inactive_days: z.number().optional().describe('For inactivity'),
|
|
67
|
+
recent_days: z.number().optional().describe('For recent_subscribers'),
|
|
68
|
+
url_pattern: z.string().optional().describe('For page_visit, e.g. "/pricing*"'),
|
|
69
|
+
})
|
|
70
|
+
.nullable()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Settings for trigger_type (see trigger_type). All referenced IDs must belong to this account.'),
|
|
73
|
+
tag_ids: z
|
|
74
|
+
.array(z.number())
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('Campaign tags for reporting (list_tags). Replaces the current set.'),
|
|
77
|
+
translations: z
|
|
78
|
+
.array(z.object({
|
|
79
|
+
language: z.string().max(5).describe('Language code, e.g. "en", "de"'),
|
|
80
|
+
subject: z.string(),
|
|
81
|
+
preheader: z.string().optional(),
|
|
82
|
+
content: z.string().optional().describe('HTML for this language; omit to reuse the main content'),
|
|
83
|
+
}))
|
|
84
|
+
.optional()
|
|
85
|
+
.describe('Multi-language versions (subscriber language picks one). Replaces all translations; [] removes them.'),
|
|
86
|
+
tracked_links: z
|
|
87
|
+
.array(z.object({
|
|
88
|
+
url: z.string().describe('Exact link URL as it appears in the content'),
|
|
89
|
+
tracking_enabled: z.boolean().optional().describe('Default true'),
|
|
90
|
+
share_data_enabled: z.boolean().optional().describe('Append subscriber data to the URL'),
|
|
91
|
+
shared_fields: z.array(z.string()).optional().describe('Fields to append, e.g. ["email","first_name"]'),
|
|
92
|
+
subscribe_to_list_ids: z.array(z.number()).optional().describe('Add the clicker to these lists'),
|
|
93
|
+
unsubscribe_from_list_ids: z.array(z.number()).optional().describe('Remove the clicker from these lists'),
|
|
94
|
+
}))
|
|
95
|
+
.optional()
|
|
96
|
+
.describe('Per-link click settings. Replaces the whole set: links not listed lose their settings.'),
|
|
97
|
+
crm_contact_ids: z.array(z.number()).optional().describe('Individual CRM contacts to include besides the lists'),
|
|
98
|
+
excluded_crm_contact_ids: z.array(z.number()).optional().describe('CRM contacts to exclude'),
|
|
99
|
+
include_field_filters: z
|
|
100
|
+
.array(fieldFilter)
|
|
101
|
+
.optional()
|
|
102
|
+
.describe('Audience narrowing by custom field: only list members matching these are sent to. [] clears.'),
|
|
103
|
+
include_field_filter_match: z.enum(['all', 'any']).optional().describe('Combine include filters with AND (all) or OR (any)'),
|
|
104
|
+
exclude_field_filters: z
|
|
105
|
+
.array(fieldFilter)
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Drop subscribers matching these (combined with excluded lists: only matching members of those lists are dropped). [] clears.'),
|
|
108
|
+
exclude_field_filter_match: z.enum(['all', 'any']).optional(),
|
|
109
|
+
ab_test_config: z
|
|
110
|
+
.object({
|
|
111
|
+
enabled: z.boolean(),
|
|
112
|
+
test_type: z.enum(['subject', 'content', 'sender', 'send_time', 'full']).optional(),
|
|
113
|
+
winning_metric: z.enum(['open_rate', 'click_rate', 'conversion_rate']).optional(),
|
|
114
|
+
sample_percentage: z.number().min(5).max(50).optional(),
|
|
115
|
+
test_duration_hours: z.number().min(1).max(72).optional(),
|
|
116
|
+
auto_select_winner: z.boolean().optional(),
|
|
117
|
+
confidence_threshold: z.number().min(60).max(99).optional(),
|
|
118
|
+
variants: z
|
|
119
|
+
.array(z.object({
|
|
120
|
+
variant_letter: z.string().max(1).describe('"A", "B", ...'),
|
|
121
|
+
subject: z.string().optional(),
|
|
122
|
+
preheader: z.string().optional(),
|
|
123
|
+
is_control: z.boolean().optional().describe('Control uses the campaign subject/preheader'),
|
|
124
|
+
}))
|
|
125
|
+
.optional(),
|
|
126
|
+
})
|
|
127
|
+
.optional()
|
|
128
|
+
.describe('Inline A/B subject test (needs enabled=true and at least 2 variants; enabled=false removes a draft test). For full control use the *_ab_test tools.'),
|
|
129
|
+
};
|
|
130
|
+
/** Compact, agent-oriented view of a campaign returned by the API. */
|
|
131
|
+
export function summarizeCampaign(c, contentChars = 500) {
|
|
132
|
+
const content = typeof c.content === 'string' ? c.content : '';
|
|
133
|
+
const lists = c.contact_lists ?? [];
|
|
134
|
+
const excluded = c.excluded_lists ?? [];
|
|
135
|
+
const translations = c.translations ?? [];
|
|
136
|
+
return {
|
|
137
|
+
id: c.id,
|
|
138
|
+
subject: c.subject,
|
|
139
|
+
preheader: c.preheader,
|
|
140
|
+
channel: c.channel,
|
|
141
|
+
type: c.type,
|
|
142
|
+
status: c.status,
|
|
143
|
+
is_active: c.is_active,
|
|
144
|
+
mailbox_id: c.mailbox_id,
|
|
145
|
+
template_id: c.template_id,
|
|
146
|
+
day: c.day,
|
|
147
|
+
time_of_day: c.time_of_day,
|
|
148
|
+
timezone: c.timezone,
|
|
149
|
+
send_in_subscriber_timezone: c.send_in_subscriber_timezone,
|
|
150
|
+
scheduled_at: c.scheduled_at,
|
|
151
|
+
trigger_type: c.trigger_type,
|
|
152
|
+
trigger_config: c.trigger_config,
|
|
153
|
+
automation_rule: c.automation_rule,
|
|
154
|
+
contact_lists: lists.map((l) => ({ id: l.id, name: l.name })),
|
|
155
|
+
excluded_lists: excluded.map((l) => ({ id: l.id, name: l.name })),
|
|
156
|
+
crm_contact_ids: c.crm_contact_ids,
|
|
157
|
+
excluded_crm_contact_ids: c.excluded_crm_contact_ids,
|
|
158
|
+
field_filters: c.field_filters,
|
|
159
|
+
include_field_filter_match: c.include_field_filter_match,
|
|
160
|
+
exclude_field_filter_match: c.exclude_field_filter_match,
|
|
161
|
+
tag_ids: c.tag_ids,
|
|
162
|
+
translations: translations.map((t) => ({ language: t.language, subject: t.subject, preheader: t.preheader })),
|
|
163
|
+
tracked_links: c.tracked_links,
|
|
164
|
+
ab_test_config: c.ab_test_config,
|
|
165
|
+
sent_count: c.sent_count,
|
|
166
|
+
planned_recipients: c.planned_recipients_count,
|
|
167
|
+
content_length: content.length,
|
|
168
|
+
content: contentChars > 0 && content.length > contentChars ? `${content.substring(0, contentChars)}...` : content,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export function registerCampaignExtraTools(server, api) {
|
|
172
|
+
server.tool('send_campaign_test', `Send a TEST email of a campaign to up to 5 addresses (subject gets a "[TEST] " prefix). Nothing is queued and stats are not affected.
|
|
173
|
+
|
|
174
|
+
Placeholders ([[first_name]], [[email]], ...) are filled from: subscriber_id if given, else the subscriber with the test address, else the first subscriber on the campaign's lists, else sample data (Jan Kowalski). Uses the campaign's mailbox (or its list/user default) unless mailbox_id is given. Email campaigns only. Needs messages:write.`, {
|
|
175
|
+
campaign_id: z.number().describe('Campaign ID'),
|
|
176
|
+
emails: z.array(z.string().email()).min(1).max(5).describe('Recipient addresses for the test'),
|
|
177
|
+
subscriber_id: z.number().optional().describe('Personalise with this subscriber\'s data'),
|
|
178
|
+
mailbox_id: z.number().optional().describe('Send through this mailbox instead (list_mailboxes)'),
|
|
179
|
+
language: z.string().optional().describe('Send this translation (e.g. "en") instead of the main version'),
|
|
180
|
+
}, async ({ campaign_id, ...body }) => {
|
|
181
|
+
try {
|
|
182
|
+
const res = await api.request('post', `/messages/${campaign_id}/test`, { data: compact(body) });
|
|
183
|
+
return ok({ success: true, message: res.message, ...res.data });
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
return fail(error);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
server.tool('preview_campaign', `Render a campaign exactly as a recipient sees it: subject and full HTML with placeholders resolved and the preheader injected. Read-only (messages:read).
|
|
190
|
+
|
|
191
|
+
Personalised with subscriber_id / subscriber_email if given (must be on this account), else the first subscriber on the campaign's lists, else sample data. The result lists unresolved_placeholders (unknown [[tags]]) — fix those before sending. Use language to preview a translation.`, {
|
|
192
|
+
campaign_id: z.number().describe('Campaign ID'),
|
|
193
|
+
subscriber_id: z.number().optional(),
|
|
194
|
+
subscriber_email: z.string().email().optional(),
|
|
195
|
+
language: z.string().optional().describe('Preview this translation, e.g. "en"'),
|
|
196
|
+
max_html_chars: z
|
|
197
|
+
.number()
|
|
198
|
+
.optional()
|
|
199
|
+
.describe('Truncate the returned HTML to this many characters (default 20000, 0 = no limit)'),
|
|
200
|
+
}, async ({ campaign_id, max_html_chars, ...params }) => {
|
|
201
|
+
try {
|
|
202
|
+
const res = await api.request('post', `/messages/${campaign_id}/preview`, { data: compact(params) });
|
|
203
|
+
const limit = max_html_chars ?? 20000;
|
|
204
|
+
const html = res.data.html ?? '';
|
|
205
|
+
return ok({
|
|
206
|
+
...res.data,
|
|
207
|
+
html_length: html.length,
|
|
208
|
+
html: limit > 0 && html.length > limit ? `${html.substring(0, limit)}... [truncated]` : html,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
return fail(error);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
server.tool('duplicate_campaign', 'Copy a campaign as a new DRAFT (subject "[KOPIA] <subject>" unless you pass one). Lists, exclusions, field filters, tracked links, translations, trigger settings and content are copied; sending state and stats are not. Edit the copy with update_campaign.', {
|
|
216
|
+
campaign_id: z.number().describe('Campaign ID to copy'),
|
|
217
|
+
subject: z.string().optional().describe('Subject for the copy'),
|
|
218
|
+
}, async ({ campaign_id, subject }) => {
|
|
219
|
+
try {
|
|
220
|
+
const res = await api.request('post', `/messages/${campaign_id}/duplicate`, {
|
|
221
|
+
data: compact({ subject }),
|
|
222
|
+
});
|
|
223
|
+
return ok({ success: true, message: res.message, campaign: summarizeCampaign(res.data, 0) });
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
return fail(error);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
server.tool('set_campaign_active', `Activate or pause an AUTORESPONDER (queue message). Activating a draft promotes it to "scheduled" so new subscribers get it after its day offset, schedules the current subscribers whose send time is still ahead, and enables its trigger rule. Deactivating stops further sends. Omit is_active to toggle. Broadcasts are rejected — use send_campaign / schedule_campaign.`, {
|
|
230
|
+
campaign_id: z.number().describe('Autoresponder campaign ID'),
|
|
231
|
+
is_active: z.boolean().optional().describe('true = activate, false = pause; omit to toggle'),
|
|
232
|
+
}, async ({ campaign_id, is_active }) => {
|
|
233
|
+
try {
|
|
234
|
+
const res = await api.request('post', `/messages/${campaign_id}/toggle-active`, {
|
|
235
|
+
data: compact({ is_active }),
|
|
236
|
+
});
|
|
237
|
+
return ok({ success: true, message: res.message, ...res.data, warnings: res.warnings });
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
return fail(error);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
server.tool('get_campaign_recipient_count', 'Count who a campaign would go to right now: its lists plus selected CRM contacts, minus exclusions, field filters and inactive/unsubscribed people (deduplicated by email). For autoresponders also skipped_count (subscribers who joined before its day offset and missed it) and the queue breakdown. Read-only.', {
|
|
244
|
+
campaign_id: z.number().describe('Campaign ID'),
|
|
245
|
+
}, async ({ campaign_id }) => {
|
|
246
|
+
try {
|
|
247
|
+
const res = await api.request('get', `/messages/${campaign_id}/recipients-count`);
|
|
248
|
+
return ok(res.data);
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
return fail(error);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
server.tool('resend_campaign_failed', 'Re-queue every recipient whose delivery of this campaign FAILED (e.g. provider quota hit). Real emails are sent: call once without confirm to see failed_count, ask the user, then repeat with confirm=true.', {
|
|
255
|
+
campaign_id: z.number().describe('Campaign ID'),
|
|
256
|
+
confirm: z.boolean().optional().describe('Must be true to actually re-queue'),
|
|
257
|
+
}, async ({ campaign_id, confirm }) => {
|
|
258
|
+
try {
|
|
259
|
+
const res = await api.request('post', `/messages/${campaign_id}/resend-failed`, {
|
|
260
|
+
data: compact({ confirm }),
|
|
261
|
+
});
|
|
262
|
+
return ok({ success: true, message: res.message, ...res.data });
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
return fail(error, 'Nothing was sent. Tell the user how many failed recipients would be re-sent and, once they approve, repeat with confirm=true.');
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
server.tool('send_campaign_to_missed', 'For an ACTIVE autoresponder: send it now to the subscribers who missed it (they were already on the list longer than its day offset when it was created/activated). Real emails are sent: call once without confirm to see missed_count, ask the user, then repeat with confirm=true.', {
|
|
269
|
+
campaign_id: z.number().describe('Autoresponder campaign ID'),
|
|
270
|
+
confirm: z.boolean().optional().describe('Must be true to actually send'),
|
|
271
|
+
}, async ({ campaign_id, confirm }) => {
|
|
272
|
+
try {
|
|
273
|
+
const res = await api.request('post', `/messages/${campaign_id}/send-to-missed`, {
|
|
274
|
+
data: compact({ confirm }),
|
|
275
|
+
});
|
|
276
|
+
return ok({ success: true, message: res.message, ...res.data });
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
return fail(error, 'Nothing was sent. Tell the user how many missed subscribers would receive it and, once they approve, repeat with confirm=true.');
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=campaign-extras.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-extras.js","sourceRoot":"","sources":["../../src/tools/campaign-extras.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,aAAa;IACb,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,QAAQ;IACR,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;CACZ,CAAC;AAEX,MAAM,sBAAsB,GAAG;IAC7B,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW;IAC3E,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS;CACjD,CAA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AAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAAc,MAAM,EAAE,aAAa,WAAW,iBAAiB,EAAE;gBAC5F,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;aAC3B,CAAC,CAAC;YACH,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,EAAE,gIAAgI,CAAC,CAAC;QACvJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaigns.d.ts","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"campaigns.d.ts","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,iBAAiB,QA4tBvB"}
|