posterly-mcp-server 0.8.2 → 0.19.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.
Files changed (121) hide show
  1. package/README.md +38 -3
  2. package/dist/generated/platform-manifest.d.ts +392 -0
  3. package/dist/generated/platform-manifest.js +695 -0
  4. package/dist/index.js +331 -1
  5. package/dist/lib/api-client.d.ts +391 -24
  6. package/dist/lib/api-client.js +176 -0
  7. package/dist/tools/audit-google-business-profile.d.ts +24 -0
  8. package/dist/tools/audit-google-business-profile.js +27 -0
  9. package/dist/tools/create-oauth-client.d.ts +40 -0
  10. package/dist/tools/create-oauth-client.js +20 -0
  11. package/dist/tools/create-post.d.ts +399 -20
  12. package/dist/tools/create-post.js +81 -78
  13. package/dist/tools/create-posts-batch.d.ts +567 -0
  14. package/dist/tools/create-posts-batch.js +38 -0
  15. package/dist/tools/create-signed-upload.d.ts +24 -0
  16. package/dist/tools/create-signed-upload.js +20 -0
  17. package/dist/tools/create-webhook.d.ts +36 -0
  18. package/dist/tools/create-webhook.js +20 -0
  19. package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
  20. package/dist/tools/delete-google-business-review-reply.js +17 -0
  21. package/dist/tools/delete-oauth-client.d.ts +20 -0
  22. package/dist/tools/delete-oauth-client.js +13 -0
  23. package/dist/tools/delete-post-group.d.ts +20 -0
  24. package/dist/tools/delete-post-group.js +13 -0
  25. package/dist/tools/delete-webhook.d.ts +20 -0
  26. package/dist/tools/delete-webhook.js +13 -0
  27. package/dist/tools/disconnect-account.d.ts +20 -0
  28. package/dist/tools/disconnect-account.js +22 -0
  29. package/dist/tools/generate-image.d.ts +4 -4
  30. package/dist/tools/generate-video.d.ts +59 -0
  31. package/dist/tools/generate-video.js +34 -0
  32. package/dist/tools/get-connect-link.d.ts +24 -0
  33. package/dist/tools/get-connect-link.js +46 -0
  34. package/dist/tools/get-google-business-review-link.d.ts +24 -0
  35. package/dist/tools/get-google-business-review-link.js +19 -0
  36. package/dist/tools/get-platform-schema.d.ts +24 -0
  37. package/dist/tools/get-platform-schema.js +44 -0
  38. package/dist/tools/get-post-missing.d.ts +16 -0
  39. package/dist/tools/get-post-missing.js +12 -0
  40. package/dist/tools/get-video-job.d.ts +24 -0
  41. package/dist/tools/get-video-job.js +31 -0
  42. package/dist/tools/get-video-options.d.ts +8 -0
  43. package/dist/tools/get-video-options.js +26 -0
  44. package/dist/tools/get-x-posting-quota.d.ts +16 -0
  45. package/dist/tools/get-x-posting-quota.js +21 -0
  46. package/dist/tools/list-activity.d.ts +32 -0
  47. package/dist/tools/list-activity.js +35 -0
  48. package/dist/tools/list-google-business-reviews.d.ts +32 -0
  49. package/dist/tools/list-google-business-reviews.js +28 -0
  50. package/dist/tools/list-oauth-clients.d.ts +8 -0
  51. package/dist/tools/list-oauth-clients.js +15 -0
  52. package/dist/tools/list-platforms.d.ts +16 -0
  53. package/dist/tools/list-platforms.js +20 -0
  54. package/dist/tools/list-posts.d.ts +3 -3
  55. package/dist/tools/list-posts.js +3 -2
  56. package/dist/tools/list-webhooks.d.ts +16 -0
  57. package/dist/tools/list-webhooks.js +24 -0
  58. package/dist/tools/reply-google-business-review.d.ts +36 -0
  59. package/dist/tools/reply-google-business-review.js +18 -0
  60. package/dist/tools/run-video-function.d.ts +24 -0
  61. package/dist/tools/run-video-function.js +25 -0
  62. package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
  63. package/dist/tools/suggest-google-business-review-reply.js +27 -0
  64. package/dist/tools/test-webhook.d.ts +20 -0
  65. package/dist/tools/test-webhook.js +14 -0
  66. package/dist/tools/trigger-platform-helper.d.ts +28 -0
  67. package/dist/tools/trigger-platform-helper.js +22 -0
  68. package/dist/tools/update-oauth-client.d.ts +44 -0
  69. package/dist/tools/update-oauth-client.js +21 -0
  70. package/dist/tools/update-post-release-id.d.ts +28 -0
  71. package/dist/tools/update-post-release-id.js +18 -0
  72. package/dist/tools/update-post-status.d.ts +28 -0
  73. package/dist/tools/update-post-status.js +23 -0
  74. package/dist/tools/update-post.js +1 -1
  75. package/dist/tools/update-webhook.d.ts +40 -0
  76. package/dist/tools/update-webhook.js +21 -0
  77. package/dist/tools/upload-media-from-url.d.ts +24 -0
  78. package/dist/tools/upload-media-from-url.js +26 -0
  79. package/dist/tools/webhook-events.d.ts +3 -0
  80. package/dist/tools/webhook-events.js +13 -0
  81. package/package.json +1 -1
  82. package/src/generated/platform-manifest.ts +695 -0
  83. package/src/index.ts +496 -1
  84. package/src/lib/api-client.ts +497 -19
  85. package/src/tools/audit-google-business-profile.ts +38 -0
  86. package/src/tools/create-oauth-client.ts +36 -0
  87. package/src/tools/create-post.ts +91 -94
  88. package/src/tools/create-posts-batch.ts +48 -0
  89. package/src/tools/create-signed-upload.ts +27 -0
  90. package/src/tools/create-webhook.ts +35 -0
  91. package/src/tools/delete-google-business-review-reply.ts +30 -0
  92. package/src/tools/delete-oauth-client.ts +23 -0
  93. package/src/tools/delete-post-group.ts +17 -0
  94. package/src/tools/delete-webhook.ts +18 -0
  95. package/src/tools/disconnect-account.ts +30 -0
  96. package/src/tools/generate-video.ts +38 -0
  97. package/src/tools/get-connect-link.ts +56 -0
  98. package/src/tools/get-google-business-review-link.ts +30 -0
  99. package/src/tools/get-platform-schema.ts +52 -0
  100. package/src/tools/get-post-missing.ts +17 -0
  101. package/src/tools/get-video-job.ts +36 -0
  102. package/src/tools/get-video-options.ts +30 -0
  103. package/src/tools/get-x-posting-quota.ts +25 -0
  104. package/src/tools/list-activity.ts +51 -0
  105. package/src/tools/list-google-business-reviews.ts +43 -0
  106. package/src/tools/list-oauth-clients.ts +18 -0
  107. package/src/tools/list-platforms.ts +25 -0
  108. package/src/tools/list-posts.ts +3 -2
  109. package/src/tools/list-webhooks.ts +30 -0
  110. package/src/tools/reply-google-business-review.ts +32 -0
  111. package/src/tools/run-video-function.ts +32 -0
  112. package/src/tools/suggest-google-business-review-reply.ts +44 -0
  113. package/src/tools/test-webhook.ts +18 -0
  114. package/src/tools/trigger-platform-helper.ts +34 -0
  115. package/src/tools/update-oauth-client.ts +38 -0
  116. package/src/tools/update-post-release-id.ts +26 -0
  117. package/src/tools/update-post-status.ts +31 -0
  118. package/src/tools/update-post.ts +1 -1
  119. package/src/tools/update-webhook.ts +37 -0
  120. package/src/tools/upload-media-from-url.ts +33 -0
  121. package/src/tools/webhook-events.ts +16 -0
