@memberjunction/actions-bizapps-social 2.61.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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +16 -0
- package/README.md +375 -0
- package/dist/base/base-social.action.d.ts +137 -0
- package/dist/base/base-social.action.d.ts.map +1 -0
- package/dist/base/base-social.action.js +176 -0
- package/dist/base/base-social.action.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/buffer/actions/create-post.action.d.ts +20 -0
- package/dist/providers/buffer/actions/create-post.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/create-post.action.js +195 -0
- package/dist/providers/buffer/actions/create-post.action.js.map +1 -0
- package/dist/providers/buffer/actions/delete-post.action.d.ts +20 -0
- package/dist/providers/buffer/actions/delete-post.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/delete-post.action.js +119 -0
- package/dist/providers/buffer/actions/delete-post.action.js.map +1 -0
- package/dist/providers/buffer/actions/get-analytics.action.d.ts +28 -0
- package/dist/providers/buffer/actions/get-analytics.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/get-analytics.action.js +143 -0
- package/dist/providers/buffer/actions/get-analytics.action.js.map +1 -0
- package/dist/providers/buffer/actions/get-pending-posts.action.d.ts +24 -0
- package/dist/providers/buffer/actions/get-pending-posts.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/get-pending-posts.action.js +161 -0
- package/dist/providers/buffer/actions/get-pending-posts.action.js.map +1 -0
- package/dist/providers/buffer/actions/get-profiles.action.d.ts +24 -0
- package/dist/providers/buffer/actions/get-profiles.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/get-profiles.action.js +128 -0
- package/dist/providers/buffer/actions/get-profiles.action.js.map +1 -0
- package/dist/providers/buffer/actions/get-sent-posts.action.d.ts +32 -0
- package/dist/providers/buffer/actions/get-sent-posts.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/get-sent-posts.action.js +187 -0
- package/dist/providers/buffer/actions/get-sent-posts.action.js.map +1 -0
- package/dist/providers/buffer/actions/index.d.ts +9 -0
- package/dist/providers/buffer/actions/index.d.ts.map +1 -0
- package/dist/providers/buffer/actions/index.js +25 -0
- package/dist/providers/buffer/actions/index.js.map +1 -0
- package/dist/providers/buffer/actions/reorder-queue.action.d.ts +20 -0
- package/dist/providers/buffer/actions/reorder-queue.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/reorder-queue.action.js +138 -0
- package/dist/providers/buffer/actions/reorder-queue.action.js.map +1 -0
- package/dist/providers/buffer/actions/search-posts.action.d.ts +28 -0
- package/dist/providers/buffer/actions/search-posts.action.d.ts.map +1 -0
- package/dist/providers/buffer/actions/search-posts.action.js +249 -0
- package/dist/providers/buffer/actions/search-posts.action.js.map +1 -0
- package/dist/providers/buffer/buffer-base.action.d.ts +95 -0
- package/dist/providers/buffer/buffer-base.action.d.ts.map +1 -0
- package/dist/providers/buffer/buffer-base.action.js +419 -0
- package/dist/providers/buffer/buffer-base.action.js.map +1 -0
- package/dist/providers/buffer/index.d.ts +3 -0
- package/dist/providers/buffer/index.d.ts.map +1 -0
- package/dist/providers/buffer/index.js +19 -0
- package/dist/providers/buffer/index.js.map +1 -0
- package/dist/providers/facebook/actions/boost-post.action.d.ts +45 -0
- package/dist/providers/facebook/actions/boost-post.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/boost-post.action.js +340 -0
- package/dist/providers/facebook/actions/boost-post.action.js.map +1 -0
- package/dist/providers/facebook/actions/create-album.action.d.ts +33 -0
- package/dist/providers/facebook/actions/create-album.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/create-album.action.js +285 -0
- package/dist/providers/facebook/actions/create-album.action.js.map +1 -0
- package/dist/providers/facebook/actions/create-post.action.d.ts +21 -0
- package/dist/providers/facebook/actions/create-post.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/create-post.action.js +223 -0
- package/dist/providers/facebook/actions/create-post.action.js.map +1 -0
- package/dist/providers/facebook/actions/get-page-insights.action.d.ts +37 -0
- package/dist/providers/facebook/actions/get-page-insights.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/get-page-insights.action.js +359 -0
- package/dist/providers/facebook/actions/get-page-insights.action.js.map +1 -0
- package/dist/providers/facebook/actions/get-page-posts.action.d.ts +29 -0
- package/dist/providers/facebook/actions/get-page-posts.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/get-page-posts.action.js +216 -0
- package/dist/providers/facebook/actions/get-page-posts.action.js.map +1 -0
- package/dist/providers/facebook/actions/get-post-insights.action.d.ts +33 -0
- package/dist/providers/facebook/actions/get-post-insights.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/get-post-insights.action.js +287 -0
- package/dist/providers/facebook/actions/get-post-insights.action.js.map +1 -0
- package/dist/providers/facebook/actions/index.d.ts +10 -0
- package/dist/providers/facebook/actions/index.d.ts.map +1 -0
- package/dist/providers/facebook/actions/index.js +26 -0
- package/dist/providers/facebook/actions/index.js.map +1 -0
- package/dist/providers/facebook/actions/respond-to-comments.action.d.ts +41 -0
- package/dist/providers/facebook/actions/respond-to-comments.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/respond-to-comments.action.js +328 -0
- package/dist/providers/facebook/actions/respond-to-comments.action.js.map +1 -0
- package/dist/providers/facebook/actions/schedule-post.action.d.ts +29 -0
- package/dist/providers/facebook/actions/schedule-post.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/schedule-post.action.js +289 -0
- package/dist/providers/facebook/actions/schedule-post.action.js.map +1 -0
- package/dist/providers/facebook/actions/search-posts.action.d.ts +54 -0
- package/dist/providers/facebook/actions/search-posts.action.d.ts.map +1 -0
- package/dist/providers/facebook/actions/search-posts.action.js +396 -0
- package/dist/providers/facebook/actions/search-posts.action.js.map +1 -0
- package/dist/providers/facebook/facebook-base.action.d.ts +230 -0
- package/dist/providers/facebook/facebook-base.action.d.ts.map +1 -0
- package/dist/providers/facebook/facebook-base.action.js +566 -0
- package/dist/providers/facebook/facebook-base.action.js.map +1 -0
- package/dist/providers/facebook/index.d.ts +3 -0
- package/dist/providers/facebook/index.d.ts.map +1 -0
- package/dist/providers/facebook/index.js +19 -0
- package/dist/providers/facebook/index.js.map +1 -0
- package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.d.ts +24 -0
- package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.js +266 -0
- package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/create-scheduled-post.action.d.ts +25 -0
- package/dist/providers/hootsuite/actions/create-scheduled-post.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/create-scheduled-post.action.js +202 -0
- package/dist/providers/hootsuite/actions/create-scheduled-post.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/delete-scheduled-post.action.d.ts +20 -0
- package/dist/providers/hootsuite/actions/delete-scheduled-post.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/delete-scheduled-post.action.js +172 -0
- package/dist/providers/hootsuite/actions/delete-scheduled-post.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/get-analytics.action.d.ts +52 -0
- package/dist/providers/hootsuite/actions/get-analytics.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/get-analytics.action.js +265 -0
- package/dist/providers/hootsuite/actions/get-analytics.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/get-scheduled-posts.action.d.ts +37 -0
- package/dist/providers/hootsuite/actions/get-scheduled-posts.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/get-scheduled-posts.action.js +208 -0
- package/dist/providers/hootsuite/actions/get-scheduled-posts.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/get-social-profiles.action.d.ts +36 -0
- package/dist/providers/hootsuite/actions/get-social-profiles.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/get-social-profiles.action.js +212 -0
- package/dist/providers/hootsuite/actions/get-social-profiles.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/search-posts.action.d.ts +53 -0
- package/dist/providers/hootsuite/actions/search-posts.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/search-posts.action.js +353 -0
- package/dist/providers/hootsuite/actions/search-posts.action.js.map +1 -0
- package/dist/providers/hootsuite/actions/update-scheduled-post.action.d.ts +20 -0
- package/dist/providers/hootsuite/actions/update-scheduled-post.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/actions/update-scheduled-post.action.js +217 -0
- package/dist/providers/hootsuite/actions/update-scheduled-post.action.js.map +1 -0
- package/dist/providers/hootsuite/hootsuite-base.action.d.ts +101 -0
- package/dist/providers/hootsuite/hootsuite-base.action.d.ts.map +1 -0
- package/dist/providers/hootsuite/hootsuite-base.action.js +274 -0
- package/dist/providers/hootsuite/hootsuite-base.action.js.map +1 -0
- package/dist/providers/hootsuite/index.d.ts +10 -0
- package/dist/providers/hootsuite/index.d.ts.map +1 -0
- package/dist/providers/hootsuite/index.js +28 -0
- package/dist/providers/hootsuite/index.js.map +1 -0
- package/dist/providers/instagram/actions/create-post.action.d.ts +30 -0
- package/dist/providers/instagram/actions/create-post.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/create-post.action.js +269 -0
- package/dist/providers/instagram/actions/create-post.action.js.map +1 -0
- package/dist/providers/instagram/actions/create-story.action.d.ts +43 -0
- package/dist/providers/instagram/actions/create-story.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/create-story.action.js +365 -0
- package/dist/providers/instagram/actions/create-story.action.js.map +1 -0
- package/dist/providers/instagram/actions/get-account-insights.action.d.ts +50 -0
- package/dist/providers/instagram/actions/get-account-insights.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/get-account-insights.action.js +390 -0
- package/dist/providers/instagram/actions/get-account-insights.action.js.map +1 -0
- package/dist/providers/instagram/actions/get-business-posts.action.d.ts +30 -0
- package/dist/providers/instagram/actions/get-business-posts.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/get-business-posts.action.js +246 -0
- package/dist/providers/instagram/actions/get-business-posts.action.js.map +1 -0
- package/dist/providers/instagram/actions/get-comments.action.d.ts +41 -0
- package/dist/providers/instagram/actions/get-comments.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/get-comments.action.js +337 -0
- package/dist/providers/instagram/actions/get-comments.action.js.map +1 -0
- package/dist/providers/instagram/actions/get-post-insights.action.d.ts +42 -0
- package/dist/providers/instagram/actions/get-post-insights.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/get-post-insights.action.js +271 -0
- package/dist/providers/instagram/actions/get-post-insights.action.js.map +1 -0
- package/dist/providers/instagram/actions/index.d.ts +9 -0
- package/dist/providers/instagram/actions/index.d.ts.map +1 -0
- package/dist/providers/instagram/actions/index.js +26 -0
- package/dist/providers/instagram/actions/index.js.map +1 -0
- package/dist/providers/instagram/actions/schedule-post.action.d.ts +34 -0
- package/dist/providers/instagram/actions/schedule-post.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/schedule-post.action.js +234 -0
- package/dist/providers/instagram/actions/schedule-post.action.js.map +1 -0
- package/dist/providers/instagram/actions/search-posts.action.d.ts +56 -0
- package/dist/providers/instagram/actions/search-posts.action.d.ts.map +1 -0
- package/dist/providers/instagram/actions/search-posts.action.js +479 -0
- package/dist/providers/instagram/actions/search-posts.action.js.map +1 -0
- package/dist/providers/instagram/index.d.ts +3 -0
- package/dist/providers/instagram/index.d.ts.map +1 -0
- package/dist/providers/instagram/index.js +20 -0
- package/dist/providers/instagram/index.js.map +1 -0
- package/dist/providers/instagram/instagram-base.action.d.ts +76 -0
- package/dist/providers/instagram/instagram-base.action.d.ts.map +1 -0
- package/dist/providers/instagram/instagram-base.action.js +362 -0
- package/dist/providers/instagram/instagram-base.action.js.map +1 -0
- package/dist/providers/linkedin/actions/create-article.action.d.ts +28 -0
- package/dist/providers/linkedin/actions/create-article.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/create-article.action.js +275 -0
- package/dist/providers/linkedin/actions/create-article.action.js.map +1 -0
- package/dist/providers/linkedin/actions/create-post.action.d.ts +20 -0
- package/dist/providers/linkedin/actions/create-post.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/create-post.action.js +188 -0
- package/dist/providers/linkedin/actions/create-post.action.js.map +1 -0
- package/dist/providers/linkedin/actions/get-followers.action.d.ts +29 -0
- package/dist/providers/linkedin/actions/get-followers.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/get-followers.action.js +222 -0
- package/dist/providers/linkedin/actions/get-followers.action.js.map +1 -0
- package/dist/providers/linkedin/actions/get-organization-posts.action.d.ts +24 -0
- package/dist/providers/linkedin/actions/get-organization-posts.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/get-organization-posts.action.js +163 -0
- package/dist/providers/linkedin/actions/get-organization-posts.action.js.map +1 -0
- package/dist/providers/linkedin/actions/get-personal-posts.action.d.ts +25 -0
- package/dist/providers/linkedin/actions/get-personal-posts.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/get-personal-posts.action.js +156 -0
- package/dist/providers/linkedin/actions/get-personal-posts.action.js.map +1 -0
- package/dist/providers/linkedin/actions/get-post-analytics.action.d.ts +28 -0
- package/dist/providers/linkedin/actions/get-post-analytics.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/get-post-analytics.action.js +200 -0
- package/dist/providers/linkedin/actions/get-post-analytics.action.js.map +1 -0
- package/dist/providers/linkedin/actions/index.d.ts +9 -0
- package/dist/providers/linkedin/actions/index.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/index.js +25 -0
- package/dist/providers/linkedin/actions/index.js.map +1 -0
- package/dist/providers/linkedin/actions/schedule-post.action.d.ts +22 -0
- package/dist/providers/linkedin/actions/schedule-post.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/schedule-post.action.js +205 -0
- package/dist/providers/linkedin/actions/schedule-post.action.js.map +1 -0
- package/dist/providers/linkedin/actions/search-posts.action.d.ts +41 -0
- package/dist/providers/linkedin/actions/search-posts.action.d.ts.map +1 -0
- package/dist/providers/linkedin/actions/search-posts.action.js +292 -0
- package/dist/providers/linkedin/actions/search-posts.action.js.map +1 -0
- package/dist/providers/linkedin/index.d.ts +3 -0
- package/dist/providers/linkedin/index.d.ts.map +1 -0
- package/dist/providers/linkedin/index.js +19 -0
- package/dist/providers/linkedin/index.js.map +1 -0
- package/dist/providers/linkedin/linkedin-base.action.d.ts +166 -0
- package/dist/providers/linkedin/linkedin-base.action.d.ts.map +1 -0
- package/dist/providers/linkedin/linkedin-base.action.js +346 -0
- package/dist/providers/linkedin/linkedin-base.action.js.map +1 -0
- package/dist/providers/tiktok/actions/create-video-post.action.d.ts +21 -0
- package/dist/providers/tiktok/actions/create-video-post.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/create-video-post.action.js +226 -0
- package/dist/providers/tiktok/actions/create-video-post.action.js.map +1 -0
- package/dist/providers/tiktok/actions/get-account-analytics.action.d.ts +32 -0
- package/dist/providers/tiktok/actions/get-account-analytics.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/get-account-analytics.action.js +242 -0
- package/dist/providers/tiktok/actions/get-account-analytics.action.js.map +1 -0
- package/dist/providers/tiktok/actions/get-comments.action.d.ts +44 -0
- package/dist/providers/tiktok/actions/get-comments.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/get-comments.action.js +290 -0
- package/dist/providers/tiktok/actions/get-comments.action.js.map +1 -0
- package/dist/providers/tiktok/actions/get-trending-hashtags.action.d.ts +48 -0
- package/dist/providers/tiktok/actions/get-trending-hashtags.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/get-trending-hashtags.action.js +309 -0
- package/dist/providers/tiktok/actions/get-trending-hashtags.action.js.map +1 -0
- package/dist/providers/tiktok/actions/get-user-videos.action.d.ts +20 -0
- package/dist/providers/tiktok/actions/get-user-videos.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/get-user-videos.action.js +131 -0
- package/dist/providers/tiktok/actions/get-user-videos.action.js.map +1 -0
- package/dist/providers/tiktok/actions/get-video-analytics.action.d.ts +28 -0
- package/dist/providers/tiktok/actions/get-video-analytics.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/get-video-analytics.action.js +198 -0
- package/dist/providers/tiktok/actions/get-video-analytics.action.js.map +1 -0
- package/dist/providers/tiktok/actions/index.d.ts +8 -0
- package/dist/providers/tiktok/actions/index.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/index.js +25 -0
- package/dist/providers/tiktok/actions/index.js.map +1 -0
- package/dist/providers/tiktok/actions/search-videos.action.d.ts +89 -0
- package/dist/providers/tiktok/actions/search-videos.action.d.ts.map +1 -0
- package/dist/providers/tiktok/actions/search-videos.action.js +653 -0
- package/dist/providers/tiktok/actions/search-videos.action.js.map +1 -0
- package/dist/providers/tiktok/index.d.ts +3 -0
- package/dist/providers/tiktok/index.d.ts.map +1 -0
- package/dist/providers/tiktok/index.js +20 -0
- package/dist/providers/tiktok/index.js.map +1 -0
- package/dist/providers/tiktok/tiktok-base.action.d.ts +87 -0
- package/dist/providers/tiktok/tiktok-base.action.d.ts.map +1 -0
- package/dist/providers/tiktok/tiktok-base.action.js +294 -0
- package/dist/providers/tiktok/tiktok-base.action.js.map +1 -0
- package/dist/providers/twitter/actions/create-thread.action.d.ts +28 -0
- package/dist/providers/twitter/actions/create-thread.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/create-thread.action.js +217 -0
- package/dist/providers/twitter/actions/create-thread.action.js.map +1 -0
- package/dist/providers/twitter/actions/create-tweet.action.d.ts +24 -0
- package/dist/providers/twitter/actions/create-tweet.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/create-tweet.action.js +199 -0
- package/dist/providers/twitter/actions/create-tweet.action.js.map +1 -0
- package/dist/providers/twitter/actions/delete-tweet.action.d.ts +24 -0
- package/dist/providers/twitter/actions/delete-tweet.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/delete-tweet.action.js +158 -0
- package/dist/providers/twitter/actions/delete-tweet.action.js.map +1 -0
- package/dist/providers/twitter/actions/get-analytics.action.d.ts +44 -0
- package/dist/providers/twitter/actions/get-analytics.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/get-analytics.action.js +399 -0
- package/dist/providers/twitter/actions/get-analytics.action.js.map +1 -0
- package/dist/providers/twitter/actions/get-mentions.action.d.ts +24 -0
- package/dist/providers/twitter/actions/get-mentions.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/get-mentions.action.js +229 -0
- package/dist/providers/twitter/actions/get-mentions.action.js.map +1 -0
- package/dist/providers/twitter/actions/get-timeline.action.d.ts +24 -0
- package/dist/providers/twitter/actions/get-timeline.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/get-timeline.action.js +249 -0
- package/dist/providers/twitter/actions/get-timeline.action.js.map +1 -0
- package/dist/providers/twitter/actions/index.d.ts +14 -0
- package/dist/providers/twitter/actions/index.d.ts.map +1 -0
- package/dist/providers/twitter/actions/index.js +30 -0
- package/dist/providers/twitter/actions/index.js.map +1 -0
- package/dist/providers/twitter/actions/schedule-tweet.action.d.ts +30 -0
- package/dist/providers/twitter/actions/schedule-tweet.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/schedule-tweet.action.js +250 -0
- package/dist/providers/twitter/actions/schedule-tweet.action.js.map +1 -0
- package/dist/providers/twitter/actions/search-tweets.action.d.ts +41 -0
- package/dist/providers/twitter/actions/search-tweets.action.d.ts.map +1 -0
- package/dist/providers/twitter/actions/search-tweets.action.js +559 -0
- package/dist/providers/twitter/actions/search-tweets.action.js.map +1 -0
- package/dist/providers/twitter/index.d.ts +8 -0
- package/dist/providers/twitter/index.d.ts.map +1 -0
- package/dist/providers/twitter/index.js +24 -0
- package/dist/providers/twitter/index.js.map +1 -0
- package/dist/providers/twitter/twitter-base.action.d.ts +185 -0
- package/dist/providers/twitter/twitter-base.action.d.ts.map +1 -0
- package/dist/providers/twitter/twitter-base.action.js +484 -0
- package/dist/providers/twitter/twitter-base.action.js.map +1 -0
- package/dist/providers/youtube/actions/create-playlist.action.d.ts +28 -0
- package/dist/providers/youtube/actions/create-playlist.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/create-playlist.action.js +235 -0
- package/dist/providers/youtube/actions/create-playlist.action.js.map +1 -0
- package/dist/providers/youtube/actions/get-channel-analytics.action.d.ts +60 -0
- package/dist/providers/youtube/actions/get-channel-analytics.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/get-channel-analytics.action.js +429 -0
- package/dist/providers/youtube/actions/get-channel-analytics.action.js.map +1 -0
- package/dist/providers/youtube/actions/get-channel-videos.action.d.ts +28 -0
- package/dist/providers/youtube/actions/get-channel-videos.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/get-channel-videos.action.js +263 -0
- package/dist/providers/youtube/actions/get-channel-videos.action.js.map +1 -0
- package/dist/providers/youtube/actions/get-comments.action.d.ts +40 -0
- package/dist/providers/youtube/actions/get-comments.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/get-comments.action.js +381 -0
- package/dist/providers/youtube/actions/get-comments.action.js.map +1 -0
- package/dist/providers/youtube/actions/get-video-analytics.action.d.ts +48 -0
- package/dist/providers/youtube/actions/get-video-analytics.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/get-video-analytics.action.js +280 -0
- package/dist/providers/youtube/actions/get-video-analytics.action.js.map +1 -0
- package/dist/providers/youtube/actions/index.d.ts +10 -0
- package/dist/providers/youtube/actions/index.d.ts.map +1 -0
- package/dist/providers/youtube/actions/index.js +26 -0
- package/dist/providers/youtube/actions/index.js.map +1 -0
- package/dist/providers/youtube/actions/schedule-video.action.d.ts +24 -0
- package/dist/providers/youtube/actions/schedule-video.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/schedule-video.action.js +225 -0
- package/dist/providers/youtube/actions/schedule-video.action.js.map +1 -0
- package/dist/providers/youtube/actions/search-videos.action.d.ts +40 -0
- package/dist/providers/youtube/actions/search-videos.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/search-videos.action.js +483 -0
- package/dist/providers/youtube/actions/search-videos.action.js.map +1 -0
- package/dist/providers/youtube/actions/update-video-metadata.action.d.ts +32 -0
- package/dist/providers/youtube/actions/update-video-metadata.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/update-video-metadata.action.js +298 -0
- package/dist/providers/youtube/actions/update-video-metadata.action.js.map +1 -0
- package/dist/providers/youtube/actions/upload-video.action.d.ts +28 -0
- package/dist/providers/youtube/actions/upload-video.action.d.ts.map +1 -0
- package/dist/providers/youtube/actions/upload-video.action.js +266 -0
- package/dist/providers/youtube/actions/upload-video.action.js.map +1 -0
- package/dist/providers/youtube/index.d.ts +3 -0
- package/dist/providers/youtube/index.d.ts.map +1 -0
- package/dist/providers/youtube/index.js +19 -0
- package/dist/providers/youtube/index.js.map +1 -0
- package/dist/providers/youtube/youtube-base.action.d.ts +83 -0
- package/dist/providers/youtube/youtube-base.action.d.ts.map +1 -0
- package/dist/providers/youtube/youtube-base.action.js +319 -0
- package/dist/providers/youtube/youtube-base.action.js.map +1 -0
- package/package.json +42 -0
- package/social_actions_summary.md +439 -0
- package/src/base/base-social.action.ts +270 -0
- package/src/index.ts +26 -0
- package/src/providers/buffer/actions/create-post.action.ts +205 -0
- package/src/providers/buffer/actions/delete-post.action.ts +116 -0
- package/src/providers/buffer/actions/get-analytics.action.ts +146 -0
- package/src/providers/buffer/actions/get-pending-posts.action.ts +161 -0
- package/src/providers/buffer/actions/get-profiles.action.ts +126 -0
- package/src/providers/buffer/actions/get-sent-posts.action.ts +189 -0
- package/src/providers/buffer/actions/index.ts +8 -0
- package/src/providers/buffer/actions/reorder-queue.action.ts +141 -0
- package/src/providers/buffer/actions/search-posts.action.ts +262 -0
- package/src/providers/buffer/buffer-base.action.ts +490 -0
- package/src/providers/buffer/index.ts +2 -0
- package/src/providers/facebook/actions/boost-post.action.ts +412 -0
- package/src/providers/facebook/actions/create-album.action.ts +335 -0
- package/src/providers/facebook/actions/create-post.action.ts +243 -0
- package/src/providers/facebook/actions/get-page-insights.action.ts +427 -0
- package/src/providers/facebook/actions/get-page-posts.action.ts +241 -0
- package/src/providers/facebook/actions/get-post-insights.action.ts +338 -0
- package/src/providers/facebook/actions/index.ts +9 -0
- package/src/providers/facebook/actions/respond-to-comments.action.ts +372 -0
- package/src/providers/facebook/actions/schedule-post.action.ts +310 -0
- package/src/providers/facebook/actions/search-posts.action.ts +449 -0
- package/src/providers/facebook/facebook-base.action.ts +750 -0
- package/src/providers/facebook/index.ts +2 -0
- package/src/providers/hootsuite/actions/bulk-schedule-posts.action.ts +293 -0
- package/src/providers/hootsuite/actions/create-scheduled-post.action.ts +206 -0
- package/src/providers/hootsuite/actions/delete-scheduled-post.action.ts +173 -0
- package/src/providers/hootsuite/actions/get-analytics.action.ts +281 -0
- package/src/providers/hootsuite/actions/get-scheduled-posts.action.ts +220 -0
- package/src/providers/hootsuite/actions/get-social-profiles.action.ts +220 -0
- package/src/providers/hootsuite/actions/search-posts.action.ts +395 -0
- package/src/providers/hootsuite/actions/update-scheduled-post.action.ts +222 -0
- package/src/providers/hootsuite/hootsuite-base.action.ts +346 -0
- package/src/providers/hootsuite/index.ts +12 -0
- package/src/providers/instagram/README.md +129 -0
- package/src/providers/instagram/actions/create-post.action.ts +329 -0
- package/src/providers/instagram/actions/create-story.action.ts +415 -0
- package/src/providers/instagram/actions/get-account-insights.action.ts +449 -0
- package/src/providers/instagram/actions/get-business-posts.action.ts +281 -0
- package/src/providers/instagram/actions/get-comments.action.ts +395 -0
- package/src/providers/instagram/actions/get-post-insights.action.ts +302 -0
- package/src/providers/instagram/actions/index.ts +9 -0
- package/src/providers/instagram/actions/schedule-post.action.ts +248 -0
- package/src/providers/instagram/actions/search-posts.action.ts +569 -0
- package/src/providers/instagram/index.ts +3 -0
- package/src/providers/instagram/instagram-base.action.ts +430 -0
- package/src/providers/linkedin/actions/create-article.action.ts +301 -0
- package/src/providers/linkedin/actions/create-post.action.ts +190 -0
- package/src/providers/linkedin/actions/get-followers.action.ts +226 -0
- package/src/providers/linkedin/actions/get-organization-posts.action.ts +164 -0
- package/src/providers/linkedin/actions/get-personal-posts.action.ts +158 -0
- package/src/providers/linkedin/actions/get-post-analytics.action.ts +205 -0
- package/src/providers/linkedin/actions/index.ts +8 -0
- package/src/providers/linkedin/actions/schedule-post.action.ts +206 -0
- package/src/providers/linkedin/actions/search-posts.action.ts +323 -0
- package/src/providers/linkedin/index.ts +2 -0
- package/src/providers/linkedin/linkedin-base.action.ts +481 -0
- package/src/providers/tiktok/actions/create-video-post.action.ts +234 -0
- package/src/providers/tiktok/actions/get-account-analytics.action.ts +255 -0
- package/src/providers/tiktok/actions/get-comments.action.ts +332 -0
- package/src/providers/tiktok/actions/get-trending-hashtags.action.ts +341 -0
- package/src/providers/tiktok/actions/get-user-videos.action.ts +136 -0
- package/src/providers/tiktok/actions/get-video-analytics.action.ts +218 -0
- package/src/providers/tiktok/actions/index.ts +8 -0
- package/src/providers/tiktok/actions/search-videos.action.ts +717 -0
- package/src/providers/tiktok/index.ts +3 -0
- package/src/providers/tiktok/tiktok-base.action.ts +356 -0
- package/src/providers/twitter/README.md +207 -0
- package/src/providers/twitter/actions/create-thread.action.ts +227 -0
- package/src/providers/twitter/actions/create-tweet.action.ts +204 -0
- package/src/providers/twitter/actions/delete-tweet.action.ts +153 -0
- package/src/providers/twitter/actions/get-analytics.action.ts +440 -0
- package/src/providers/twitter/actions/get-mentions.action.ts +233 -0
- package/src/providers/twitter/actions/get-timeline.action.ts +248 -0
- package/src/providers/twitter/actions/index.ts +14 -0
- package/src/providers/twitter/actions/schedule-tweet.action.ts +259 -0
- package/src/providers/twitter/actions/search-tweets.action.ts +588 -0
- package/src/providers/twitter/index.ts +8 -0
- package/src/providers/twitter/twitter-base.action.ts +629 -0
- package/src/providers/youtube/actions/create-playlist.action.ts +256 -0
- package/src/providers/youtube/actions/get-channel-analytics.action.ts +502 -0
- package/src/providers/youtube/actions/get-channel-videos.action.ts +286 -0
- package/src/providers/youtube/actions/get-comments.action.ts +411 -0
- package/src/providers/youtube/actions/get-video-analytics.action.ts +298 -0
- package/src/providers/youtube/actions/index.ts +9 -0
- package/src/providers/youtube/actions/schedule-video.action.ts +246 -0
- package/src/providers/youtube/actions/search-videos.action.ts +530 -0
- package/src/providers/youtube/actions/update-video-metadata.action.ts +321 -0
- package/src/providers/youtube/actions/upload-video.action.ts +288 -0
- package/src/providers/youtube/index.ts +2 -0
- package/src/providers/youtube/youtube-base.action.ts +373 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { BaseSocialMediaAction, SocialPost, SocialAnalytics, MediaFile } from '../../base/base-social.action';
|
|
3
|
+
import { UserInfo, LogError, LogStatus } from '@memberjunction/core';
|
|
4
|
+
import axios, { AxiosInstance, AxiosError } from 'axios';
|
|
5
|
+
import FormData from 'form-data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Base class for all Buffer social media actions.
|
|
9
|
+
* Handles Buffer-specific authentication and API interaction patterns.
|
|
10
|
+
*/
|
|
11
|
+
@RegisterClass(BaseSocialMediaAction, 'BufferBaseAction')
|
|
12
|
+
export abstract class BufferBaseAction extends BaseSocialMediaAction {
|
|
13
|
+
protected get platformName(): string {
|
|
14
|
+
return 'Buffer';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected get apiBaseUrl(): string {
|
|
18
|
+
return 'https://api.bufferapp.com/1';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private axiosInstance: AxiosInstance | null = null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get axios instance with authentication
|
|
25
|
+
*/
|
|
26
|
+
protected getAxiosInstance(): AxiosInstance {
|
|
27
|
+
if (!this.axiosInstance) {
|
|
28
|
+
this.axiosInstance = axios.create({
|
|
29
|
+
baseURL: this.apiBaseUrl,
|
|
30
|
+
timeout: 30000,
|
|
31
|
+
headers: {
|
|
32
|
+
'Accept': 'application/json',
|
|
33
|
+
'Content-Type': 'application/json'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Add request interceptor for auth
|
|
38
|
+
this.axiosInstance.interceptors.request.use(
|
|
39
|
+
(config) => {
|
|
40
|
+
const token = this.getAccessToken();
|
|
41
|
+
if (token) {
|
|
42
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
43
|
+
}
|
|
44
|
+
return config;
|
|
45
|
+
},
|
|
46
|
+
(error) => {
|
|
47
|
+
return Promise.reject(error);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Add response interceptor for rate limiting
|
|
52
|
+
this.axiosInstance.interceptors.response.use(
|
|
53
|
+
(response) => {
|
|
54
|
+
// Log rate limit headers if present
|
|
55
|
+
const headers = response.headers;
|
|
56
|
+
const rateLimitInfo = this.parseRateLimitHeaders(headers);
|
|
57
|
+
if (rateLimitInfo) {
|
|
58
|
+
LogStatus(`Buffer API - Remaining requests: ${rateLimitInfo.remaining}/${rateLimitInfo.limit}, Reset: ${rateLimitInfo.reset}`);
|
|
59
|
+
}
|
|
60
|
+
return response;
|
|
61
|
+
},
|
|
62
|
+
async (error: AxiosError) => {
|
|
63
|
+
if (error.response?.status === 429) {
|
|
64
|
+
// Rate limit hit
|
|
65
|
+
const retryAfter = error.response.headers['retry-after'];
|
|
66
|
+
await this.handleRateLimit(retryAfter ? parseInt(retryAfter) : 60);
|
|
67
|
+
// Retry the request
|
|
68
|
+
return this.axiosInstance!.request(error.config!);
|
|
69
|
+
}
|
|
70
|
+
return Promise.reject(error);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return this.axiosInstance;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Refresh access token using refresh token
|
|
79
|
+
*/
|
|
80
|
+
protected async refreshAccessToken(): Promise<void> {
|
|
81
|
+
const refreshToken = this.getRefreshToken();
|
|
82
|
+
if (!refreshToken) {
|
|
83
|
+
throw new Error('No refresh token available for Buffer');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const response = await axios.post(`${this.apiBaseUrl}/oauth2/token`, {
|
|
88
|
+
client_id: this.getCustomAttribute(1), // Store Buffer client ID in CustomAttribute1
|
|
89
|
+
client_secret: this.getCustomAttribute(2), // Store Buffer client secret in CustomAttribute2
|
|
90
|
+
refresh_token: refreshToken,
|
|
91
|
+
grant_type: 'refresh_token'
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const { access_token, expires_in } = response.data;
|
|
95
|
+
|
|
96
|
+
await this.updateStoredTokens(
|
|
97
|
+
access_token,
|
|
98
|
+
refreshToken, // Buffer doesn't rotate refresh tokens
|
|
99
|
+
expires_in
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
LogStatus('Buffer access token refreshed successfully');
|
|
103
|
+
} catch (error) {
|
|
104
|
+
LogError('Failed to refresh Buffer access token:', error);
|
|
105
|
+
throw new Error('Failed to refresh Buffer access token');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get Buffer profiles for the authenticated user
|
|
111
|
+
*/
|
|
112
|
+
protected async getProfiles(): Promise<any[]> {
|
|
113
|
+
try {
|
|
114
|
+
const response = await this.getAxiosInstance().get('/profiles.json');
|
|
115
|
+
return response.data || [];
|
|
116
|
+
} catch (error) {
|
|
117
|
+
LogError('Failed to get Buffer profiles:', error);
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Upload media to Buffer
|
|
124
|
+
*/
|
|
125
|
+
protected async uploadSingleMedia(file: MediaFile): Promise<string> {
|
|
126
|
+
try {
|
|
127
|
+
const formData = new FormData();
|
|
128
|
+
|
|
129
|
+
// Convert base64 to buffer if needed
|
|
130
|
+
const buffer = typeof file.data === 'string'
|
|
131
|
+
? Buffer.from(file.data, 'base64')
|
|
132
|
+
: file.data;
|
|
133
|
+
|
|
134
|
+
formData.append('media', buffer, {
|
|
135
|
+
filename: file.filename,
|
|
136
|
+
contentType: file.mimeType
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const response = await this.getAxiosInstance().post('/updates/media/upload.json', formData, {
|
|
140
|
+
headers: {
|
|
141
|
+
...formData.getHeaders()
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
if (response.data && response.data.media && response.data.media[0]) {
|
|
146
|
+
return response.data.media[0].picture; // URL of uploaded media
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
throw new Error('Failed to upload media to Buffer');
|
|
150
|
+
} catch (error) {
|
|
151
|
+
LogError('Buffer media upload failed:', error);
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Create a Buffer update (post)
|
|
158
|
+
*/
|
|
159
|
+
protected async createUpdate(
|
|
160
|
+
profileIds: string[],
|
|
161
|
+
text: string,
|
|
162
|
+
media?: { link?: string; description?: string; picture?: string }[],
|
|
163
|
+
scheduledAt?: Date,
|
|
164
|
+
options?: {
|
|
165
|
+
shorten?: boolean;
|
|
166
|
+
now?: boolean;
|
|
167
|
+
top?: boolean;
|
|
168
|
+
attachment?: boolean;
|
|
169
|
+
}
|
|
170
|
+
): Promise<any> {
|
|
171
|
+
const data: any = {
|
|
172
|
+
profile_ids: profileIds,
|
|
173
|
+
text: text,
|
|
174
|
+
shorten: options?.shorten !== false // Default to true
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
if (media && media.length > 0) {
|
|
178
|
+
data.media = media;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (scheduledAt) {
|
|
182
|
+
data.scheduled_at = Math.floor(scheduledAt.getTime() / 1000); // Unix timestamp
|
|
183
|
+
} else if (options?.now) {
|
|
184
|
+
data.now = true;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (options?.top) {
|
|
188
|
+
data.top = true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (options?.attachment !== undefined) {
|
|
192
|
+
data.attachment = options.attachment;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
const response = await this.getAxiosInstance().post('/updates/create.json', data);
|
|
197
|
+
return response.data;
|
|
198
|
+
} catch (error) {
|
|
199
|
+
LogError('Failed to create Buffer update:', error);
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Get updates (posts) from Buffer
|
|
206
|
+
*/
|
|
207
|
+
protected async getUpdates(
|
|
208
|
+
profileId: string,
|
|
209
|
+
status: 'pending' | 'sent',
|
|
210
|
+
options?: {
|
|
211
|
+
page?: number;
|
|
212
|
+
count?: number;
|
|
213
|
+
since?: Date;
|
|
214
|
+
utc?: boolean;
|
|
215
|
+
}
|
|
216
|
+
): Promise<any> {
|
|
217
|
+
const params: any = {
|
|
218
|
+
page: options?.page || 1,
|
|
219
|
+
count: options?.count || 10,
|
|
220
|
+
utc: options?.utc !== false // Default to true
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
if (options?.since) {
|
|
224
|
+
params.since = Math.floor(options.since.getTime() / 1000);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
const response = await this.getAxiosInstance().get(
|
|
229
|
+
`/profiles/${profileId}/updates/${status}.json`,
|
|
230
|
+
{ params }
|
|
231
|
+
);
|
|
232
|
+
return response.data;
|
|
233
|
+
} catch (error) {
|
|
234
|
+
LogError(`Failed to get ${status} updates from Buffer:`, error);
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Delete a Buffer update
|
|
241
|
+
*/
|
|
242
|
+
protected async deleteUpdate(updateId: string): Promise<boolean> {
|
|
243
|
+
try {
|
|
244
|
+
const response = await this.getAxiosInstance().post(`/updates/${updateId}/destroy.json`);
|
|
245
|
+
return response.data.success === true;
|
|
246
|
+
} catch (error) {
|
|
247
|
+
LogError('Failed to delete Buffer update:', error);
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Reorder updates in the queue
|
|
254
|
+
*/
|
|
255
|
+
protected async reorderUpdates(profileId: string, updateIds: string[], offset?: number): Promise<any> {
|
|
256
|
+
const data: any = {
|
|
257
|
+
order: updateIds
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
if (offset !== undefined) {
|
|
261
|
+
data.offset = offset;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
const response = await this.getAxiosInstance().post(
|
|
266
|
+
`/profiles/${profileId}/updates/reorder.json`,
|
|
267
|
+
data
|
|
268
|
+
);
|
|
269
|
+
return response.data;
|
|
270
|
+
} catch (error) {
|
|
271
|
+
LogError('Failed to reorder Buffer updates:', error);
|
|
272
|
+
throw error;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get analytics for sent posts
|
|
278
|
+
*/
|
|
279
|
+
protected async getAnalytics(updateId: string): Promise<any> {
|
|
280
|
+
try {
|
|
281
|
+
const response = await this.getAxiosInstance().get(`/updates/${updateId}/interactions.json`);
|
|
282
|
+
return response.data;
|
|
283
|
+
} catch (error) {
|
|
284
|
+
LogError('Failed to get Buffer analytics:', error);
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Search posts implementation for Buffer
|
|
291
|
+
* Buffer doesn't have a native search API, so we'll fetch posts and filter client-side
|
|
292
|
+
*/
|
|
293
|
+
protected async searchPosts(params: {
|
|
294
|
+
query?: string;
|
|
295
|
+
hashtags?: string[];
|
|
296
|
+
startDate?: Date;
|
|
297
|
+
endDate?: Date;
|
|
298
|
+
limit?: number;
|
|
299
|
+
offset?: number;
|
|
300
|
+
profileIds?: string[];
|
|
301
|
+
}): Promise<SocialPost[]> {
|
|
302
|
+
const posts: SocialPost[] = [];
|
|
303
|
+
const profileIds = params.profileIds || [];
|
|
304
|
+
|
|
305
|
+
// If no profile IDs provided, get all profiles
|
|
306
|
+
if (profileIds.length === 0) {
|
|
307
|
+
const profiles = await this.getProfiles();
|
|
308
|
+
profileIds.push(...profiles.map(p => p.id));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Fetch sent posts from each profile
|
|
312
|
+
for (const profileId of profileIds) {
|
|
313
|
+
try {
|
|
314
|
+
let page = 1;
|
|
315
|
+
let hasMore = true;
|
|
316
|
+
|
|
317
|
+
while (hasMore && posts.length < (params.limit || 100)) {
|
|
318
|
+
const result = await this.getUpdates(profileId, 'sent', {
|
|
319
|
+
page: page,
|
|
320
|
+
count: 100,
|
|
321
|
+
since: params.startDate
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
if (result.updates && result.updates.length > 0) {
|
|
325
|
+
for (const update of result.updates) {
|
|
326
|
+
const post = this.normalizePost(update);
|
|
327
|
+
|
|
328
|
+
// Apply filters
|
|
329
|
+
if (this.matchesSearchCriteria(post, params)) {
|
|
330
|
+
posts.push(post);
|
|
331
|
+
|
|
332
|
+
if (posts.length >= (params.limit || 100)) {
|
|
333
|
+
hasMore = false;
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
page++;
|
|
340
|
+
hasMore = result.updates.length === 100;
|
|
341
|
+
} else {
|
|
342
|
+
hasMore = false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
} catch (error) {
|
|
346
|
+
LogError(`Failed to search posts for profile ${profileId}:`, error);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Sort by published date descending
|
|
351
|
+
posts.sort((a, b) => b.publishedAt.getTime() - a.publishedAt.getTime());
|
|
352
|
+
|
|
353
|
+
// Apply offset if specified
|
|
354
|
+
if (params.offset) {
|
|
355
|
+
return posts.slice(params.offset, params.offset + (params.limit || 100));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return posts.slice(0, params.limit || 100);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Check if a post matches search criteria
|
|
363
|
+
*/
|
|
364
|
+
private matchesSearchCriteria(post: SocialPost, params: any): boolean {
|
|
365
|
+
// Check date range
|
|
366
|
+
if (params.endDate && post.publishedAt > params.endDate) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Check query text
|
|
371
|
+
if (params.query) {
|
|
372
|
+
const query = params.query.toLowerCase();
|
|
373
|
+
const content = post.content.toLowerCase();
|
|
374
|
+
if (!content.includes(query)) {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Check hashtags
|
|
380
|
+
if (params.hashtags && params.hashtags.length > 0) {
|
|
381
|
+
const postHashtags = this.extractHashtags(post.content);
|
|
382
|
+
const hasMatchingHashtag = params.hashtags.some(tag =>
|
|
383
|
+
postHashtags.includes(tag.toLowerCase().replace('#', ''))
|
|
384
|
+
);
|
|
385
|
+
if (!hasMatchingHashtag) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Extract hashtags from post content
|
|
395
|
+
*/
|
|
396
|
+
protected extractHashtags(content: string): string[] {
|
|
397
|
+
const regex = /#(\w+)/g;
|
|
398
|
+
const hashtags: string[] = [];
|
|
399
|
+
let match;
|
|
400
|
+
|
|
401
|
+
while ((match = regex.exec(content)) !== null) {
|
|
402
|
+
hashtags.push(match[1].toLowerCase());
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return hashtags;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Normalize Buffer post to common format
|
|
410
|
+
*/
|
|
411
|
+
protected normalizePost(bufferPost: any): SocialPost {
|
|
412
|
+
const media: string[] = [];
|
|
413
|
+
|
|
414
|
+
if (bufferPost.media) {
|
|
415
|
+
if (bufferPost.media.picture) {
|
|
416
|
+
media.push(bufferPost.media.picture);
|
|
417
|
+
}
|
|
418
|
+
if (bufferPost.media.link) {
|
|
419
|
+
media.push(bufferPost.media.link);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return {
|
|
424
|
+
id: bufferPost.id,
|
|
425
|
+
platform: 'Buffer',
|
|
426
|
+
profileId: bufferPost.profile_id,
|
|
427
|
+
content: bufferPost.text || '',
|
|
428
|
+
mediaUrls: media,
|
|
429
|
+
publishedAt: new Date(bufferPost.sent_at * 1000), // Convert Unix timestamp
|
|
430
|
+
scheduledFor: bufferPost.due_at ? new Date(bufferPost.due_at * 1000) : undefined,
|
|
431
|
+
analytics: bufferPost.statistics ? this.normalizeAnalytics(bufferPost.statistics) : undefined,
|
|
432
|
+
platformSpecificData: {
|
|
433
|
+
profileService: bufferPost.profile_service,
|
|
434
|
+
status: bufferPost.status,
|
|
435
|
+
userId: bufferPost.user_id,
|
|
436
|
+
viaName: bufferPost.via,
|
|
437
|
+
sourceUrl: bufferPost.source_url,
|
|
438
|
+
day: bufferPost.day,
|
|
439
|
+
dueTime: bufferPost.due_time,
|
|
440
|
+
mediaDescription: bufferPost.media?.description,
|
|
441
|
+
mediaTitle: bufferPost.media?.title,
|
|
442
|
+
mediaLink: bufferPost.media?.link
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Normalize Buffer analytics to common format
|
|
449
|
+
*/
|
|
450
|
+
protected normalizeAnalytics(bufferStats: any): SocialAnalytics {
|
|
451
|
+
return {
|
|
452
|
+
impressions: bufferStats.reach || 0,
|
|
453
|
+
engagements: (bufferStats.clicks || 0) + (bufferStats.favorites || 0) +
|
|
454
|
+
(bufferStats.mentions || 0) + (bufferStats.retweets || 0) +
|
|
455
|
+
(bufferStats.shares || 0) + (bufferStats.comments || 0),
|
|
456
|
+
clicks: bufferStats.clicks || 0,
|
|
457
|
+
shares: bufferStats.shares || bufferStats.retweets || 0,
|
|
458
|
+
comments: bufferStats.comments || bufferStats.mentions || 0,
|
|
459
|
+
likes: bufferStats.favorites || bufferStats.likes || 0,
|
|
460
|
+
reach: bufferStats.reach || 0,
|
|
461
|
+
saves: undefined,
|
|
462
|
+
videoViews: undefined,
|
|
463
|
+
platformMetrics: bufferStats
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Map Buffer error to our error codes
|
|
469
|
+
*/
|
|
470
|
+
protected mapBufferError(error: any): string {
|
|
471
|
+
if (error.response) {
|
|
472
|
+
const status = error.response.status;
|
|
473
|
+
const data = error.response.data;
|
|
474
|
+
|
|
475
|
+
if (status === 401) {
|
|
476
|
+
return 'INVALID_TOKEN';
|
|
477
|
+
} else if (status === 429) {
|
|
478
|
+
return 'RATE_LIMIT';
|
|
479
|
+
} else if (status === 403) {
|
|
480
|
+
return 'INSUFFICIENT_PERMISSIONS';
|
|
481
|
+
} else if (status === 404) {
|
|
482
|
+
return 'POST_NOT_FOUND';
|
|
483
|
+
} else if (data?.error?.includes('media')) {
|
|
484
|
+
return 'INVALID_MEDIA';
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return 'PLATFORM_ERROR';
|
|
489
|
+
}
|
|
490
|
+
}
|