@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,335 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { FacebookBaseAction, FacebookAlbum } from '../facebook-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { MediaFile, SocialMediaErrorCode } from '../../../base/base-social.action';
|
|
5
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
6
|
+
import axios from 'axios';
|
|
7
|
+
import FormData from 'form-data';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates a photo album on a Facebook page and optionally uploads photos to it.
|
|
11
|
+
* Albums help organize related photos together.
|
|
12
|
+
*/
|
|
13
|
+
@RegisterClass(FacebookBaseAction, 'FacebookCreateAlbumAction')
|
|
14
|
+
export class FacebookCreateAlbumAction extends FacebookBaseAction {
|
|
15
|
+
/**
|
|
16
|
+
* Get action description
|
|
17
|
+
*/
|
|
18
|
+
public get Description(): string {
|
|
19
|
+
return 'Creates a photo album on a Facebook page and optionally uploads photos to it';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Define the parameters for this action
|
|
24
|
+
*/
|
|
25
|
+
public get Params(): ActionParam[] {
|
|
26
|
+
return [
|
|
27
|
+
...this.commonSocialParams,
|
|
28
|
+
{
|
|
29
|
+
Name: 'PageID',
|
|
30
|
+
Type: 'Input',
|
|
31
|
+
Value: null,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
Name: 'AlbumName',
|
|
35
|
+
Type: 'Input',
|
|
36
|
+
Value: null,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
Name: 'Description',
|
|
40
|
+
Type: 'Input',
|
|
41
|
+
Value: null,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
Name: 'Location',
|
|
45
|
+
Type: 'Input',
|
|
46
|
+
Value: null,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
Name: 'Privacy',
|
|
50
|
+
Type: 'Input',
|
|
51
|
+
Value: 'EVERYONE',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
Name: 'Photos',
|
|
55
|
+
Type: 'Input',
|
|
56
|
+
Value: null,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
Name: 'PhotoCaptions',
|
|
60
|
+
Type: 'Input',
|
|
61
|
+
Value: null,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
Name: 'CoverPhotoIndex',
|
|
65
|
+
Type: 'Input',
|
|
66
|
+
Value: 0,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
Name: 'MakeAlbumPublic',
|
|
70
|
+
Type: 'Input',
|
|
71
|
+
Value: true,
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Execute the action
|
|
78
|
+
*/
|
|
79
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
80
|
+
const { Params, ContextUser } = params;
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
// Validate required parameters
|
|
84
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
85
|
+
const pageId = this.getParamValue(Params, 'PageID');
|
|
86
|
+
const albumName = this.getParamValue(Params, 'AlbumName');
|
|
87
|
+
|
|
88
|
+
if (!companyIntegrationId) {
|
|
89
|
+
return {
|
|
90
|
+
Success: false,
|
|
91
|
+
Message: 'CompanyIntegrationID is required',
|
|
92
|
+
ResultCode: 'INVALID_TOKEN'
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (!pageId) {
|
|
97
|
+
return {
|
|
98
|
+
Success: false,
|
|
99
|
+
Message: 'PageID is required',
|
|
100
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!albumName) {
|
|
105
|
+
return {
|
|
106
|
+
Success: false,
|
|
107
|
+
Message: 'AlbumName is required',
|
|
108
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Initialize OAuth
|
|
113
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
114
|
+
return {
|
|
115
|
+
Success: false,
|
|
116
|
+
Message: 'Failed to initialize Facebook OAuth connection',
|
|
117
|
+
ResultCode: 'INVALID_TOKEN'
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Get parameters
|
|
122
|
+
const description = this.getParamValue(Params, 'Description') as string;
|
|
123
|
+
const location = this.getParamValue(Params, 'Location') as string;
|
|
124
|
+
const privacy = this.getParamValue(Params, 'Privacy') as string;
|
|
125
|
+
const photos = this.getParamValue(Params, 'Photos') as MediaFile[];
|
|
126
|
+
const photoCaptions = this.getParamValue(Params, 'PhotoCaptions') as string[];
|
|
127
|
+
const coverPhotoIndex = this.getParamValue(Params, 'CoverPhotoIndex') as number || 0;
|
|
128
|
+
const makeAlbumPublic = this.getParamValue(Params, 'MakeAlbumPublic') !== false;
|
|
129
|
+
|
|
130
|
+
// Validate photos are images
|
|
131
|
+
if (photos && photos.length > 0) {
|
|
132
|
+
for (const photo of photos) {
|
|
133
|
+
if (!photo.mimeType.startsWith('image/')) {
|
|
134
|
+
return {
|
|
135
|
+
Success: false,
|
|
136
|
+
Message: `Only image files are allowed in albums. File ${photo.filename} is ${photo.mimeType}`,
|
|
137
|
+
ResultCode: 'INVALID_MEDIA'
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
LogStatus(`Creating album "${albumName}" on Facebook page ${pageId}...`);
|
|
144
|
+
|
|
145
|
+
// Get page access token
|
|
146
|
+
const pageToken = await this.getPageAccessToken(pageId);
|
|
147
|
+
|
|
148
|
+
// Create the album
|
|
149
|
+
const albumData: any = {
|
|
150
|
+
name: albumName,
|
|
151
|
+
privacy: {
|
|
152
|
+
value: privacy
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
if (description) {
|
|
157
|
+
albumData.message = description;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (location) {
|
|
161
|
+
albumData.location = location;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const albumResponse = await axios.post(
|
|
165
|
+
`${this.apiBaseUrl}/${pageId}/albums`,
|
|
166
|
+
albumData,
|
|
167
|
+
{
|
|
168
|
+
params: {
|
|
169
|
+
access_token: pageToken
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const albumId = albumResponse.data.id;
|
|
175
|
+
LogStatus(`Album created with ID: ${albumId}`);
|
|
176
|
+
|
|
177
|
+
// Upload photos if provided
|
|
178
|
+
const uploadedPhotos: any[] = [];
|
|
179
|
+
let coverPhotoId: string | null = null;
|
|
180
|
+
|
|
181
|
+
if (photos && photos.length > 0) {
|
|
182
|
+
LogStatus(`Uploading ${photos.length} photos to the album...`);
|
|
183
|
+
|
|
184
|
+
for (let i = 0; i < photos.length; i++) {
|
|
185
|
+
const photo = photos[i];
|
|
186
|
+
const caption = photoCaptions?.[i] || '';
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
const photoId = await this.uploadPhotoToAlbum(
|
|
190
|
+
albumId,
|
|
191
|
+
photo,
|
|
192
|
+
caption,
|
|
193
|
+
pageToken,
|
|
194
|
+
!makeAlbumPublic // Keep unpublished if album is not public yet
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
uploadedPhotos.push({
|
|
198
|
+
id: photoId,
|
|
199
|
+
filename: photo.filename,
|
|
200
|
+
caption
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
if (i === coverPhotoIndex) {
|
|
204
|
+
coverPhotoId = photoId;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
LogStatus(`Uploaded photo ${i + 1}/${photos.length}: ${photo.filename}`);
|
|
208
|
+
} catch (error) {
|
|
209
|
+
LogError(`Failed to upload photo ${photo.filename}: ${error}`);
|
|
210
|
+
// Continue with other photos
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Set cover photo if specified and photos were uploaded
|
|
216
|
+
if (coverPhotoId) {
|
|
217
|
+
try {
|
|
218
|
+
await this.setAlbumCoverPhoto(albumId, coverPhotoId, pageToken);
|
|
219
|
+
LogStatus(`Set cover photo for album`);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
LogError(`Failed to set cover photo: ${error}`);
|
|
222
|
+
// Non-critical error, continue
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Get the final album details
|
|
227
|
+
const album = await this.getAlbumDetails(albumId, pageToken);
|
|
228
|
+
|
|
229
|
+
LogStatus(`Album "${albumName}" created successfully with ${uploadedPhotos.length} photos`);
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
Success: true,
|
|
233
|
+
Message: `Album created successfully with ${uploadedPhotos.length} photos`,
|
|
234
|
+
ResultCode: 'SUCCESS',
|
|
235
|
+
Params
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
} catch (error) {
|
|
239
|
+
LogError(`Failed to create Facebook album: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
240
|
+
|
|
241
|
+
if (this.isAuthError(error)) {
|
|
242
|
+
return this.handleOAuthError(error);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
Success: false,
|
|
247
|
+
Message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
248
|
+
ResultCode: 'ERROR'
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Upload a photo to an album
|
|
255
|
+
*/
|
|
256
|
+
private async uploadPhotoToAlbum(
|
|
257
|
+
albumId: string,
|
|
258
|
+
photo: MediaFile,
|
|
259
|
+
caption: string,
|
|
260
|
+
pageToken: string,
|
|
261
|
+
unpublished: boolean = false
|
|
262
|
+
): Promise<string> {
|
|
263
|
+
const fileData = typeof photo.data === 'string'
|
|
264
|
+
? Buffer.from(photo.data, 'base64')
|
|
265
|
+
: photo.data;
|
|
266
|
+
|
|
267
|
+
const formData = new FormData();
|
|
268
|
+
formData.append('source', fileData, {
|
|
269
|
+
filename: photo.filename,
|
|
270
|
+
contentType: photo.mimeType
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
if (caption) {
|
|
274
|
+
formData.append('message', caption);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (unpublished) {
|
|
278
|
+
formData.append('published', 'false');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const response = await axios.post(
|
|
282
|
+
`${this.apiBaseUrl}/${albumId}/photos`,
|
|
283
|
+
formData,
|
|
284
|
+
{
|
|
285
|
+
headers: formData.getHeaders(),
|
|
286
|
+
params: {
|
|
287
|
+
access_token: pageToken
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
return response.data.id;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Set the cover photo for an album
|
|
297
|
+
*/
|
|
298
|
+
private async setAlbumCoverPhoto(albumId: string, photoId: string, pageToken: string): Promise<void> {
|
|
299
|
+
await axios.post(
|
|
300
|
+
`${this.apiBaseUrl}/${albumId}`,
|
|
301
|
+
{
|
|
302
|
+
cover_photo: photoId
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
params: {
|
|
306
|
+
access_token: pageToken
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Get album details
|
|
314
|
+
*/
|
|
315
|
+
private async getAlbumDetails(albumId: string, pageToken: string): Promise<FacebookAlbum | null> {
|
|
316
|
+
try {
|
|
317
|
+
const response = await axios.get(
|
|
318
|
+
`${this.apiBaseUrl}/${albumId}`,
|
|
319
|
+
{
|
|
320
|
+
params: {
|
|
321
|
+
access_token: pageToken,
|
|
322
|
+
fields: 'id,name,description,link,cover_photo,count,created_time,photos.limit(1){id,images}'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
return response.data;
|
|
328
|
+
} catch (error) {
|
|
329
|
+
LogError(`Failed to get album details: ${error}`);
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { FacebookBaseAction, CreatePostData } from '../facebook-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { MediaFile, SocialMediaErrorCode } from '../../../base/base-social.action';
|
|
5
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new post on a Facebook page.
|
|
9
|
+
* Supports text, links, images, videos, and scheduling.
|
|
10
|
+
*/
|
|
11
|
+
@RegisterClass(FacebookBaseAction, 'FacebookCreatePostAction')
|
|
12
|
+
export class FacebookCreatePostAction extends FacebookBaseAction {
|
|
13
|
+
/**
|
|
14
|
+
* Get action description
|
|
15
|
+
*/
|
|
16
|
+
public get Description(): string {
|
|
17
|
+
return 'Creates a new post on a Facebook page with optional media attachments and scheduling';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Define the parameters for this action
|
|
22
|
+
*/
|
|
23
|
+
public get Params(): ActionParam[] {
|
|
24
|
+
return [
|
|
25
|
+
...this.commonSocialParams,
|
|
26
|
+
{
|
|
27
|
+
Name: 'PageID',
|
|
28
|
+
Type: 'Input',
|
|
29
|
+
Value: null,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
Name: 'Content',
|
|
33
|
+
Type: 'Input',
|
|
34
|
+
Value: null,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
Name: 'Link',
|
|
38
|
+
Type: 'Input',
|
|
39
|
+
Value: null,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
Name: 'MediaFiles',
|
|
43
|
+
Type: 'Input',
|
|
44
|
+
Value: null,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
Name: 'ScheduledTime',
|
|
48
|
+
Type: 'Input',
|
|
49
|
+
Value: null,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
Name: 'Tags',
|
|
53
|
+
Type: 'Input',
|
|
54
|
+
Value: null,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
Name: 'PlaceID',
|
|
58
|
+
Type: 'Input',
|
|
59
|
+
Value: null,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
Name: 'Privacy',
|
|
63
|
+
Type: 'Input',
|
|
64
|
+
Value: null,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
Name: 'Published',
|
|
68
|
+
Type: 'Input',
|
|
69
|
+
Value: true,
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Execute the action
|
|
76
|
+
*/
|
|
77
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
78
|
+
const { Params, ContextUser } = params;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
// Validate required parameters
|
|
82
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
83
|
+
const pageId = this.getParamValue(Params, 'PageID');
|
|
84
|
+
|
|
85
|
+
if (!companyIntegrationId) {
|
|
86
|
+
return {
|
|
87
|
+
Success: false,
|
|
88
|
+
Message: 'CompanyIntegrationID is required',
|
|
89
|
+
ResultCode: 'INVALID_TOKEN'
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!pageId) {
|
|
94
|
+
return {
|
|
95
|
+
Success: false,
|
|
96
|
+
Message: 'PageID is required',
|
|
97
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Initialize OAuth
|
|
102
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
103
|
+
return {
|
|
104
|
+
Success: false,
|
|
105
|
+
Message: 'Failed to initialize Facebook OAuth connection',
|
|
106
|
+
ResultCode: 'INVALID_TOKEN'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Get parameters
|
|
111
|
+
const content = this.getParamValue(Params, 'Content') as string;
|
|
112
|
+
const link = this.getParamValue(Params, 'Link') as string;
|
|
113
|
+
const mediaFiles = this.getParamValue(Params, 'MediaFiles') as MediaFile[];
|
|
114
|
+
const scheduledTime = this.getParamValue(Params, 'ScheduledTime') as string;
|
|
115
|
+
const tags = this.getParamValue(Params, 'Tags') as string[];
|
|
116
|
+
const placeId = this.getParamValue(Params, 'PlaceID') as string;
|
|
117
|
+
const privacy = this.getParamValue(Params, 'Privacy') as string;
|
|
118
|
+
const published = this.getParamValue(Params, 'Published') !== false;
|
|
119
|
+
|
|
120
|
+
// Validate that we have some content
|
|
121
|
+
if (!content && !link && (!mediaFiles || mediaFiles.length === 0)) {
|
|
122
|
+
return {
|
|
123
|
+
Success: false,
|
|
124
|
+
Message: 'At least one of Content, Link, or MediaFiles is required',
|
|
125
|
+
ResultCode: 'MISSING_CONTENT'
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Build post data
|
|
130
|
+
const postData: CreatePostData = {};
|
|
131
|
+
|
|
132
|
+
if (content) {
|
|
133
|
+
postData.message = content;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (link) {
|
|
137
|
+
postData.link = link;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (placeId) {
|
|
141
|
+
postData.place = placeId;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (tags && tags.length > 0) {
|
|
145
|
+
postData.tags = tags;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (privacy) {
|
|
149
|
+
postData.privacy = {
|
|
150
|
+
value: privacy as 'EVERYONE' | 'ALL_FRIENDS' | 'FRIENDS_OF_FRIENDS' | 'SELF'
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
postData.published = published;
|
|
155
|
+
|
|
156
|
+
// Handle scheduling
|
|
157
|
+
if (scheduledTime) {
|
|
158
|
+
const scheduledDate = new Date(scheduledTime);
|
|
159
|
+
const now = new Date();
|
|
160
|
+
const minScheduleTime = new Date(now.getTime() + 10 * 60 * 1000); // 10 minutes from now
|
|
161
|
+
const maxScheduleTime = new Date(now.getTime() + 180 * 24 * 60 * 60 * 1000); // 6 months from now
|
|
162
|
+
|
|
163
|
+
if (scheduledDate < minScheduleTime) {
|
|
164
|
+
return {
|
|
165
|
+
Success: false,
|
|
166
|
+
Message: 'Scheduled time must be at least 10 minutes in the future',
|
|
167
|
+
ResultCode: 'INVALID_SCHEDULE_TIME'
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (scheduledDate > maxScheduleTime) {
|
|
172
|
+
return {
|
|
173
|
+
Success: false,
|
|
174
|
+
Message: 'Scheduled time cannot be more than 6 months in the future',
|
|
175
|
+
ResultCode: 'INVALID_SCHEDULE_TIME'
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
postData.scheduled_publish_time = Math.floor(scheduledDate.getTime() / 1000);
|
|
180
|
+
postData.published = false; // Must be unpublished when scheduling
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Handle media uploads
|
|
184
|
+
if (mediaFiles && mediaFiles.length > 0) {
|
|
185
|
+
LogStatus(`Uploading ${mediaFiles.length} media files to Facebook...`);
|
|
186
|
+
|
|
187
|
+
const mediaIds: string[] = [];
|
|
188
|
+
for (const file of mediaFiles) {
|
|
189
|
+
try {
|
|
190
|
+
const mediaId = await this.uploadMediaToPage(pageId, file);
|
|
191
|
+
mediaIds.push(mediaId);
|
|
192
|
+
LogStatus(`Uploaded media: ${file.filename}`);
|
|
193
|
+
} catch (error) {
|
|
194
|
+
LogError(`Failed to upload media ${file.filename}: ${error}`);
|
|
195
|
+
return {
|
|
196
|
+
Success: false,
|
|
197
|
+
Message: `Failed to upload media: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
198
|
+
ResultCode: 'INVALID_MEDIA'
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Attach media to post
|
|
204
|
+
postData.attached_media = mediaIds.map(id => ({ media_fbid: id }));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Create the post
|
|
208
|
+
LogStatus('Creating Facebook post...');
|
|
209
|
+
const post = await this.createPost(pageId, postData);
|
|
210
|
+
|
|
211
|
+
LogStatus(`Facebook post created successfully: ${post.id}`);
|
|
212
|
+
|
|
213
|
+
// Return normalized post data
|
|
214
|
+
const normalizedPost = this.normalizePost(post);
|
|
215
|
+
|
|
216
|
+
// Update output parameters
|
|
217
|
+
const outputParams = [...Params];
|
|
218
|
+
// TODO: Set output parameters based on result
|
|
219
|
+
|
|
220
|
+
return {
|
|
221
|
+
Success: true,
|
|
222
|
+
Message: scheduledTime ? 'Post scheduled successfully' : 'Post created successfully',
|
|
223
|
+
ResultCode: 'SUCCESS',
|
|
224
|
+
Params: outputParams
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
} catch (error) {
|
|
228
|
+
LogError(`Failed to create Facebook post: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
229
|
+
|
|
230
|
+
if (this.isAuthError(error)) {
|
|
231
|
+
return this.handleOAuthError(error);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
Success: false,
|
|
236
|
+
Message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
237
|
+
ResultCode: 'ERROR'
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
}
|