@muhammadhamidraza/social-media-mcp-server 1.0.2 → 1.0.3
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 +132 -15
- package/dist/platforms/facebook.d.ts +14 -0
- package/dist/platforms/facebook.d.ts.map +1 -1
- package/dist/platforms/facebook.js +446 -0
- package/dist/platforms/facebook.js.map +1 -1
- package/dist/platforms/instagram.d.ts +12 -0
- package/dist/platforms/instagram.d.ts.map +1 -1
- package/dist/platforms/instagram.js +382 -0
- package/dist/platforms/instagram.js.map +1 -1
- package/dist/platforms/linkedin.d.ts +14 -0
- package/dist/platforms/linkedin.d.ts.map +1 -1
- package/dist/platforms/linkedin.js +552 -0
- package/dist/platforms/linkedin.js.map +1 -1
- package/dist/platforms/tiktok.d.ts +12 -0
- package/dist/platforms/tiktok.d.ts.map +1 -1
- package/dist/platforms/tiktok.js +441 -0
- package/dist/platforms/tiktok.js.map +1 -1
- package/dist/platforms/twitter.d.ts +12 -0
- package/dist/platforms/twitter.d.ts.map +1 -1
- package/dist/platforms/twitter.js +425 -0
- package/dist/platforms/twitter.js.map +1 -1
- package/dist/platforms/youtube.d.ts +17 -0
- package/dist/platforms/youtube.d.ts.map +1 -1
- package/dist/platforms/youtube.js +690 -2
- package/dist/platforms/youtube.js.map +1 -1
- package/package.json +1 -1
|
@@ -293,6 +293,263 @@ export class LinkedInPlatform {
|
|
|
293
293
|
},
|
|
294
294
|
required: ["recipientId", "message"]
|
|
295
295
|
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "linkedin_create_video_post",
|
|
299
|
+
description: "Post video content to LinkedIn",
|
|
300
|
+
inputSchema: {
|
|
301
|
+
type: "object",
|
|
302
|
+
properties: {
|
|
303
|
+
text: {
|
|
304
|
+
type: "string",
|
|
305
|
+
description: "Post commentary text"
|
|
306
|
+
},
|
|
307
|
+
videoUrl: {
|
|
308
|
+
type: "string",
|
|
309
|
+
description: "URL of the video file"
|
|
310
|
+
},
|
|
311
|
+
title: {
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Video title"
|
|
314
|
+
},
|
|
315
|
+
visibility: {
|
|
316
|
+
type: "string",
|
|
317
|
+
description: "Post visibility",
|
|
318
|
+
enum: ["PUBLIC", "CONNECTIONS"],
|
|
319
|
+
default: "PUBLIC"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
required: ["videoUrl"]
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "linkedin_schedule_post",
|
|
327
|
+
description: "Schedule a post for later publishing",
|
|
328
|
+
inputSchema: {
|
|
329
|
+
type: "object",
|
|
330
|
+
properties: {
|
|
331
|
+
text: {
|
|
332
|
+
type: "string",
|
|
333
|
+
description: "Post content text"
|
|
334
|
+
},
|
|
335
|
+
scheduledTime: {
|
|
336
|
+
type: "number",
|
|
337
|
+
description: "Unix timestamp for scheduled publishing"
|
|
338
|
+
},
|
|
339
|
+
visibility: {
|
|
340
|
+
type: "string",
|
|
341
|
+
description: "Post visibility",
|
|
342
|
+
enum: ["PUBLIC", "CONNECTIONS"],
|
|
343
|
+
default: "PUBLIC"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
required: ["text", "scheduledTime"]
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "linkedin_update_post",
|
|
351
|
+
description: "Update an existing post",
|
|
352
|
+
inputSchema: {
|
|
353
|
+
type: "object",
|
|
354
|
+
properties: {
|
|
355
|
+
postUrn: {
|
|
356
|
+
type: "string",
|
|
357
|
+
description: "LinkedIn post URN"
|
|
358
|
+
},
|
|
359
|
+
text: {
|
|
360
|
+
type: "string",
|
|
361
|
+
description: "New post text"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
required: ["postUrn", "text"]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: "linkedin_reply_comment",
|
|
369
|
+
description: "Reply to a comment",
|
|
370
|
+
inputSchema: {
|
|
371
|
+
type: "object",
|
|
372
|
+
properties: {
|
|
373
|
+
commentUrn: {
|
|
374
|
+
type: "string",
|
|
375
|
+
description: "Parent comment URN"
|
|
376
|
+
},
|
|
377
|
+
text: {
|
|
378
|
+
type: "string",
|
|
379
|
+
description: "Reply text"
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
required: ["commentUrn", "text"]
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "linkedin_delete_comment",
|
|
387
|
+
description: "Delete a comment",
|
|
388
|
+
inputSchema: {
|
|
389
|
+
type: "object",
|
|
390
|
+
properties: {
|
|
391
|
+
commentUrn: {
|
|
392
|
+
type: "string",
|
|
393
|
+
description: "Comment URN to delete"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
required: ["commentUrn"]
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: "linkedin_get_conversations",
|
|
401
|
+
description: "Get message conversations (requires partnership program)",
|
|
402
|
+
inputSchema: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
count: {
|
|
406
|
+
type: "number",
|
|
407
|
+
description: "Number of conversations (default: 10)",
|
|
408
|
+
default: 10
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "linkedin_get_messages",
|
|
415
|
+
description: "Get messages in a conversation (requires partnership program)",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object",
|
|
418
|
+
properties: {
|
|
419
|
+
conversationId: {
|
|
420
|
+
type: "string",
|
|
421
|
+
description: "Conversation ID"
|
|
422
|
+
},
|
|
423
|
+
count: {
|
|
424
|
+
type: "number",
|
|
425
|
+
description: "Number of messages (default: 10)",
|
|
426
|
+
default: 10
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
required: ["conversationId"]
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "linkedin_reply_message",
|
|
434
|
+
description: "Reply to a message (requires partnership program)",
|
|
435
|
+
inputSchema: {
|
|
436
|
+
type: "object",
|
|
437
|
+
properties: {
|
|
438
|
+
conversationId: {
|
|
439
|
+
type: "string",
|
|
440
|
+
description: "Conversation ID"
|
|
441
|
+
},
|
|
442
|
+
message: {
|
|
443
|
+
type: "string",
|
|
444
|
+
description: "Reply message text"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
required: ["conversationId", "message"]
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "linkedin_get_engagement_report",
|
|
452
|
+
description: "Get engagement metrics for posts",
|
|
453
|
+
inputSchema: {
|
|
454
|
+
type: "object",
|
|
455
|
+
properties: {
|
|
456
|
+
organizationId: {
|
|
457
|
+
type: "string",
|
|
458
|
+
description: "LinkedIn organization ID"
|
|
459
|
+
},
|
|
460
|
+
startDate: {
|
|
461
|
+
type: "string",
|
|
462
|
+
description: "Start date (ISO 8601)"
|
|
463
|
+
},
|
|
464
|
+
endDate: {
|
|
465
|
+
type: "string",
|
|
466
|
+
description: "End date (ISO 8601)"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
required: ["organizationId"]
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: "linkedin_get_impression_report",
|
|
474
|
+
description: "Get impression analytics",
|
|
475
|
+
inputSchema: {
|
|
476
|
+
type: "object",
|
|
477
|
+
properties: {
|
|
478
|
+
organizationId: {
|
|
479
|
+
type: "string",
|
|
480
|
+
description: "LinkedIn organization ID"
|
|
481
|
+
},
|
|
482
|
+
startDate: {
|
|
483
|
+
type: "string",
|
|
484
|
+
description: "Start date (ISO 8601)"
|
|
485
|
+
},
|
|
486
|
+
endDate: {
|
|
487
|
+
type: "string",
|
|
488
|
+
description: "End date (ISO 8601)"
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
required: ["organizationId"]
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: "linkedin_get_visitor_analytics",
|
|
496
|
+
description: "Get profile visitor statistics",
|
|
497
|
+
inputSchema: {
|
|
498
|
+
type: "object",
|
|
499
|
+
properties: {
|
|
500
|
+
organizationId: {
|
|
501
|
+
type: "string",
|
|
502
|
+
description: "LinkedIn organization ID"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
required: ["organizationId"]
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "linkedin_get_connection_requests",
|
|
510
|
+
description: "Get pending connection requests (requires partnership program)",
|
|
511
|
+
inputSchema: {
|
|
512
|
+
type: "object",
|
|
513
|
+
properties: {
|
|
514
|
+
count: {
|
|
515
|
+
type: "number",
|
|
516
|
+
description: "Number of requests (default: 10)",
|
|
517
|
+
default: 10
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "linkedin_accept_connection",
|
|
524
|
+
description: "Accept a connection request (requires partnership program)",
|
|
525
|
+
inputSchema: {
|
|
526
|
+
type: "object",
|
|
527
|
+
properties: {
|
|
528
|
+
invitationId: {
|
|
529
|
+
type: "string",
|
|
530
|
+
description: "Invitation ID"
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
required: ["invitationId"]
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: "linkedin_send_connection_request",
|
|
538
|
+
description: "Send a connection request (requires partnership program)",
|
|
539
|
+
inputSchema: {
|
|
540
|
+
type: "object",
|
|
541
|
+
properties: {
|
|
542
|
+
personId: {
|
|
543
|
+
type: "string",
|
|
544
|
+
description: "LinkedIn person ID"
|
|
545
|
+
},
|
|
546
|
+
message: {
|
|
547
|
+
type: "string",
|
|
548
|
+
description: "Optional connection message"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
required: ["personId"]
|
|
552
|
+
}
|
|
296
553
|
}
|
|
297
554
|
];
|
|
298
555
|
}
|
|
@@ -337,6 +594,34 @@ export class LinkedInPlatform {
|
|
|
337
594
|
return this.getConnections(args);
|
|
338
595
|
case "linkedin_send_message":
|
|
339
596
|
return this.sendMessage(args);
|
|
597
|
+
case "linkedin_create_video_post":
|
|
598
|
+
return this.createVideoPost(args);
|
|
599
|
+
case "linkedin_schedule_post":
|
|
600
|
+
return this.schedulePost(args);
|
|
601
|
+
case "linkedin_update_post":
|
|
602
|
+
return this.updatePost(args);
|
|
603
|
+
case "linkedin_reply_comment":
|
|
604
|
+
return this.replyComment(args);
|
|
605
|
+
case "linkedin_delete_comment":
|
|
606
|
+
return this.deleteComment(args);
|
|
607
|
+
case "linkedin_get_conversations":
|
|
608
|
+
return this.getConversations(args);
|
|
609
|
+
case "linkedin_get_messages":
|
|
610
|
+
return this.getMessages(args);
|
|
611
|
+
case "linkedin_reply_message":
|
|
612
|
+
return this.replyMessage(args);
|
|
613
|
+
case "linkedin_get_engagement_report":
|
|
614
|
+
return this.getEngagementReport(args);
|
|
615
|
+
case "linkedin_get_impression_report":
|
|
616
|
+
return this.getImpressionReport(args);
|
|
617
|
+
case "linkedin_get_visitor_analytics":
|
|
618
|
+
return this.getVisitorAnalytics(args);
|
|
619
|
+
case "linkedin_get_connection_requests":
|
|
620
|
+
return this.getConnectionRequests(args);
|
|
621
|
+
case "linkedin_accept_connection":
|
|
622
|
+
return this.acceptConnection(args);
|
|
623
|
+
case "linkedin_send_connection_request":
|
|
624
|
+
return this.sendConnectionRequest(args);
|
|
340
625
|
default:
|
|
341
626
|
throw new Error(`Unknown tool: ${name}`);
|
|
342
627
|
}
|
|
@@ -695,5 +980,272 @@ export class LinkedInPlatform {
|
|
|
695
980
|
};
|
|
696
981
|
}
|
|
697
982
|
}
|
|
983
|
+
async createVideoPost(args) {
|
|
984
|
+
try {
|
|
985
|
+
const personId = await this.getPersonId();
|
|
986
|
+
const visibility = args.visibility || "PUBLIC";
|
|
987
|
+
const body = {
|
|
988
|
+
author: `urn:li:person:${personId}`,
|
|
989
|
+
lifecycleState: "PUBLISHED",
|
|
990
|
+
specificContent: {
|
|
991
|
+
"com.linkedin.ugc.ShareContent": {
|
|
992
|
+
shareCommentary: {
|
|
993
|
+
text: args.text || ""
|
|
994
|
+
},
|
|
995
|
+
shareMediaCategory: "VIDEO",
|
|
996
|
+
media: [{
|
|
997
|
+
status: "READY",
|
|
998
|
+
originalUrl: args.videoUrl,
|
|
999
|
+
title: {
|
|
1000
|
+
text: args.title || "Video"
|
|
1001
|
+
}
|
|
1002
|
+
}]
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
visibility: {
|
|
1006
|
+
"com.linkedin.ugc.MemberNetworkVisibility": visibility
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
const data = await this.apiRequest("/ugcPosts", {
|
|
1010
|
+
method: "POST",
|
|
1011
|
+
body: JSON.stringify(body)
|
|
1012
|
+
});
|
|
1013
|
+
return {
|
|
1014
|
+
content: [{ type: "text", text: `Video post created successfully! ID: ${data?.id || "unknown"}` }]
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
catch (error) {
|
|
1018
|
+
throw new Error(`Failed to create LinkedIn video post: ${error}`);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
async schedulePost(args) {
|
|
1022
|
+
try {
|
|
1023
|
+
const personId = await this.getPersonId();
|
|
1024
|
+
const visibility = args.visibility || "PUBLIC";
|
|
1025
|
+
const body = {
|
|
1026
|
+
author: `urn:li:person:${personId}`,
|
|
1027
|
+
lifecycleState: "PUBLISHED",
|
|
1028
|
+
specificContent: {
|
|
1029
|
+
"com.linkedin.ugc.ShareContent": {
|
|
1030
|
+
shareCommentary: {
|
|
1031
|
+
text: args.text
|
|
1032
|
+
},
|
|
1033
|
+
shareMediaCategory: "NONE"
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
visibility: {
|
|
1037
|
+
"com.linkedin.ugc.MemberNetworkVisibility": visibility
|
|
1038
|
+
},
|
|
1039
|
+
publishedAt: args.scheduledTime * 1000
|
|
1040
|
+
};
|
|
1041
|
+
const data = await this.apiRequest("/ugcPosts", {
|
|
1042
|
+
method: "POST",
|
|
1043
|
+
body: JSON.stringify(body)
|
|
1044
|
+
});
|
|
1045
|
+
return {
|
|
1046
|
+
content: [{ type: "text", text: `Post scheduled successfully! ID: ${data?.id || "unknown"}` }]
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
catch (error) {
|
|
1050
|
+
throw new Error(`Failed to schedule LinkedIn post: ${error}`);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
async updatePost(args) {
|
|
1054
|
+
try {
|
|
1055
|
+
const body = {
|
|
1056
|
+
specificContent: {
|
|
1057
|
+
"com.linkedin.ugc.ShareContent": {
|
|
1058
|
+
shareCommentary: {
|
|
1059
|
+
text: args.text
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
await this.apiRequest(`/ugcPosts/${args.postUrn}`, {
|
|
1065
|
+
method: "PATCH",
|
|
1066
|
+
body: JSON.stringify(body)
|
|
1067
|
+
});
|
|
1068
|
+
return {
|
|
1069
|
+
content: [{ type: "text", text: "Post updated successfully!" }]
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
catch (error) {
|
|
1073
|
+
throw new Error(`Failed to update LinkedIn post: ${error}`);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
async replyComment(args) {
|
|
1077
|
+
try {
|
|
1078
|
+
const personId = await this.getPersonId();
|
|
1079
|
+
const body = {
|
|
1080
|
+
actor: `urn:li:person:${personId}`,
|
|
1081
|
+
parentComment: args.commentUrn,
|
|
1082
|
+
message: {
|
|
1083
|
+
text: args.text
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
const data = await this.apiRequest("/socialActions/{id}/comments", {
|
|
1087
|
+
method: "POST",
|
|
1088
|
+
body: JSON.stringify(body)
|
|
1089
|
+
});
|
|
1090
|
+
return {
|
|
1091
|
+
content: [{ type: "text", text: `Reply posted successfully! ID: ${data?.id || "unknown"}` }]
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
catch (error) {
|
|
1095
|
+
throw new Error(`Failed to reply to LinkedIn comment: ${error}`);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
async deleteComment(args) {
|
|
1099
|
+
try {
|
|
1100
|
+
await this.apiRequest(`/socialActions/{id}/comments/${args.commentUrn}`, {
|
|
1101
|
+
method: "DELETE"
|
|
1102
|
+
});
|
|
1103
|
+
return {
|
|
1104
|
+
content: [{ type: "text", text: "Comment deleted successfully!" }]
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
catch (error) {
|
|
1108
|
+
throw new Error(`Failed to delete LinkedIn comment: ${error}`);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
async getConversations(args) {
|
|
1112
|
+
try {
|
|
1113
|
+
const count = args.count || 10;
|
|
1114
|
+
const data = await this.apiRequest(`/conversations?count=${count}`);
|
|
1115
|
+
return {
|
|
1116
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
catch (error) {
|
|
1120
|
+
return {
|
|
1121
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Conversations API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
async getMessages(args) {
|
|
1126
|
+
try {
|
|
1127
|
+
const count = args.count || 10;
|
|
1128
|
+
const data = await this.apiRequest(`/conversations/${args.conversationId}/messages?count=${count}`);
|
|
1129
|
+
return {
|
|
1130
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
catch (error) {
|
|
1134
|
+
return {
|
|
1135
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Messages API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
async replyMessage(args) {
|
|
1140
|
+
try {
|
|
1141
|
+
const body = {
|
|
1142
|
+
body: args.message
|
|
1143
|
+
};
|
|
1144
|
+
const data = await this.apiRequest(`/conversations/${args.conversationId}/messages`, {
|
|
1145
|
+
method: "POST",
|
|
1146
|
+
body: JSON.stringify(body)
|
|
1147
|
+
});
|
|
1148
|
+
return {
|
|
1149
|
+
content: [{ type: "text", text: `Reply sent successfully! ID: ${data?.id || "unknown"}` }]
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
catch (error) {
|
|
1153
|
+
return {
|
|
1154
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Reply message API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
async getEngagementReport(args) {
|
|
1159
|
+
try {
|
|
1160
|
+
const data = await this.apiRequest(`/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:${args.organizationId}`);
|
|
1161
|
+
return {
|
|
1162
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
catch (error) {
|
|
1166
|
+
return {
|
|
1167
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Engagement analytics may require additional permissions", details: String(error) }, null, 2) }]
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
async getImpressionReport(args) {
|
|
1172
|
+
try {
|
|
1173
|
+
const data = await this.apiRequest(`/organizationPageStatistics?q=organization&organization=urn:li:organization:${args.organizationId}`);
|
|
1174
|
+
return {
|
|
1175
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
catch (error) {
|
|
1179
|
+
return {
|
|
1180
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Impression analytics may require additional permissions", details: String(error) }, null, 2) }]
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
async getVisitorAnalytics(args) {
|
|
1185
|
+
try {
|
|
1186
|
+
const data = await this.apiRequest(`/organizationPageStatistics?q=organization&organization=urn:li:organization:${args.organizationId}`);
|
|
1187
|
+
return {
|
|
1188
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
catch (error) {
|
|
1192
|
+
return {
|
|
1193
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Visitor analytics may require additional permissions", details: String(error) }, null, 2) }]
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
async getConnectionRequests(args) {
|
|
1198
|
+
try {
|
|
1199
|
+
const count = args.count || 10;
|
|
1200
|
+
const data = await this.apiRequest(`/invitations?count=${count}`);
|
|
1201
|
+
return {
|
|
1202
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
catch (error) {
|
|
1206
|
+
return {
|
|
1207
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Connection requests API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
async acceptConnection(args) {
|
|
1212
|
+
try {
|
|
1213
|
+
const body = {
|
|
1214
|
+
action: "accept"
|
|
1215
|
+
};
|
|
1216
|
+
await this.apiRequest(`/invitations/${args.invitationId}`, {
|
|
1217
|
+
method: "POST",
|
|
1218
|
+
body: JSON.stringify(body)
|
|
1219
|
+
});
|
|
1220
|
+
return {
|
|
1221
|
+
content: [{ type: "text", text: "Connection request accepted successfully!" }]
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
catch (error) {
|
|
1225
|
+
return {
|
|
1226
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Accept connection API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
async sendConnectionRequest(args) {
|
|
1231
|
+
try {
|
|
1232
|
+
const body = {
|
|
1233
|
+
invitee: `urn:li:person:${args.personId}`,
|
|
1234
|
+
message: args.message || ""
|
|
1235
|
+
};
|
|
1236
|
+
const data = await this.apiRequest("/invitations", {
|
|
1237
|
+
method: "POST",
|
|
1238
|
+
body: JSON.stringify(body)
|
|
1239
|
+
});
|
|
1240
|
+
return {
|
|
1241
|
+
content: [{ type: "text", text: `Connection request sent successfully! ID: ${data?.id || "unknown"}` }]
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
catch (error) {
|
|
1245
|
+
return {
|
|
1246
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Send connection request API requires LinkedIn Partnership Program access", details: String(error) }, null, 2) }]
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
698
1250
|
}
|
|
699
1251
|
//# sourceMappingURL=linkedin.js.map
|