@qikdev/mcp 6.6.47 → 6.7.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/build/src/tools/campaign.d.ts +41 -0
- package/build/src/tools/campaign.d.ts.map +1 -0
- package/build/src/tools/campaign.js +331 -0
- package/build/src/tools/campaign.js.map +1 -0
- package/build/src/tools/checkin.d.ts +25 -0
- package/build/src/tools/checkin.d.ts.map +1 -0
- package/build/src/tools/checkin.js +199 -0
- package/build/src/tools/checkin.js.map +1 -0
- package/build/src/tools/create.d.ts.map +1 -1
- package/build/src/tools/create.js +225 -24
- package/build/src/tools/create.js.map +1 -1
- package/build/src/tools/definition.d.ts +90 -0
- package/build/src/tools/definition.d.ts.map +1 -0
- package/build/src/tools/definition.js +803 -0
- package/build/src/tools/definition.js.map +1 -0
- package/build/src/tools/filters.d.ts +11 -0
- package/build/src/tools/filters.d.ts.map +1 -0
- package/build/src/tools/filters.js +146 -0
- package/build/src/tools/filters.js.map +1 -0
- package/build/src/tools/glossary.d.ts +9 -0
- package/build/src/tools/glossary.d.ts.map +1 -1
- package/build/src/tools/glossary.js +200 -23
- package/build/src/tools/glossary.js.map +1 -1
- package/build/src/tools/index.d.ts.map +1 -1
- package/build/src/tools/index.js +56 -18
- package/build/src/tools/index.js.map +1 -1
- package/build/src/tools/list.d.ts.map +1 -1
- package/build/src/tools/list.js +41 -1
- package/build/src/tools/list.js.map +1 -1
- package/build/src/tools/relationships.d.ts +11 -0
- package/build/src/tools/relationships.d.ts.map +1 -0
- package/build/src/tools/relationships.js +130 -0
- package/build/src/tools/relationships.js.map +1 -0
- package/build/src/tools/reporting.d.ts +22 -0
- package/build/src/tools/reporting.d.ts.map +1 -0
- package/build/src/tools/reporting.js +219 -0
- package/build/src/tools/reporting.js.map +1 -0
- package/build/src/tools/sms.d.ts +13 -0
- package/build/src/tools/sms.d.ts.map +1 -0
- package/build/src/tools/sms.js +128 -0
- package/build/src/tools/sms.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export declare const getCampaignRecipientsTool: Tool;
|
|
3
|
+
export declare const getCampaignAnalyticsTool: Tool;
|
|
4
|
+
export declare const sendCampaignTool: Tool;
|
|
5
|
+
export declare const sendTestCampaignTool: Tool;
|
|
6
|
+
export declare function handleGetCampaignRecipients(args: {
|
|
7
|
+
campaignId: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
content: Array<{
|
|
10
|
+
type: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function handleGetCampaignAnalytics(args: {
|
|
15
|
+
campaignId: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
content: Array<{
|
|
18
|
+
type: string;
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function handleSendCampaign(args: {
|
|
23
|
+
campaignId: string;
|
|
24
|
+
scheduleDate?: string;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
content: Array<{
|
|
27
|
+
type: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}>;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function handleSendTestCampaign(args: {
|
|
32
|
+
campaignId: string;
|
|
33
|
+
profileIds?: string[];
|
|
34
|
+
emails?: string[];
|
|
35
|
+
}): Promise<{
|
|
36
|
+
content: Array<{
|
|
37
|
+
type: string;
|
|
38
|
+
text: string;
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=campaign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.d.ts","sourceRoot":"","sources":["../../../src/tools/campaign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI1D,eAAO,MAAM,yBAAyB,EAAE,IAmBvC,CAAC;AAGF,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ewing campaign recipients
|
|
3
|
+
export const getCampaignRecipientsTool = {
|
|
4
|
+
name: "get_campaign_recipients",
|
|
5
|
+
description: `Preview who would receive a campaign before sending.
|
|
6
|
+
|
|
7
|
+
Returns profiles that match the campaign's targeting criteria:
|
|
8
|
+
- **valid**: Profiles with email addresses who will receive the campaign
|
|
9
|
+
- **invalid**: Profiles without email or who already received it
|
|
10
|
+
|
|
11
|
+
Use this before publishing to verify targeting is correct.`,
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
campaignId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "The campaign ID to preview recipients for"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: ["campaignId"]
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
// Tool for getting campaign analytics
|
|
24
|
+
export const getCampaignAnalyticsTool = {
|
|
25
|
+
name: "get_campaign_analytics",
|
|
26
|
+
description: `Get email campaign performance metrics.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
- **total**: Number of emails sent
|
|
30
|
+
- **opened**: Number of emails opened (tracked via read receipts)
|
|
31
|
+
- **clicked**: Number of emails with link clicks
|
|
32
|
+
|
|
33
|
+
Use this to measure campaign effectiveness after sending.`,
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
campaignId: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "The campaign ID to get analytics for"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
required: ["campaignId"]
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
// Tool for publishing/sending a campaign
|
|
46
|
+
export const sendCampaignTool = {
|
|
47
|
+
name: "send_campaign",
|
|
48
|
+
description: `Publish and send an email campaign to its recipients.
|
|
49
|
+
|
|
50
|
+
Campaign must be in 'draft' state with valid recipients.
|
|
51
|
+
Can schedule for later or send immediately.
|
|
52
|
+
|
|
53
|
+
**States:** draft → scheduled/processing → sent
|
|
54
|
+
|
|
55
|
+
**IMPORTANT:** This will send real emails. Use get_campaign_recipients first to verify targeting.`,
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
campaignId: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "The campaign ID to publish"
|
|
62
|
+
},
|
|
63
|
+
scheduleDate: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "ISO date string to schedule sending (optional - sends immediately if omitted)"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
required: ["campaignId"]
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
// Tool for sending test emails
|
|
72
|
+
export const sendTestCampaignTool = {
|
|
73
|
+
name: "send_test_campaign",
|
|
74
|
+
description: `Send test email(s) from a campaign to specific recipients.
|
|
75
|
+
|
|
76
|
+
Test emails have [TEST] prefix in subject line.
|
|
77
|
+
Use this to preview how the email looks before publishing to all recipients.
|
|
78
|
+
|
|
79
|
+
Provide either profile IDs or raw email addresses.`,
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
campaignId: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "The campaign ID to send test from"
|
|
86
|
+
},
|
|
87
|
+
profileIds: {
|
|
88
|
+
type: "array",
|
|
89
|
+
items: { type: "string" },
|
|
90
|
+
description: "Profile IDs to send test email to"
|
|
91
|
+
},
|
|
92
|
+
emails: {
|
|
93
|
+
type: "array",
|
|
94
|
+
items: { type: "string" },
|
|
95
|
+
description: "Raw email addresses to send test to"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
required: ["campaignId"]
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
// Handler for get_campaign_recipients
|
|
102
|
+
export async function handleGetCampaignRecipients(args) {
|
|
103
|
+
try {
|
|
104
|
+
const configManager = new ConfigManager();
|
|
105
|
+
const config = await configManager.loadConfig();
|
|
106
|
+
if (!config) {
|
|
107
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
108
|
+
}
|
|
109
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/campaign/${args.campaignId}/preflight`, {
|
|
110
|
+
headers: {
|
|
111
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
112
|
+
'Content-Type': 'application/json',
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
const errorText = await response.text();
|
|
117
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
118
|
+
}
|
|
119
|
+
const data = await response.json();
|
|
120
|
+
const { recipients } = data;
|
|
121
|
+
let resultText = `# Campaign Recipients Preview\n\n`;
|
|
122
|
+
resultText += `## Summary\n`;
|
|
123
|
+
resultText += `- **Valid recipients**: ${recipients.valid.total}\n`;
|
|
124
|
+
resultText += `- **Invalid recipients**: ${recipients.invalid.total}\n\n`;
|
|
125
|
+
if (recipients.valid.total > 0) {
|
|
126
|
+
resultText += `## Valid Recipients (first 10)\n\n`;
|
|
127
|
+
const validSample = recipients.valid.profiles.slice(0, 10);
|
|
128
|
+
for (const profile of validSample) {
|
|
129
|
+
const name = [profile.firstName, profile.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
130
|
+
const email = profile.emails?.[0] || 'No email';
|
|
131
|
+
resultText += `- ${name} (${email})\n`;
|
|
132
|
+
}
|
|
133
|
+
if (recipients.valid.total > 10) {
|
|
134
|
+
resultText += `- ... and ${recipients.valid.total - 10} more\n`;
|
|
135
|
+
}
|
|
136
|
+
resultText += '\n';
|
|
137
|
+
}
|
|
138
|
+
if (recipients.invalid.total > 0) {
|
|
139
|
+
resultText += `## Invalid Recipients (first 10)\n\n`;
|
|
140
|
+
const invalidSample = recipients.invalid.profiles.slice(0, 10);
|
|
141
|
+
for (const item of invalidSample) {
|
|
142
|
+
const profile = item.profile;
|
|
143
|
+
const name = [profile.firstName, profile.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
144
|
+
resultText += `- ${name}: ${item.message}\n`;
|
|
145
|
+
}
|
|
146
|
+
if (recipients.invalid.total > 10) {
|
|
147
|
+
resultText += `- ... and ${recipients.invalid.total - 10} more\n`;
|
|
148
|
+
}
|
|
149
|
+
resultText += '\n';
|
|
150
|
+
}
|
|
151
|
+
resultText += `---\n`;
|
|
152
|
+
resultText += `💡 Use \`send_campaign\` to publish, or \`send_test_campaign\` to preview first.`;
|
|
153
|
+
return {
|
|
154
|
+
content: [{
|
|
155
|
+
type: "text",
|
|
156
|
+
text: resultText
|
|
157
|
+
}]
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
return {
|
|
162
|
+
content: [{
|
|
163
|
+
type: "text",
|
|
164
|
+
text: `❌ Failed to get campaign recipients: ${error.message}`
|
|
165
|
+
}]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Handler for get_campaign_analytics
|
|
170
|
+
export async function handleGetCampaignAnalytics(args) {
|
|
171
|
+
try {
|
|
172
|
+
const configManager = new ConfigManager();
|
|
173
|
+
const config = await configManager.loadConfig();
|
|
174
|
+
if (!config) {
|
|
175
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
176
|
+
}
|
|
177
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/campaign/${args.campaignId}/analytics`, {
|
|
178
|
+
headers: {
|
|
179
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
180
|
+
'Content-Type': 'application/json',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
if (!response.ok) {
|
|
184
|
+
const errorText = await response.text();
|
|
185
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
186
|
+
}
|
|
187
|
+
const data = await response.json();
|
|
188
|
+
const { total, opened, clicked } = data;
|
|
189
|
+
const openRate = total > 0 ? ((opened / total) * 100).toFixed(1) : '0';
|
|
190
|
+
const clickRate = total > 0 ? ((clicked / total) * 100).toFixed(1) : '0';
|
|
191
|
+
let resultText = `# Campaign Analytics\n\n`;
|
|
192
|
+
resultText += `## Metrics\n`;
|
|
193
|
+
resultText += `- **Total sent**: ${total}\n`;
|
|
194
|
+
resultText += `- **Opened**: ${opened} (${openRate}%)\n`;
|
|
195
|
+
resultText += `- **Clicked**: ${clicked} (${clickRate}%)\n\n`;
|
|
196
|
+
if (total === 0) {
|
|
197
|
+
resultText += `⚠️ No emails have been sent yet. Campaign may still be in draft state.`;
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
content: [{
|
|
201
|
+
type: "text",
|
|
202
|
+
text: resultText
|
|
203
|
+
}]
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
return {
|
|
208
|
+
content: [{
|
|
209
|
+
type: "text",
|
|
210
|
+
text: `❌ Failed to get campaign analytics: ${error.message}`
|
|
211
|
+
}]
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// Handler for send_campaign
|
|
216
|
+
export async function handleSendCampaign(args) {
|
|
217
|
+
try {
|
|
218
|
+
const configManager = new ConfigManager();
|
|
219
|
+
const config = await configManager.loadConfig();
|
|
220
|
+
if (!config) {
|
|
221
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
222
|
+
}
|
|
223
|
+
const body = {};
|
|
224
|
+
if (args.scheduleDate) {
|
|
225
|
+
body.date = args.scheduleDate;
|
|
226
|
+
}
|
|
227
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/campaign/${args.campaignId}/publish`, {
|
|
228
|
+
method: 'POST',
|
|
229
|
+
headers: {
|
|
230
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
231
|
+
'Content-Type': 'application/json',
|
|
232
|
+
},
|
|
233
|
+
body: JSON.stringify(body)
|
|
234
|
+
});
|
|
235
|
+
if (!response.ok) {
|
|
236
|
+
const errorText = await response.text();
|
|
237
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
238
|
+
}
|
|
239
|
+
const campaign = await response.json();
|
|
240
|
+
let resultText = `# Campaign Published\n\n`;
|
|
241
|
+
resultText += `✅ Campaign "${campaign.title}" has been ${args.scheduleDate ? 'scheduled' : 'published'}.\n\n`;
|
|
242
|
+
resultText += `- **ID**: ${campaign._id}\n`;
|
|
243
|
+
resultText += `- **Status**: ${campaign.state || 'processing'}\n`;
|
|
244
|
+
if (args.scheduleDate) {
|
|
245
|
+
resultText += `- **Scheduled for**: ${args.scheduleDate}\n`;
|
|
246
|
+
}
|
|
247
|
+
resultText += `\n💡 Use \`get_campaign_analytics\` to track performance.`;
|
|
248
|
+
return {
|
|
249
|
+
content: [{
|
|
250
|
+
type: "text",
|
|
251
|
+
text: resultText
|
|
252
|
+
}]
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
return {
|
|
257
|
+
content: [{
|
|
258
|
+
type: "text",
|
|
259
|
+
text: `❌ Failed to publish campaign: ${error.message}`
|
|
260
|
+
}]
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Handler for send_test_campaign
|
|
265
|
+
export async function handleSendTestCampaign(args) {
|
|
266
|
+
try {
|
|
267
|
+
const configManager = new ConfigManager();
|
|
268
|
+
const config = await configManager.loadConfig();
|
|
269
|
+
if (!config) {
|
|
270
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
271
|
+
}
|
|
272
|
+
if (!args.profileIds?.length && !args.emails?.length) {
|
|
273
|
+
return {
|
|
274
|
+
content: [{
|
|
275
|
+
type: "text",
|
|
276
|
+
text: `❌ Please provide either profileIds or emails to send test to.`
|
|
277
|
+
}]
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const body = {};
|
|
281
|
+
if (args.profileIds?.length) {
|
|
282
|
+
body.ids = args.profileIds;
|
|
283
|
+
}
|
|
284
|
+
if (args.emails?.length) {
|
|
285
|
+
body.emails = args.emails;
|
|
286
|
+
}
|
|
287
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/campaign/${args.campaignId}/test`, {
|
|
288
|
+
method: 'POST',
|
|
289
|
+
headers: {
|
|
290
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
291
|
+
'Content-Type': 'application/json',
|
|
292
|
+
},
|
|
293
|
+
body: JSON.stringify(body)
|
|
294
|
+
});
|
|
295
|
+
if (!response.ok) {
|
|
296
|
+
const errorText = await response.text();
|
|
297
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
298
|
+
}
|
|
299
|
+
const result = await response.json();
|
|
300
|
+
let resultText = `# Test Email Sent\n\n`;
|
|
301
|
+
resultText += `✅ Test email(s) sent successfully.\n\n`;
|
|
302
|
+
if (args.emails?.length) {
|
|
303
|
+
resultText += `**Sent to emails:**\n`;
|
|
304
|
+
for (const email of args.emails) {
|
|
305
|
+
resultText += `- ${email}\n`;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (args.profileIds?.length) {
|
|
309
|
+
resultText += `**Sent to profile IDs:**\n`;
|
|
310
|
+
for (const id of args.profileIds) {
|
|
311
|
+
resultText += `- ${id}\n`;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
resultText += `\n💡 Check your inbox. Test emails have [TEST] prefix in subject.`;
|
|
315
|
+
return {
|
|
316
|
+
content: [{
|
|
317
|
+
type: "text",
|
|
318
|
+
text: resultText
|
|
319
|
+
}]
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
return {
|
|
324
|
+
content: [{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: `❌ Failed to send test campaign: ${error.message}`
|
|
327
|
+
}]
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.js","sourceRoot":"","sources":["../../../src/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AI,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;YAC5B,UAAU,IAAI,4BAA4B,CAAC;YAC3C,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjC,UAAU,IAAI,KAAK,EAAE,IAAI,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,UAAU,IAAI,mEAAmE,CAAC;QAElF,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU;iBACjB,CAAC;SACH,CAAC;IAEJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,mCAAmC,KAAK,CAAC,OAAO,EAAE;iBACzD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export declare const createCheckinTool: Tool;
|
|
3
|
+
export declare const checkoutTool: Tool;
|
|
4
|
+
export declare function handleCreateCheckin(args: {
|
|
5
|
+
eventId: string;
|
|
6
|
+
profileIds: string[];
|
|
7
|
+
checkedInBy?: string;
|
|
8
|
+
absent?: boolean;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function handleCheckout(args: {
|
|
16
|
+
checkinIds: string[];
|
|
17
|
+
checkedOutBy?: string;
|
|
18
|
+
pin?: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
content: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=checkin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../../src/tools/checkin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,iBAAiB,EAAE,IAiC/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IA4B1B,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA+E9D;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA4E9D"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ConfigManager } from "../config.js";
|
|
2
|
+
export const createCheckinTool = {
|
|
3
|
+
name: "create_checkin",
|
|
4
|
+
description: `Check one or more profiles into an event.
|
|
5
|
+
|
|
6
|
+
Creates checkin records linking profiles to an event.
|
|
7
|
+
Automatically captures age, gender, and name at time of checkin.
|
|
8
|
+
|
|
9
|
+
**Use Case:** "Check in John Smith to tonight's event"
|
|
10
|
+
|
|
11
|
+
**Note:** If a profile is already checked in to the event, it won't create a duplicate.`,
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
eventId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "The event ID to check into"
|
|
18
|
+
},
|
|
19
|
+
profileIds: {
|
|
20
|
+
type: "array",
|
|
21
|
+
items: { type: "string" },
|
|
22
|
+
description: "Profile IDs to check in"
|
|
23
|
+
},
|
|
24
|
+
checkedInBy: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Profile ID of person doing the checkin (optional)"
|
|
27
|
+
},
|
|
28
|
+
absent: {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
description: "Mark as absent (expected but didn't attend) instead of present"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
required: ["eventId", "profileIds"]
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const checkoutTool = {
|
|
37
|
+
name: "checkout",
|
|
38
|
+
description: `Check out one or more checkins from an event.
|
|
39
|
+
|
|
40
|
+
Sets the checkin record to checked-out status with timestamp.
|
|
41
|
+
|
|
42
|
+
**Use Case:** "Check out the Smith family from the event"
|
|
43
|
+
|
|
44
|
+
Provide the checkin IDs (not profile IDs) to check out.`,
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
checkinIds: {
|
|
49
|
+
type: "array",
|
|
50
|
+
items: { type: "string" },
|
|
51
|
+
description: "Checkin record IDs to check out"
|
|
52
|
+
},
|
|
53
|
+
checkedOutBy: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Profile ID of person doing the checkout (optional)"
|
|
56
|
+
},
|
|
57
|
+
pin: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Security PIN if required by the checkin"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
required: ["checkinIds"]
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export async function handleCreateCheckin(args) {
|
|
66
|
+
try {
|
|
67
|
+
const configManager = new ConfigManager();
|
|
68
|
+
const config = await configManager.loadConfig();
|
|
69
|
+
if (!config) {
|
|
70
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
71
|
+
}
|
|
72
|
+
if (!args.profileIds?.length) {
|
|
73
|
+
return {
|
|
74
|
+
content: [{
|
|
75
|
+
type: "text",
|
|
76
|
+
text: `❌ No profile IDs provided. Please provide an array of profile IDs to check in.`
|
|
77
|
+
}]
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const requestBody = {
|
|
81
|
+
checkins: args.profileIds
|
|
82
|
+
};
|
|
83
|
+
if (args.checkedInBy) {
|
|
84
|
+
requestBody.checkedInBy = args.checkedInBy;
|
|
85
|
+
}
|
|
86
|
+
if (args.absent) {
|
|
87
|
+
requestBody.absent = true;
|
|
88
|
+
}
|
|
89
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/event/${args.eventId}/checkin`, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: {
|
|
92
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
93
|
+
'Content-Type': 'application/json',
|
|
94
|
+
},
|
|
95
|
+
body: JSON.stringify(requestBody)
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
const errorText = await response.text();
|
|
99
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
100
|
+
}
|
|
101
|
+
const result = await response.json();
|
|
102
|
+
const checkins = Array.isArray(result) ? result : [result];
|
|
103
|
+
let resultText = `# Checkin Result\n\n`;
|
|
104
|
+
resultText += `✅ Checked in ${checkins.length} profile(s) to event.\n\n`;
|
|
105
|
+
if (checkins.length > 0) {
|
|
106
|
+
resultText += `## Checkins Created\n`;
|
|
107
|
+
for (const checkin of checkins.slice(0, 10)) {
|
|
108
|
+
const name = [checkin.firstName, checkin.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
109
|
+
const status = args.absent ? '❌ Marked absent' : '✅ Checked in';
|
|
110
|
+
resultText += `- ${name} (ID: ${checkin._id}) ${status}\n`;
|
|
111
|
+
}
|
|
112
|
+
if (checkins.length > 10) {
|
|
113
|
+
resultText += `- ... and ${checkins.length - 10} more\n`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
resultText += `\n💡 Use \`get_event_attendance\` to see full attendance stats.`;
|
|
117
|
+
return {
|
|
118
|
+
content: [{
|
|
119
|
+
type: "text",
|
|
120
|
+
text: resultText
|
|
121
|
+
}]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
return {
|
|
126
|
+
content: [{
|
|
127
|
+
type: "text",
|
|
128
|
+
text: `❌ Failed to create checkin: ${error.message}`
|
|
129
|
+
}]
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export async function handleCheckout(args) {
|
|
134
|
+
try {
|
|
135
|
+
const configManager = new ConfigManager();
|
|
136
|
+
const config = await configManager.loadConfig();
|
|
137
|
+
if (!config) {
|
|
138
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
139
|
+
}
|
|
140
|
+
if (!args.checkinIds?.length) {
|
|
141
|
+
return {
|
|
142
|
+
content: [{
|
|
143
|
+
type: "text",
|
|
144
|
+
text: `❌ No checkin IDs provided. Please provide an array of checkin record IDs to check out.`
|
|
145
|
+
}]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const requestBody = {
|
|
149
|
+
checkins: args.checkinIds
|
|
150
|
+
};
|
|
151
|
+
if (args.checkedOutBy) {
|
|
152
|
+
requestBody.checkedOutBy = args.checkedOutBy;
|
|
153
|
+
}
|
|
154
|
+
if (args.pin) {
|
|
155
|
+
requestBody.pin = args.pin;
|
|
156
|
+
}
|
|
157
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/event/checkout`, {
|
|
158
|
+
method: 'POST',
|
|
159
|
+
headers: {
|
|
160
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
161
|
+
'Content-Type': 'application/json',
|
|
162
|
+
},
|
|
163
|
+
body: JSON.stringify(requestBody)
|
|
164
|
+
});
|
|
165
|
+
if (!response.ok) {
|
|
166
|
+
const errorText = await response.text();
|
|
167
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
168
|
+
}
|
|
169
|
+
const result = await response.json();
|
|
170
|
+
const checkedOut = Array.isArray(result) ? result : [result];
|
|
171
|
+
let resultText = `# Checkout Result\n\n`;
|
|
172
|
+
resultText += `✅ Checked out ${checkedOut.length} record(s).\n\n`;
|
|
173
|
+
if (checkedOut.length > 0) {
|
|
174
|
+
resultText += `## Checked Out\n`;
|
|
175
|
+
for (const checkin of checkedOut.slice(0, 10)) {
|
|
176
|
+
const name = [checkin.firstName, checkin.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
177
|
+
resultText += `- ${name} ↩️ Checked out\n`;
|
|
178
|
+
}
|
|
179
|
+
if (checkedOut.length > 10) {
|
|
180
|
+
resultText += `- ... and ${checkedOut.length - 10} more\n`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
content: [{
|
|
185
|
+
type: "text",
|
|
186
|
+
text: resultText
|
|
187
|
+
}]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
return {
|
|
192
|
+
content: [{
|
|
193
|
+
type: "text",
|
|
194
|
+
text: `❌ Failed to checkout: ${error.message}`
|
|
195
|
+
}]
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=checkin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../../src/tools/checkin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;wFAOyE;IACtF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAA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AAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/tools/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAc1D,eAAO,MAAM,iBAAiB,EAAE,IAkB/B,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAgHhH"}
|