@@ -79,6 +79,47 @@ export interface InstagramPostSettings {
79
79
  reel_thumb_offset?: number;
80
80
  }
81
81
  export type PlatformPostSettings = Record<string, unknown>;
82
+ export type CreatePostPayload = {
83
+ account_id?: string;
84
+ username?: string;
85
+ platform?: string;
86
+ caption: string;
87
+ scheduled_at?: string;
88
+ post_type?: string;
89
+ media_url?: string;
90
+ media_urls?: string[];
91
+ metadata?: Record<string, unknown>;
92
+ settings?: PlatformPostSettings;
93
+ reel_cover_url?: string;
94
+ reel_cover_method?: string;
95
+ reel_thumb_offset?: number;
96
+ workspace_id?: string;
97
+ };
98
+ export type CreatePostResponse = {
99
+ post: Post;
100
+ workspace: {
101
+ id: string;
102
+ name: string;
103
+ is_personal: boolean;
104
+ resolved_from: 'explicit' | 'account' | 'personal';
105
+ };
106
+ };
107
+ export type BatchCreatePostsResponse = {
108
+ posts: Array<CreatePostResponse & {
109
+ index: number;
110
+ replayed: boolean;
111
+ }>;
112
+ errors: Array<{
113
+ index: number;
114
+ status: number;
115
+ error: string;
116
+ validation_errors?: unknown;
117
+ }>;
118
+ total: number;
119
+ created: number;
120
+ replayed: number;
121
+ failed: number;
122
+ };
82
123
  export interface Slot {
83
124
  time: string;
84
125
  local_time: string;
@@ -191,6 +232,163 @@ export interface PostAnalyticsResponse {
191
232
  limit: number;
192
233
  offset: number;
193
234
  }
235
+ export interface GoogleBusinessReview {
236
+ name?: string;
237
+ reviewId?: string;
238
+ reviewer?: {
239
+ displayName?: string;
240
+ profilePhotoUrl?: string;
241
+ };
242
+ starRating: number;
243
+ comment?: string;
244
+ createTime?: string;
245
+ updateTime?: string;
246
+ reviewReply?: Record<string, unknown>;
247
+ locationId?: string | null;
248
+ locationName?: string | null;
249
+ businessName?: string | null;
250
+ socialAccountId?: number;
251
+ account_id?: number;
252
+ }
253
+ export interface GoogleBusinessReviewsResponse {
254
+ reviews: GoogleBusinessReview[];
255
+ total: number;
256
+ locations: Array<Record<string, unknown>>;
257
+ }
258
+ export interface GoogleBusinessReviewLinkResponse {
259
+ reviewLink: string;
260
+ placeId: string;
261
+ businessName: string;
262
+ locationId: string | null;
263
+ account_id: number;
264
+ }
265
+ export interface ActivityItem {
266
+ id: string;
267
+ type: 'activity' | 'publish';
268
+ post_id: number | null;
269
+ action?: string | null;
270
+ description?: string | null;
271
+ platform?: string | null;
272
+ outcome?: string | null;
273
+ error_code?: string | null;
274
+ error_message?: string | null;
275
+ http_status?: number | null;
276
+ retry_number?: number | null;
277
+ duration_ms?: number | null;
278
+ pipeline_step?: string | null;
279
+ metadata?: Record<string, unknown> | null;
280
+ context?: Record<string, unknown> | null;
281
+ created_at: string;
282
+ }
283
+ export interface ActivityResponse {
284
+ items: ActivityItem[];
285
+ total: number;
286
+ limit: number;
287
+ }
288
+ export interface ApiWebhook {
289
+ id: string;
290
+ workspace_id: string | null;
291
+ url: string;
292
+ description: string | null;
293
+ events: string[];
294
+ is_active: boolean;
295
+ created_at: string;
296
+ updated_at: string | null;
297
+ last_delivery_at: string | null;
298
+ last_delivery_status: number | null;
299
+ last_error: string | null;
300
+ }
301
+ export interface WebhookResponse {
302
+ webhook: ApiWebhook;
303
+ secret?: string;
304
+ }
305
+ export interface PlatformSchema {
306
+ id: string;
307
+ aliases: string[];
308
+ label: string;
309
+ status: 'supported' | 'planned';
310
+ summary: string;
311
+ content_limit: number | null;
312
+ media: Record<string, unknown>;
313
+ post_types: string[];
314
+ analytics_supported: boolean;
315
+ settings_schema: {
316
+ fields: Array<Record<string, unknown>>;
317
+ example: Record<string, unknown>;
318
+ };
319
+ helper_tools: Array<Record<string, unknown>>;
320
+ native_features: string[];
321
+ }
322
+ export interface ConnectOption {
323
+ platform: string;
324
+ aliases: string[];
325
+ label: string;
326
+ status: 'supported' | 'planned';
327
+ method: 'dashboard_oauth' | 'manual_credentials' | 'planned';
328
+ provider_platforms: string[];
329
+ dashboard_url: string;
330
+ connection_url: string | null;
331
+ oauth_url: string | null;
332
+ supports_direct_oauth_url: boolean;
333
+ requires_browser_session: boolean;
334
+ configured: boolean | null;
335
+ env_requirements: Array<Record<string, unknown>>;
336
+ missing_env: string[][];
337
+ scopes: string[];
338
+ credential_fields: Array<Record<string, unknown>>;
339
+ notes: string[];
340
+ connected_count?: number;
341
+ connected_accounts?: Account[];
342
+ }
343
+ export interface OAuthDeveloperClient {
344
+ id: string;
345
+ client_id: string;
346
+ client_name: string;
347
+ description?: string | null;
348
+ homepage?: string | null;
349
+ allowed_redirect_uris: string[];
350
+ default_scopes: string[];
351
+ is_active: boolean;
352
+ created_at?: string;
353
+ updated_at?: string;
354
+ }
355
+ export interface VideoJob {
356
+ id: string;
357
+ status: string;
358
+ prompt: string;
359
+ model: string;
360
+ duration_seconds: number;
361
+ aspect_ratio?: string;
362
+ resolution?: string;
363
+ generation_mode?: string | null;
364
+ credit_cost: number;
365
+ included_credit_cost?: number;
366
+ purchased_credit_cost?: number;
367
+ source_image_url?: string | null;
368
+ end_image_url?: string | null;
369
+ source_video_url?: string | null;
370
+ reference_images?: unknown;
371
+ generate_audio?: boolean | null;
372
+ video_url?: string | null;
373
+ error_message?: string | null;
374
+ created_at: string;
375
+ started_at?: string | null;
376
+ completed_at?: string | null;
377
+ }
378
+ export interface XPostingQuotaResponse {
379
+ workspace_id: string | null;
380
+ tier: string | null;
381
+ base_posts: number;
382
+ addon_posts: number;
383
+ total_posts: number;
384
+ used_posts: number;
385
+ remaining_posts: number;
386
+ current_period_start: string;
387
+ current_period_end: string;
388
+ urls_blocked: boolean;
389
+ addon?: Record<string, unknown>;
390
+ plans?: Array<Record<string, unknown>>;
391
+ }
194
392
  export declare class PosterlyClient {
195
393
  private baseUrl;
196
394
  private apiKey;
@@ -200,6 +398,42 @@ export declare class PosterlyClient {
200
398
  listAccounts(params?: {
201
399
  workspace_id?: string;
202
400
  }): Promise<Account[]>;
401
+ disconnectAccount(accountId: string): Promise<Record<string, any>>;
402
+ getConnectLink(params?: {
403
+ platform?: string;
404
+ workspace_id?: string;
405
+ include_planned?: boolean;
406
+ }): Promise<{
407
+ connect?: ConnectOption;
408
+ connect_options?: ConnectOption[];
409
+ }>;
410
+ listOAuthClients(): Promise<{
411
+ clients: OAuthDeveloperClient[];
412
+ }>;
413
+ createOAuthClient(data: {
414
+ client_name: string;
415
+ description?: string;
416
+ homepage?: string;
417
+ allowed_redirect_uris: string[];
418
+ default_scopes: string[];
419
+ is_active?: boolean;
420
+ }): Promise<{
421
+ client: OAuthDeveloperClient;
422
+ }>;
423
+ updateOAuthClient(clientId: string, data: {
424
+ client_name?: string;
425
+ description?: string;
426
+ homepage?: string | null;
427
+ allowed_redirect_uris?: string[];
428
+ default_scopes?: string[];
429
+ is_active?: boolean;
430
+ }): Promise<{
431
+ client: OAuthDeveloperClient;
432
+ }>;
433
+ deleteOAuthClient(clientId: string): Promise<{
434
+ deleted: boolean;
435
+ client_id: string;
436
+ }>;
203
437
  listBrands(params?: {
204
438
  workspace_id?: string;
205
439
  }): Promise<Brand[]>;
@@ -221,33 +455,14 @@ export declare class PosterlyClient {
221
455
  posts: Post[];
222
456
  total: number;
223
457
  }>;
224
- createPost(data: {
225
- account_id?: string;
226
- username?: string;
227
- platform?: string;
228
- caption: string;
229
- scheduled_at?: string;
230
- post_type?: string;
231
- media_url?: string;
232
- media_urls?: string[];
233
- metadata?: Record<string, unknown>;
234
- settings?: PlatformPostSettings;
235
- reel_cover_url?: string;
236
- reel_cover_method?: string;
237
- reel_thumb_offset?: number;
238
- workspace_id?: string;
239
- }): Promise<{
240
- post: Post;
241
- workspace: {
242
- id: string;
243
- name: string;
244
- is_personal: boolean;
245
- resolved_from: 'explicit' | 'account' | 'personal';
246
- };
247
- }>;
458
+ createPost(data: CreatePostPayload): Promise<CreatePostResponse>;
459
+ createPostsBatch(data: {
460
+ posts: CreatePostPayload[];
461
+ }): Promise<BatchCreatePostsResponse>;
248
462
  getPost(id: number): Promise<{
249
463
  post: Post;
250
464
  }>;
465
+ getPostMissing(id: number): Promise<Record<string, any>>;
251
466
  updatePost(id: number, data: {
252
467
  caption?: string;
253
468
  scheduled_at?: string;
@@ -266,6 +481,15 @@ export declare class PosterlyClient {
266
481
  deleted: boolean;
267
482
  id: number;
268
483
  }>;
484
+ updatePostStatus(id: number, data: {
485
+ status: 'scheduled' | 'paused' | 'draft';
486
+ scheduled_at?: string;
487
+ }): Promise<Record<string, any>>;
488
+ updatePostReleaseId(id: number, data: {
489
+ release_id: string;
490
+ group_id?: string;
491
+ }): Promise<Record<string, any>>;
492
+ deletePostGroup(groupId: string): Promise<Record<string, any>>;
269
493
  generateImage(data: {
270
494
  prompt: string;
271
495
  aspect_ratio?: string;
@@ -291,6 +515,36 @@ export declare class PosterlyClient {
291
515
  billed_from: 'plan_quota' | 'credits';
292
516
  };
293
517
  }>;
518
+ getVideoOptions(): Promise<Record<string, any>>;
519
+ runVideoFunction(data: {
520
+ identifier: string;
521
+ functionName: string;
522
+ params?: Record<string, unknown>;
523
+ }): Promise<Record<string, any>>;
524
+ generateVideo(data: {
525
+ prompt: string;
526
+ negative_prompt?: string;
527
+ aspect_ratio?: '16:9' | '9:16';
528
+ duration_seconds?: 4 | 6 | 8;
529
+ resolution?: '720p' | '1080p';
530
+ model?: 'fast' | 'standard';
531
+ image_url?: string;
532
+ end_image_url?: string;
533
+ reference_images?: Array<{
534
+ url: string;
535
+ type: 'character' | 'object' | 'scene';
536
+ }>;
537
+ generate_audio?: boolean;
538
+ source_video_url?: string;
539
+ }): Promise<Record<string, any>>;
540
+ getVideoJob(params?: {
541
+ job_id?: string;
542
+ status?: string;
543
+ limit?: number;
544
+ }): Promise<{
545
+ job?: VideoJob;
546
+ jobs?: VideoJob[];
547
+ }>;
294
548
  findAvailableSlots(params?: {
295
549
  account_ids?: string[];
296
550
  timezone?: string;
@@ -309,6 +563,108 @@ export declare class PosterlyClient {
309
563
  limit?: number;
310
564
  offset?: number;
311
565
  }): Promise<PostAnalyticsResponse>;
566
+ listGoogleBusinessReviews(params?: {
567
+ workspace_id?: string;
568
+ account_id?: number;
569
+ location_id?: string;
570
+ rating?: number;
571
+ unanswered?: boolean;
572
+ }): Promise<GoogleBusinessReviewsResponse>;
573
+ getGoogleBusinessReviewLink(params: {
574
+ workspace_id?: string;
575
+ account_id?: number;
576
+ location_id?: string;
577
+ }): Promise<GoogleBusinessReviewLinkResponse>;
578
+ auditGoogleBusinessProfile(params: {
579
+ workspace_id?: string;
580
+ account_id?: number;
581
+ location_id?: string;
582
+ }): Promise<Record<string, any>>;
583
+ suggestGoogleBusinessReviewReply(data: {
584
+ workspace_id?: string;
585
+ account_id?: number;
586
+ location_id?: string;
587
+ review_text?: string;
588
+ star_rating: number;
589
+ reviewer_name?: string;
590
+ business_name?: string;
591
+ tone?: 'professional' | 'friendly' | 'apologetic';
592
+ count?: number;
593
+ }): Promise<Record<string, any>>;
594
+ replyGoogleBusinessReview(data: {
595
+ workspace_id?: string;
596
+ account_id?: number;
597
+ location_id?: string;
598
+ review_name: string;
599
+ comment: string;
600
+ }): Promise<Record<string, any>>;
601
+ deleteGoogleBusinessReviewReply(data: {
602
+ workspace_id?: string;
603
+ account_id?: number;
604
+ location_id?: string;
605
+ review_name: string;
606
+ }): Promise<Record<string, any>>;
607
+ listActivity(params?: {
608
+ workspace_id?: string;
609
+ post_id?: number;
610
+ since?: string;
611
+ type?: 'all' | 'activity' | 'publish';
612
+ limit?: number;
613
+ }): Promise<ActivityResponse>;
614
+ listWebhooks(params?: {
615
+ workspace_id?: string;
616
+ }): Promise<{
617
+ webhooks: ApiWebhook[];
618
+ }>;
619
+ createWebhook(data: {
620
+ url: string;
621
+ events?: string[];
622
+ workspace_id?: string;
623
+ description?: string;
624
+ is_active?: boolean;
625
+ }): Promise<WebhookResponse>;
626
+ updateWebhook(id: string, data: {
627
+ url?: string;
628
+ events?: string[];
629
+ workspace_id?: string | null;
630
+ description?: string | null;
631
+ is_active?: boolean;
632
+ }): Promise<WebhookResponse>;
633
+ deleteWebhook(id: string): Promise<{
634
+ deleted: boolean;
635
+ id: string;
636
+ }>;
637
+ testWebhook(id: string): Promise<{
638
+ delivery: Record<string, unknown>;
639
+ }>;
640
+ listPlatforms(params?: {
641
+ include_planned?: boolean;
642
+ }): Promise<{
643
+ platforms: PlatformSchema[];
644
+ }>;
645
+ getPlatformSchema(params: {
646
+ account_id?: string;
647
+ platform?: string;
648
+ include_planned?: boolean;
649
+ }): Promise<{
650
+ account?: Record<string, unknown>;
651
+ schema?: PlatformSchema;
652
+ platform?: PlatformSchema;
653
+ platforms?: PlatformSchema[];
654
+ }>;
655
+ triggerPlatformHelper(data: {
656
+ helper: string;
657
+ account_id?: string;
658
+ platform?: string;
659
+ params?: Record<string, unknown>;
660
+ }): Promise<{
661
+ helper: string;
662
+ account: Record<string, unknown> | null;
663
+ result: unknown;
664
+ }>;
665
+ getXPostingQuota(params?: {
666
+ workspace_id?: string;
667
+ }): Promise<XPostingQuotaResponse>;
312
668
  getSignedUploadUrl(filename: string, contentType: string, size: number): Promise<{
313
669
  upload_url: string;
314
670
  token: string;
@@ -324,4 +680,15 @@ export declare class PosterlyClient {
324
680
  url: string;
325
681
  path: string;
326
682
  }>;
683
+ uploadMediaFromUrl(input: {
684
+ url: string;
685
+ filename?: string;
686
+ contentType?: string;
687
+ }): Promise<{
688
+ url: string;
689
+ path: string;
690
+ source_url: string;
691
+ content_type: string;
692
+ size: number;
693
+ }>;
327
694
  }
@@ -41,6 +41,33 @@ export class PosterlyClient {
41
41
  const data = await this.request('GET', `/accounts${qs ? `?${qs}` : ''}`);
42
42
  return data.accounts;
43
43
  }
44
+ async disconnectAccount(accountId) {
45
+ return this.request('DELETE', `/accounts/${encodeURIComponent(accountId)}`);
46
+ }
47
+ async getConnectLink(params) {
48
+ const searchParams = new URLSearchParams();
49
+ if (params?.workspace_id)
50
+ searchParams.set('workspace_id', params.workspace_id);
51
+ if (params?.include_planned)
52
+ searchParams.set('include_planned', 'true');
53
+ const qs = searchParams.toString();
54
+ const path = params?.platform
55
+ ? `/connect/${encodeURIComponent(params.platform)}`
56
+ : '/connect';
57
+ return this.request('GET', `${path}${qs ? `?${qs}` : ''}`);
58
+ }
59
+ async listOAuthClients() {
60
+ return this.request('GET', '/oauth/clients');
61
+ }
62
+ async createOAuthClient(data) {
63
+ return this.request('POST', '/oauth/clients', data);
64
+ }
65
+ async updateOAuthClient(clientId, data) {
66
+ return this.request('PATCH', `/oauth/clients/${encodeURIComponent(clientId)}`, data);
67
+ }
68
+ async deleteOAuthClient(clientId) {
69
+ return this.request('DELETE', `/oauth/clients/${encodeURIComponent(clientId)}`);
70
+ }
44
71
  async listBrands(params) {
45
72
  const searchParams = new URLSearchParams();
46
73
  if (params?.workspace_id)
@@ -79,18 +106,54 @@ export class PosterlyClient {
79
106
  async createPost(data) {
80
107
  return this.request('POST', '/posts', data);
81
108
  }
109
+ async createPostsBatch(data) {
110
+ return this.request('POST', '/posts/batch', data);
111
+ }
82
112
  async getPost(id) {
83
113
  return this.request('GET', `/posts/${id}`);
84
114
  }
115
+ async getPostMissing(id) {
116
+ return this.request('GET', `/posts/${id}/missing`);
117
+ }
85
118
  async updatePost(id, data) {
86
119
  return this.request('PATCH', `/posts/${id}`, data);
87
120
  }
88
121
  async deletePost(id) {
89
122
  return this.request('DELETE', `/posts/${id}`);
90
123
  }
124
+ async updatePostStatus(id, data) {
125
+ return this.request('PUT', `/posts/${id}/status`, data);
126
+ }
127
+ async updatePostReleaseId(id, data) {
128
+ return this.request('PUT', `/posts/${id}/release-id`, data);
129
+ }
130
+ async deletePostGroup(groupId) {
131
+ return this.request('DELETE', `/posts/group/${encodeURIComponent(groupId)}?confirm=true`);
132
+ }
91
133
  async generateImage(data) {
92
134
  return this.request('POST', '/ai/generate-image', data);
93
135
  }
136
+ async getVideoOptions() {
137
+ return this.request('GET', '/ai/video-options');
138
+ }
139
+ async runVideoFunction(data) {
140
+ return this.request('POST', '/ai/video-function', data);
141
+ }
142
+ async generateVideo(data) {
143
+ return this.request('POST', '/ai/generate-video', data);
144
+ }
145
+ async getVideoJob(params) {
146
+ if (params?.job_id) {
147
+ return this.request('GET', `/ai/video-jobs/${encodeURIComponent(params.job_id)}`);
148
+ }
149
+ const searchParams = new URLSearchParams();
150
+ if (params?.status)
151
+ searchParams.set('status', params.status);
152
+ if (params?.limit)
153
+ searchParams.set('limit', String(params.limit));
154
+ const qs = searchParams.toString();
155
+ return this.request('GET', `/ai/video-jobs${qs ? `?${qs}` : ''}`);
156
+ }
94
157
  async findAvailableSlots(params) {
95
158
  const searchParams = new URLSearchParams();
96
159
  if (params?.account_ids?.length)
@@ -127,6 +190,112 @@ export class PosterlyClient {
127
190
  searchParams.set('offset', String(params.offset));
128
191
  return this.request('GET', `/analytics/posts?${searchParams.toString()}`);
129
192
  }
193
+ async listGoogleBusinessReviews(params) {
194
+ const searchParams = new URLSearchParams();
195
+ if (params?.workspace_id)
196
+ searchParams.set('workspace_id', params.workspace_id);
197
+ if (params?.account_id)
198
+ searchParams.set('account_id', String(params.account_id));
199
+ if (params?.location_id)
200
+ searchParams.set('location_id', params.location_id);
201
+ if (params?.rating)
202
+ searchParams.set('rating', String(params.rating));
203
+ if (params?.unanswered)
204
+ searchParams.set('unanswered', 'true');
205
+ const qs = searchParams.toString();
206
+ return this.request('GET', `/google-business/reviews${qs ? `?${qs}` : ''}`);
207
+ }
208
+ async getGoogleBusinessReviewLink(params) {
209
+ const searchParams = new URLSearchParams();
210
+ if (params.workspace_id)
211
+ searchParams.set('workspace_id', params.workspace_id);
212
+ if (params.account_id)
213
+ searchParams.set('account_id', String(params.account_id));
214
+ if (params.location_id)
215
+ searchParams.set('location_id', params.location_id);
216
+ return this.request('GET', `/google-business/review-link?${searchParams.toString()}`);
217
+ }
218
+ async auditGoogleBusinessProfile(params) {
219
+ const searchParams = new URLSearchParams();
220
+ if (params.workspace_id)
221
+ searchParams.set('workspace_id', params.workspace_id);
222
+ if (params.account_id)
223
+ searchParams.set('account_id', String(params.account_id));
224
+ if (params.location_id)
225
+ searchParams.set('location_id', params.location_id);
226
+ return this.request('GET', `/google-business/audit?${searchParams.toString()}`);
227
+ }
228
+ async suggestGoogleBusinessReviewReply(data) {
229
+ return this.request('POST', '/google-business/reviews/suggest-reply', data);
230
+ }
231
+ async replyGoogleBusinessReview(data) {
232
+ return this.request('POST', '/google-business/reviews/reply', data);
233
+ }
234
+ async deleteGoogleBusinessReviewReply(data) {
235
+ return this.request('DELETE', '/google-business/reviews/reply', data);
236
+ }
237
+ async listActivity(params) {
238
+ const searchParams = new URLSearchParams();
239
+ if (params?.workspace_id)
240
+ searchParams.set('workspace_id', params.workspace_id);
241
+ if (params?.post_id)
242
+ searchParams.set('post_id', String(params.post_id));
243
+ if (params?.since)
244
+ searchParams.set('since', params.since);
245
+ if (params?.type)
246
+ searchParams.set('type', params.type);
247
+ if (params?.limit)
248
+ searchParams.set('limit', String(params.limit));
249
+ const qs = searchParams.toString();
250
+ return this.request('GET', `/activity${qs ? `?${qs}` : ''}`);
251
+ }
252
+ async listWebhooks(params) {
253
+ const searchParams = new URLSearchParams();
254
+ if (params?.workspace_id)
255
+ searchParams.set('workspace_id', params.workspace_id);
256
+ const qs = searchParams.toString();
257
+ return this.request('GET', `/webhooks${qs ? `?${qs}` : ''}`);
258
+ }
259
+ async createWebhook(data) {
260
+ return this.request('POST', '/webhooks', data);
261
+ }
262
+ async updateWebhook(id, data) {
263
+ return this.request('PATCH', `/webhooks/${encodeURIComponent(id)}`, data);
264
+ }
265
+ async deleteWebhook(id) {
266
+ return this.request('DELETE', `/webhooks/${encodeURIComponent(id)}`);
267
+ }
268
+ async testWebhook(id) {
269
+ return this.request('POST', `/webhooks/${encodeURIComponent(id)}/test`, {});
270
+ }
271
+ async listPlatforms(params) {
272
+ const searchParams = new URLSearchParams();
273
+ if (params?.include_planned)
274
+ searchParams.set('include_planned', 'true');
275
+ const qs = searchParams.toString();
276
+ return this.request('GET', `/platforms${qs ? `?${qs}` : ''}`);
277
+ }
278
+ async getPlatformSchema(params) {
279
+ if (params.account_id) {
280
+ return this.request('GET', `/accounts/${encodeURIComponent(params.account_id)}/schema`);
281
+ }
282
+ const searchParams = new URLSearchParams();
283
+ if (params.platform)
284
+ searchParams.set('platform', params.platform);
285
+ if (params.include_planned)
286
+ searchParams.set('include_planned', 'true');
287
+ return this.request('GET', `/platforms?${searchParams.toString()}`);
288
+ }
289
+ async triggerPlatformHelper(data) {
290
+ return this.request('POST', '/platforms/trigger', data);
291
+ }
292
+ async getXPostingQuota(params) {
293
+ const searchParams = new URLSearchParams();
294
+ if (params?.workspace_id)
295
+ searchParams.set('workspace_id', params.workspace_id);
296
+ const qs = searchParams.toString();
297
+ return this.request('GET', `/x-posting/quota${qs ? `?${qs}` : ''}`);
298
+ }
130
299
  async getSignedUploadUrl(filename, contentType, size) {
131
300
  return this.request('POST', '/media/signed-upload', {
132
301
  filename,
@@ -172,6 +341,13 @@ export class PosterlyClient {
172
341
  content_type: contentType,
173
342
  });
174
343
  }
344
+ async uploadMediaFromUrl(input) {
345
+ return this.request('POST', '/media/upload-from-url', {
346
+ url: input.url,
347
+ filename: input.filename,
348
+ content_type: input.contentType,
349
+ });
350
+ }
175
351
  }
176
352
  function guessContentType(filename) {
177
353
  const ext = filename.split('.').pop()?.toLowerCase();
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const auditGoogleBusinessProfileTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ workspace_id: z.ZodOptional<z.ZodString>;
8
+ account_id: z.ZodOptional<z.ZodNumber>;
9
+ location_id: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ workspace_id?: string | undefined;
12
+ account_id?: number | undefined;
13
+ location_id?: string | undefined;
14
+ }, {
15
+ workspace_id?: string | undefined;
16
+ account_id?: number | undefined;
17
+ location_id?: string | undefined;
18
+ }>;
19
+ execute(client: PosterlyClient, input: {
20
+ workspace_id?: string;
21
+ account_id?: number;
22
+ location_id?: string;
23
+ }): Promise<string>;
24
+ };