posterly-mcp-server 0.8.3 → 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.
- package/README.md +35 -1
- package/dist/generated/platform-manifest.d.ts +392 -0
- package/dist/generated/platform-manifest.js +695 -0
- package/dist/index.js +321 -1
- package/dist/lib/api-client.d.ts +346 -0
- package/dist/lib/api-client.js +173 -0
- package/dist/tools/audit-google-business-profile.d.ts +24 -0
- package/dist/tools/audit-google-business-profile.js +27 -0
- package/dist/tools/create-oauth-client.d.ts +40 -0
- package/dist/tools/create-oauth-client.js +20 -0
- package/dist/tools/create-post.d.ts +7 -20
- package/dist/tools/create-post.js +4 -3
- package/dist/tools/create-posts-batch.d.ts +5 -5
- package/dist/tools/create-signed-upload.d.ts +24 -0
- package/dist/tools/create-signed-upload.js +20 -0
- package/dist/tools/create-webhook.d.ts +36 -0
- package/dist/tools/create-webhook.js +20 -0
- package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
- package/dist/tools/delete-google-business-review-reply.js +17 -0
- package/dist/tools/delete-oauth-client.d.ts +20 -0
- package/dist/tools/delete-oauth-client.js +13 -0
- package/dist/tools/delete-post-group.d.ts +20 -0
- package/dist/tools/delete-post-group.js +13 -0
- package/dist/tools/delete-webhook.d.ts +20 -0
- package/dist/tools/delete-webhook.js +13 -0
- package/dist/tools/disconnect-account.d.ts +20 -0
- package/dist/tools/disconnect-account.js +22 -0
- package/dist/tools/generate-image.d.ts +4 -4
- package/dist/tools/generate-video.d.ts +59 -0
- package/dist/tools/generate-video.js +34 -0
- package/dist/tools/get-connect-link.d.ts +24 -0
- package/dist/tools/get-connect-link.js +46 -0
- package/dist/tools/get-google-business-review-link.d.ts +24 -0
- package/dist/tools/get-google-business-review-link.js +19 -0
- package/dist/tools/get-platform-schema.d.ts +24 -0
- package/dist/tools/get-platform-schema.js +44 -0
- package/dist/tools/get-post-missing.d.ts +16 -0
- package/dist/tools/get-post-missing.js +12 -0
- package/dist/tools/get-video-job.d.ts +24 -0
- package/dist/tools/get-video-job.js +31 -0
- package/dist/tools/get-video-options.d.ts +8 -0
- package/dist/tools/get-video-options.js +26 -0
- package/dist/tools/get-x-posting-quota.d.ts +16 -0
- package/dist/tools/get-x-posting-quota.js +21 -0
- package/dist/tools/list-activity.d.ts +32 -0
- package/dist/tools/list-activity.js +35 -0
- package/dist/tools/list-google-business-reviews.d.ts +32 -0
- package/dist/tools/list-google-business-reviews.js +28 -0
- package/dist/tools/list-oauth-clients.d.ts +8 -0
- package/dist/tools/list-oauth-clients.js +15 -0
- package/dist/tools/list-platforms.d.ts +16 -0
- package/dist/tools/list-platforms.js +20 -0
- package/dist/tools/list-posts.d.ts +3 -3
- package/dist/tools/list-posts.js +3 -2
- package/dist/tools/list-webhooks.d.ts +16 -0
- package/dist/tools/list-webhooks.js +24 -0
- package/dist/tools/reply-google-business-review.d.ts +36 -0
- package/dist/tools/reply-google-business-review.js +18 -0
- package/dist/tools/run-video-function.d.ts +24 -0
- package/dist/tools/run-video-function.js +25 -0
- package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
- package/dist/tools/suggest-google-business-review-reply.js +27 -0
- package/dist/tools/test-webhook.d.ts +20 -0
- package/dist/tools/test-webhook.js +14 -0
- package/dist/tools/trigger-platform-helper.d.ts +28 -0
- package/dist/tools/trigger-platform-helper.js +22 -0
- package/dist/tools/update-oauth-client.d.ts +44 -0
- package/dist/tools/update-oauth-client.js +21 -0
- package/dist/tools/update-post-release-id.d.ts +28 -0
- package/dist/tools/update-post-release-id.js +18 -0
- package/dist/tools/update-post-status.d.ts +28 -0
- package/dist/tools/update-post-status.js +23 -0
- package/dist/tools/update-post.js +1 -1
- package/dist/tools/update-webhook.d.ts +40 -0
- package/dist/tools/update-webhook.js +21 -0
- package/dist/tools/upload-media-from-url.d.ts +24 -0
- package/dist/tools/upload-media-from-url.js +26 -0
- package/dist/tools/webhook-events.d.ts +3 -0
- package/dist/tools/webhook-events.js +13 -0
- package/package.json +1 -1
- package/src/generated/platform-manifest.ts +695 -0
- package/src/index.ts +481 -1
- package/src/lib/api-client.ts +461 -0
- package/src/tools/audit-google-business-profile.ts +38 -0
- package/src/tools/create-oauth-client.ts +36 -0
- package/src/tools/create-post.ts +5 -17
- package/src/tools/create-signed-upload.ts +27 -0
- package/src/tools/create-webhook.ts +35 -0
- package/src/tools/delete-google-business-review-reply.ts +30 -0
- package/src/tools/delete-oauth-client.ts +23 -0
- package/src/tools/delete-post-group.ts +17 -0
- package/src/tools/delete-webhook.ts +18 -0
- package/src/tools/disconnect-account.ts +30 -0
- package/src/tools/generate-video.ts +38 -0
- package/src/tools/get-connect-link.ts +56 -0
- package/src/tools/get-google-business-review-link.ts +30 -0
- package/src/tools/get-platform-schema.ts +52 -0
- package/src/tools/get-post-missing.ts +17 -0
- package/src/tools/get-video-job.ts +36 -0
- package/src/tools/get-video-options.ts +30 -0
- package/src/tools/get-x-posting-quota.ts +25 -0
- package/src/tools/list-activity.ts +51 -0
- package/src/tools/list-google-business-reviews.ts +43 -0
- package/src/tools/list-oauth-clients.ts +18 -0
- package/src/tools/list-platforms.ts +25 -0
- package/src/tools/list-posts.ts +3 -2
- package/src/tools/list-webhooks.ts +30 -0
- package/src/tools/reply-google-business-review.ts +32 -0
- package/src/tools/run-video-function.ts +32 -0
- package/src/tools/suggest-google-business-review-reply.ts +44 -0
- package/src/tools/test-webhook.ts +18 -0
- package/src/tools/trigger-platform-helper.ts +34 -0
- package/src/tools/update-oauth-client.ts +38 -0
- package/src/tools/update-post-release-id.ts +26 -0
- package/src/tools/update-post-status.ts +31 -0
- package/src/tools/update-post.ts +1 -1
- package/src/tools/update-webhook.ts +37 -0
- package/src/tools/upload-media-from-url.ts +33 -0
- package/src/tools/webhook-events.ts +16 -0
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -232,6 +232,163 @@ export interface PostAnalyticsResponse {
|
|
|
232
232
|
limit: number;
|
|
233
233
|
offset: number;
|
|
234
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
|
+
}
|
|
235
392
|
export declare class PosterlyClient {
|
|
236
393
|
private baseUrl;
|
|
237
394
|
private apiKey;
|
|
@@ -241,6 +398,42 @@ export declare class PosterlyClient {
|
|
|
241
398
|
listAccounts(params?: {
|
|
242
399
|
workspace_id?: string;
|
|
243
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
|
+
}>;
|
|
244
437
|
listBrands(params?: {
|
|
245
438
|
workspace_id?: string;
|
|
246
439
|
}): Promise<Brand[]>;
|
|
@@ -269,6 +462,7 @@ export declare class PosterlyClient {
|
|
|
269
462
|
getPost(id: number): Promise<{
|
|
270
463
|
post: Post;
|
|
271
464
|
}>;
|
|
465
|
+
getPostMissing(id: number): Promise<Record<string, any>>;
|
|
272
466
|
updatePost(id: number, data: {
|
|
273
467
|
caption?: string;
|
|
274
468
|
scheduled_at?: string;
|
|
@@ -287,6 +481,15 @@ export declare class PosterlyClient {
|
|
|
287
481
|
deleted: boolean;
|
|
288
482
|
id: number;
|
|
289
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>>;
|
|
290
493
|
generateImage(data: {
|
|
291
494
|
prompt: string;
|
|
292
495
|
aspect_ratio?: string;
|
|
@@ -312,6 +515,36 @@ export declare class PosterlyClient {
|
|
|
312
515
|
billed_from: 'plan_quota' | 'credits';
|
|
313
516
|
};
|
|
314
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
|
+
}>;
|
|
315
548
|
findAvailableSlots(params?: {
|
|
316
549
|
account_ids?: string[];
|
|
317
550
|
timezone?: string;
|
|
@@ -330,6 +563,108 @@ export declare class PosterlyClient {
|
|
|
330
563
|
limit?: number;
|
|
331
564
|
offset?: number;
|
|
332
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>;
|
|
333
668
|
getSignedUploadUrl(filename: string, contentType: string, size: number): Promise<{
|
|
334
669
|
upload_url: string;
|
|
335
670
|
token: string;
|
|
@@ -345,4 +680,15 @@ export declare class PosterlyClient {
|
|
|
345
680
|
url: string;
|
|
346
681
|
path: string;
|
|
347
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
|
+
}>;
|
|
348
694
|
}
|
package/dist/lib/api-client.js
CHANGED
|
@@ -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)
|
|
@@ -85,15 +112,48 @@ export class PosterlyClient {
|
|
|
85
112
|
async getPost(id) {
|
|
86
113
|
return this.request('GET', `/posts/${id}`);
|
|
87
114
|
}
|
|
115
|
+
async getPostMissing(id) {
|
|
116
|
+
return this.request('GET', `/posts/${id}/missing`);
|
|
117
|
+
}
|
|
88
118
|
async updatePost(id, data) {
|
|
89
119
|
return this.request('PATCH', `/posts/${id}`, data);
|
|
90
120
|
}
|
|
91
121
|
async deletePost(id) {
|
|
92
122
|
return this.request('DELETE', `/posts/${id}`);
|
|
93
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
|
+
}
|
|
94
133
|
async generateImage(data) {
|
|
95
134
|
return this.request('POST', '/ai/generate-image', data);
|
|
96
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
|
+
}
|
|
97
157
|
async findAvailableSlots(params) {
|
|
98
158
|
const searchParams = new URLSearchParams();
|
|
99
159
|
if (params?.account_ids?.length)
|
|
@@ -130,6 +190,112 @@ export class PosterlyClient {
|
|
|
130
190
|
searchParams.set('offset', String(params.offset));
|
|
131
191
|
return this.request('GET', `/analytics/posts?${searchParams.toString()}`);
|
|
132
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
|
+
}
|
|
133
299
|
async getSignedUploadUrl(filename, contentType, size) {
|
|
134
300
|
return this.request('POST', '/media/signed-upload', {
|
|
135
301
|
filename,
|
|
@@ -175,6 +341,13 @@ export class PosterlyClient {
|
|
|
175
341
|
content_type: contentType,
|
|
176
342
|
});
|
|
177
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
|
+
}
|
|
178
351
|
}
|
|
179
352
|
function guessContentType(filename) {
|
|
180
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const auditGoogleBusinessProfileTool = {
|
|
3
|
+
name: 'audit_google_business_profile',
|
|
4
|
+
description: 'Run a live local-profile audit for a connected Google Business Profile location, including completeness, categories, media, attributes, reviews, and recommendations.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
7
|
+
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
8
|
+
location_id: z.string().optional().describe('Google Business location/platform_user_id.'),
|
|
9
|
+
}),
|
|
10
|
+
async execute(client, input) {
|
|
11
|
+
const result = await client.auditGoogleBusinessProfile(input);
|
|
12
|
+
const audit = result.audit || {};
|
|
13
|
+
const recommendations = Array.isArray(audit.recommendations) ? audit.recommendations : [];
|
|
14
|
+
const lines = [
|
|
15
|
+
`Google Business audit: ${audit.businessName || 'Unknown business'}`,
|
|
16
|
+
`Score: ${audit.overallScore ?? 'n/a'} (${audit.overallGrade || 'n/a'})`,
|
|
17
|
+
`Fetched: ${result.fetchedAt || 'unknown'}`,
|
|
18
|
+
];
|
|
19
|
+
if (recommendations.length > 0) {
|
|
20
|
+
lines.push('Top recommendations:');
|
|
21
|
+
for (const rec of recommendations.slice(0, 5)) {
|
|
22
|
+
lines.push(`- ${rec.priority || 'medium'}: ${rec.description || rec.title || 'Recommendation'}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return lines.join('\n');
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const createOAuthClientTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
client_name: z.ZodString;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
10
|
+
allowed_redirect_uris: z.ZodArray<z.ZodString, "many">;
|
|
11
|
+
default_scopes: z.ZodArray<z.ZodEnum<["accounts:read", "accounts:write", "posts:read", "posts:write", "media:write", "analytics:read"]>, "many">;
|
|
12
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
confirm: z.ZodLiteral<true>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
confirm: true;
|
|
16
|
+
client_name: string;
|
|
17
|
+
allowed_redirect_uris: string[];
|
|
18
|
+
default_scopes: ("accounts:read" | "accounts:write" | "posts:read" | "posts:write" | "media:write" | "analytics:read")[];
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
is_active?: boolean | undefined;
|
|
21
|
+
homepage?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
confirm: true;
|
|
24
|
+
client_name: string;
|
|
25
|
+
allowed_redirect_uris: string[];
|
|
26
|
+
default_scopes: ("accounts:read" | "accounts:write" | "posts:read" | "posts:write" | "media:write" | "analytics:read")[];
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
is_active?: boolean | undefined;
|
|
29
|
+
homepage?: string | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
execute(client: PosterlyClient, input: {
|
|
32
|
+
client_name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
homepage?: string;
|
|
35
|
+
allowed_redirect_uris: string[];
|
|
36
|
+
default_scopes: string[];
|
|
37
|
+
is_active?: boolean;
|
|
38
|
+
confirm: true;
|
|
39
|
+
}): Promise<string>;
|
|
40
|
+
};
|