@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,372 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { FacebookBaseAction, FacebookComment } from '../facebook-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { SocialMediaErrorCode } from '../../../base/base-social.action';
|
|
5
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
6
|
+
import axios from 'axios';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Responds to comments on Facebook posts or other comments.
|
|
10
|
+
* Supports replying to top-level comments and nested replies.
|
|
11
|
+
*/
|
|
12
|
+
@RegisterClass(FacebookBaseAction, 'FacebookRespondToCommentsAction')
|
|
13
|
+
export class FacebookRespondToCommentsAction extends FacebookBaseAction {
|
|
14
|
+
/**
|
|
15
|
+
* Get action description
|
|
16
|
+
*/
|
|
17
|
+
public get Description(): string {
|
|
18
|
+
return 'Responds to comments on Facebook posts, pages, or other comments with text replies or reactions';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Define the parameters for this action
|
|
23
|
+
*/
|
|
24
|
+
public get Params(): ActionParam[] {
|
|
25
|
+
return [
|
|
26
|
+
...this.commonSocialParams,
|
|
27
|
+
{
|
|
28
|
+
Name: 'CommentID',
|
|
29
|
+
Type: 'Input',
|
|
30
|
+
Value: null,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
Name: 'ResponseText',
|
|
34
|
+
Type: 'Input',
|
|
35
|
+
Value: null,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
Name: 'AttachmentURL',
|
|
39
|
+
Type: 'Input',
|
|
40
|
+
Value: null,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
Name: 'LikeComment',
|
|
44
|
+
Type: 'Input',
|
|
45
|
+
Value: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
Name: 'HideComment',
|
|
49
|
+
Type: 'Input',
|
|
50
|
+
Value: false,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
Name: 'DeleteComment',
|
|
54
|
+
Type: 'Input',
|
|
55
|
+
Value: false,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
Name: 'PrivateReply',
|
|
59
|
+
Type: 'Input',
|
|
60
|
+
Value: false,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
Name: 'PageID',
|
|
64
|
+
Type: 'Input',
|
|
65
|
+
Value: null,
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Execute the action
|
|
72
|
+
*/
|
|
73
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
74
|
+
const { Params, ContextUser } = params;
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
// Validate required parameters
|
|
78
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
79
|
+
const commentId = this.getParamValue(Params, 'CommentID');
|
|
80
|
+
|
|
81
|
+
if (!companyIntegrationId) {
|
|
82
|
+
return {
|
|
83
|
+
Success: false,
|
|
84
|
+
Message: 'CompanyIntegrationID is required',
|
|
85
|
+
ResultCode: 'INVALID_TOKEN'
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!commentId) {
|
|
90
|
+
return {
|
|
91
|
+
Success: false,
|
|
92
|
+
Message: 'CommentID is required',
|
|
93
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Initialize OAuth
|
|
98
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
99
|
+
return {
|
|
100
|
+
Success: false,
|
|
101
|
+
Message: 'Failed to initialize Facebook OAuth connection',
|
|
102
|
+
ResultCode: 'INVALID_TOKEN'
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Get parameters
|
|
107
|
+
const responseText = this.getParamValue(Params, 'ResponseText') as string;
|
|
108
|
+
const attachmentUrl = this.getParamValue(Params, 'AttachmentURL') as string;
|
|
109
|
+
const likeComment = this.getParamValue(Params, 'LikeComment') as boolean;
|
|
110
|
+
const hideComment = this.getParamValue(Params, 'HideComment') as boolean;
|
|
111
|
+
const deleteComment = this.getParamValue(Params, 'DeleteComment') as boolean;
|
|
112
|
+
const privateReply = this.getParamValue(Params, 'PrivateReply') as boolean;
|
|
113
|
+
const pageId = this.getParamValue(Params, 'PageID') as string;
|
|
114
|
+
|
|
115
|
+
// Validate that at least one action is specified
|
|
116
|
+
if (!responseText && !attachmentUrl && !likeComment && !hideComment && !deleteComment) {
|
|
117
|
+
return {
|
|
118
|
+
Success: false,
|
|
119
|
+
Message: 'At least one action (ResponseText, AttachmentURL, LikeComment, HideComment, or DeleteComment) is required',
|
|
120
|
+
ResultCode: 'MISSING_ACTION'
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Get appropriate access token
|
|
125
|
+
let accessToken = this.getAccessToken();
|
|
126
|
+
if (pageId) {
|
|
127
|
+
// Use page access token for page actions
|
|
128
|
+
accessToken = await this.getPageAccessToken(pageId);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
LogStatus(`Processing comment ${commentId}...`);
|
|
132
|
+
|
|
133
|
+
// Get comment details first
|
|
134
|
+
const commentDetails = await this.getCommentDetails(commentId, accessToken!);
|
|
135
|
+
if (!commentDetails) {
|
|
136
|
+
return {
|
|
137
|
+
Success: false,
|
|
138
|
+
Message: 'Comment not found or access denied',
|
|
139
|
+
ResultCode: 'NOT_FOUND'
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const results: any = {
|
|
144
|
+
commentId,
|
|
145
|
+
originalComment: {
|
|
146
|
+
message: commentDetails.message,
|
|
147
|
+
from: commentDetails.from,
|
|
148
|
+
createdTime: commentDetails.created_time
|
|
149
|
+
},
|
|
150
|
+
actions: []
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// Handle delete action first (if specified)
|
|
154
|
+
if (deleteComment) {
|
|
155
|
+
try {
|
|
156
|
+
await this.deleteCommentAction(commentId, accessToken!);
|
|
157
|
+
results.actions.push({ action: 'delete', success: true });
|
|
158
|
+
LogStatus(`Deleted comment ${commentId}`);
|
|
159
|
+
|
|
160
|
+
// If deleted, no other actions can be performed
|
|
161
|
+
return {
|
|
162
|
+
Success: true,
|
|
163
|
+
Message: 'Comment deleted successfully',
|
|
164
|
+
ResultCode: 'SUCCESS',
|
|
165
|
+
Params
|
|
166
|
+
};
|
|
167
|
+
} catch (error) {
|
|
168
|
+
LogError(`Failed to delete comment: ${error}`);
|
|
169
|
+
results.actions.push({
|
|
170
|
+
action: 'delete',
|
|
171
|
+
success: false,
|
|
172
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Handle hide action
|
|
178
|
+
if (hideComment) {
|
|
179
|
+
try {
|
|
180
|
+
await this.hideCommentAction(commentId, accessToken!, true);
|
|
181
|
+
results.actions.push({ action: 'hide', success: true });
|
|
182
|
+
LogStatus(`Hidden comment ${commentId}`);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
LogError(`Failed to hide comment: ${error}`);
|
|
185
|
+
results.actions.push({
|
|
186
|
+
action: 'hide',
|
|
187
|
+
success: false,
|
|
188
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Handle like action
|
|
194
|
+
if (likeComment) {
|
|
195
|
+
try {
|
|
196
|
+
await this.likeCommentAction(commentId, accessToken!);
|
|
197
|
+
results.actions.push({ action: 'like', success: true });
|
|
198
|
+
LogStatus(`Liked comment ${commentId}`);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
LogError(`Failed to like comment: ${error}`);
|
|
201
|
+
results.actions.push({
|
|
202
|
+
action: 'like',
|
|
203
|
+
success: false,
|
|
204
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Handle reply action
|
|
210
|
+
if (responseText || attachmentUrl) {
|
|
211
|
+
try {
|
|
212
|
+
const replyResult = await this.replyToComment(
|
|
213
|
+
commentId,
|
|
214
|
+
responseText,
|
|
215
|
+
attachmentUrl,
|
|
216
|
+
privateReply,
|
|
217
|
+
accessToken!
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
results.actions.push({
|
|
221
|
+
action: privateReply ? 'private_reply' : 'reply',
|
|
222
|
+
success: true,
|
|
223
|
+
replyId: replyResult.id,
|
|
224
|
+
message: responseText
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
LogStatus(`Replied to comment ${commentId}`);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
LogError(`Failed to reply to comment: ${error}`);
|
|
230
|
+
results.actions.push({
|
|
231
|
+
action: privateReply ? 'private_reply' : 'reply',
|
|
232
|
+
success: false,
|
|
233
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Check if any actions succeeded
|
|
239
|
+
const successfulActions = results.actions.filter((a: any) => a.success);
|
|
240
|
+
if (successfulActions.length === 0) {
|
|
241
|
+
return {
|
|
242
|
+
Success: false,
|
|
243
|
+
Message: 'All requested actions failed',
|
|
244
|
+
ResultCode: 'ERROR'
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
Success: true,
|
|
250
|
+
Message: `Successfully completed ${successfulActions.length} of ${results.actions.length} actions`,
|
|
251
|
+
ResultCode: 'SUCCESS',
|
|
252
|
+
Params
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
} catch (error) {
|
|
256
|
+
LogError(`Failed to respond to Facebook comment: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
257
|
+
|
|
258
|
+
if (this.isAuthError(error)) {
|
|
259
|
+
return this.handleOAuthError(error);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
Success: false,
|
|
264
|
+
Message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
265
|
+
ResultCode: 'ERROR'
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Get comment details
|
|
272
|
+
*/
|
|
273
|
+
private async getCommentDetails(commentId: string, accessToken: string): Promise<FacebookComment | null> {
|
|
274
|
+
try {
|
|
275
|
+
const response = await axios.get(
|
|
276
|
+
`${this.apiBaseUrl}/${commentId}`,
|
|
277
|
+
{
|
|
278
|
+
params: {
|
|
279
|
+
access_token: accessToken,
|
|
280
|
+
fields: 'id,message,created_time,from,like_count,comment_count,parent'
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
return response.data;
|
|
286
|
+
} catch (error) {
|
|
287
|
+
LogError(`Failed to get comment details: ${error}`);
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Reply to a comment
|
|
294
|
+
*/
|
|
295
|
+
private async replyToComment(
|
|
296
|
+
commentId: string,
|
|
297
|
+
message: string | null,
|
|
298
|
+
attachmentUrl: string | null,
|
|
299
|
+
privateReply: boolean,
|
|
300
|
+
accessToken: string
|
|
301
|
+
): Promise<any> {
|
|
302
|
+
const endpoint = privateReply
|
|
303
|
+
? `${this.apiBaseUrl}/${commentId}/private_replies`
|
|
304
|
+
: `${this.apiBaseUrl}/${commentId}/comments`;
|
|
305
|
+
|
|
306
|
+
const data: any = {};
|
|
307
|
+
|
|
308
|
+
if (message) {
|
|
309
|
+
data.message = message;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if (attachmentUrl) {
|
|
313
|
+
data.attachment_url = attachmentUrl;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const response = await axios.post(endpoint, data, {
|
|
317
|
+
params: {
|
|
318
|
+
access_token: accessToken
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
return response.data;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Like a comment
|
|
327
|
+
*/
|
|
328
|
+
private async likeCommentAction(commentId: string, accessToken: string): Promise<void> {
|
|
329
|
+
await axios.post(
|
|
330
|
+
`${this.apiBaseUrl}/${commentId}/likes`,
|
|
331
|
+
{},
|
|
332
|
+
{
|
|
333
|
+
params: {
|
|
334
|
+
access_token: accessToken
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Hide or unhide a comment
|
|
342
|
+
*/
|
|
343
|
+
private async hideCommentAction(commentId: string, accessToken: string, hide: boolean): Promise<void> {
|
|
344
|
+
await axios.post(
|
|
345
|
+
`${this.apiBaseUrl}/${commentId}`,
|
|
346
|
+
{
|
|
347
|
+
is_hidden: hide
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
params: {
|
|
351
|
+
access_token: accessToken
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Delete a comment
|
|
359
|
+
*/
|
|
360
|
+
private async deleteCommentAction(commentId: string, accessToken: string): Promise<void> {
|
|
361
|
+
await axios.delete(
|
|
362
|
+
`${this.apiBaseUrl}/${commentId}`,
|
|
363
|
+
{
|
|
364
|
+
params: {
|
|
365
|
+
access_token: accessToken
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
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
|
+
import axios from 'axios';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Schedules a post to be published on a Facebook page at a future time.
|
|
10
|
+
* Posts can be scheduled from 10 minutes to 6 months in the future.
|
|
11
|
+
*/
|
|
12
|
+
@RegisterClass(FacebookBaseAction, 'FacebookSchedulePostAction')
|
|
13
|
+
export class FacebookSchedulePostAction extends FacebookBaseAction {
|
|
14
|
+
/**
|
|
15
|
+
* Get action description
|
|
16
|
+
*/
|
|
17
|
+
public get Description(): string {
|
|
18
|
+
return 'Schedules a post to be published on a Facebook page at a specified future time (10 minutes to 6 months in advance)';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Define the parameters for this action
|
|
23
|
+
*/
|
|
24
|
+
public get Params(): ActionParam[] {
|
|
25
|
+
return [
|
|
26
|
+
...this.commonSocialParams,
|
|
27
|
+
{
|
|
28
|
+
Name: 'PageID',
|
|
29
|
+
Type: 'Input',
|
|
30
|
+
Value: null,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
Name: 'Content',
|
|
34
|
+
Type: 'Input',
|
|
35
|
+
Value: null,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
Name: 'ScheduledTime',
|
|
39
|
+
Type: 'Input',
|
|
40
|
+
Value: null,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
Name: 'Link',
|
|
44
|
+
Type: 'Input',
|
|
45
|
+
Value: null,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
Name: 'MediaFiles',
|
|
49
|
+
Type: 'Input',
|
|
50
|
+
Value: null,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
Name: 'Tags',
|
|
54
|
+
Type: 'Input',
|
|
55
|
+
Value: null,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
Name: 'PlaceID',
|
|
59
|
+
Type: 'Input',
|
|
60
|
+
Value: null,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
Name: 'TargetingRestrictions',
|
|
64
|
+
Type: 'Input',
|
|
65
|
+
Value: null,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
Name: 'AllowReschedule',
|
|
69
|
+
Type: 'Input',
|
|
70
|
+
Value: false,
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Execute the action
|
|
77
|
+
*/
|
|
78
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
79
|
+
const { Params, ContextUser } = params;
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
// Validate required parameters
|
|
83
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
84
|
+
const pageId = this.getParamValue(Params, 'PageID');
|
|
85
|
+
const scheduledTime = this.getParamValue(Params, 'ScheduledTime');
|
|
86
|
+
|
|
87
|
+
if (!companyIntegrationId) {
|
|
88
|
+
return {
|
|
89
|
+
Success: false,
|
|
90
|
+
Message: 'CompanyIntegrationID is required',
|
|
91
|
+
ResultCode: 'INVALID_TOKEN'
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!pageId) {
|
|
96
|
+
return {
|
|
97
|
+
Success: false,
|
|
98
|
+
Message: 'PageID is required',
|
|
99
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (!scheduledTime) {
|
|
104
|
+
return {
|
|
105
|
+
Success: false,
|
|
106
|
+
Message: 'ScheduledTime is required',
|
|
107
|
+
ResultCode: 'MISSING_REQUIRED_PARAM'
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Initialize OAuth
|
|
112
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
113
|
+
return {
|
|
114
|
+
Success: false,
|
|
115
|
+
Message: 'Failed to initialize Facebook OAuth connection',
|
|
116
|
+
ResultCode: 'INVALID_TOKEN'
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Validate scheduled time
|
|
121
|
+
const scheduledDate = new Date(scheduledTime);
|
|
122
|
+
const now = new Date();
|
|
123
|
+
const minScheduleTime = new Date(now.getTime() + 10 * 60 * 1000); // 10 minutes from now
|
|
124
|
+
const maxScheduleTime = new Date(now.getTime() + 180 * 24 * 60 * 60 * 1000); // 6 months from now
|
|
125
|
+
|
|
126
|
+
if (isNaN(scheduledDate.getTime())) {
|
|
127
|
+
return {
|
|
128
|
+
Success: false,
|
|
129
|
+
Message: 'Invalid scheduled time format. Use ISO 8601 format.',
|
|
130
|
+
ResultCode: 'INVALID_SCHEDULE_TIME'
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (scheduledDate < minScheduleTime) {
|
|
135
|
+
return {
|
|
136
|
+
Success: false,
|
|
137
|
+
Message: 'Scheduled time must be at least 10 minutes in the future',
|
|
138
|
+
ResultCode: 'INVALID_SCHEDULE_TIME'
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (scheduledDate > maxScheduleTime) {
|
|
143
|
+
return {
|
|
144
|
+
Success: false,
|
|
145
|
+
Message: 'Scheduled time cannot be more than 6 months in the future',
|
|
146
|
+
ResultCode: 'INVALID_SCHEDULE_TIME'
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Get parameters
|
|
151
|
+
const content = this.getParamValue(Params, 'Content') as string;
|
|
152
|
+
const link = this.getParamValue(Params, 'Link') as string;
|
|
153
|
+
const mediaFiles = this.getParamValue(Params, 'MediaFiles') as MediaFile[];
|
|
154
|
+
const tags = this.getParamValue(Params, 'Tags') as string[];
|
|
155
|
+
const placeId = this.getParamValue(Params, 'PlaceID') as string;
|
|
156
|
+
const targetingRestrictions = this.getParamValue(Params, 'TargetingRestrictions') as any;
|
|
157
|
+
const allowReschedule = this.getParamValue(Params, 'AllowReschedule') as boolean;
|
|
158
|
+
|
|
159
|
+
// Validate that we have some content
|
|
160
|
+
if (!content && !link && (!mediaFiles || mediaFiles.length === 0)) {
|
|
161
|
+
return {
|
|
162
|
+
Success: false,
|
|
163
|
+
Message: 'At least one of Content, Link, or MediaFiles is required',
|
|
164
|
+
ResultCode: 'MISSING_CONTENT'
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Check for scheduling conflicts if requested
|
|
169
|
+
if (!allowReschedule) {
|
|
170
|
+
const hasConflict = await this.checkSchedulingConflict(pageId, scheduledDate);
|
|
171
|
+
if (hasConflict) {
|
|
172
|
+
return {
|
|
173
|
+
Success: false,
|
|
174
|
+
Message: 'Another post is already scheduled within 5 minutes of this time',
|
|
175
|
+
ResultCode: 'SCHEDULE_CONFLICT'
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Build post data
|
|
181
|
+
const postData: CreatePostData = {
|
|
182
|
+
scheduled_publish_time: Math.floor(scheduledDate.getTime() / 1000),
|
|
183
|
+
published: false // Must be false for scheduled posts
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
if (content) {
|
|
187
|
+
postData.message = content;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (link) {
|
|
191
|
+
postData.link = link;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (placeId) {
|
|
195
|
+
postData.place = placeId;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (tags && tags.length > 0) {
|
|
199
|
+
postData.tags = tags;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (targetingRestrictions) {
|
|
203
|
+
(postData as any).targeting = targetingRestrictions;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Handle media uploads
|
|
207
|
+
if (mediaFiles && mediaFiles.length > 0) {
|
|
208
|
+
LogStatus(`Uploading ${mediaFiles.length} media files for scheduled post...`);
|
|
209
|
+
|
|
210
|
+
const mediaIds: string[] = [];
|
|
211
|
+
for (const file of mediaFiles) {
|
|
212
|
+
try {
|
|
213
|
+
const mediaId = await this.uploadMediaToPage(pageId, file);
|
|
214
|
+
mediaIds.push(mediaId);
|
|
215
|
+
LogStatus(`Uploaded media: ${file.filename}`);
|
|
216
|
+
} catch (error) {
|
|
217
|
+
LogError(`Failed to upload media ${file.filename}: ${error}`);
|
|
218
|
+
return {
|
|
219
|
+
Success: false,
|
|
220
|
+
Message: `Failed to upload media: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
221
|
+
ResultCode: 'INVALID_MEDIA'
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Attach media to post
|
|
227
|
+
postData.attached_media = mediaIds.map(id => ({ media_fbid: id }));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Create the scheduled post
|
|
231
|
+
LogStatus(`Scheduling Facebook post for ${scheduledDate.toISOString()}...`);
|
|
232
|
+
const post = await this.createPost(pageId, postData);
|
|
233
|
+
|
|
234
|
+
// Get the scheduled post details
|
|
235
|
+
const scheduledPost = await this.getScheduledPost(pageId, post.id);
|
|
236
|
+
|
|
237
|
+
LogStatus(`Facebook post scheduled successfully: ${post.id}`);
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
Success: true,
|
|
241
|
+
Message: `Post scheduled for ${scheduledDate.toISOString()}`,
|
|
242
|
+
ResultCode: 'SUCCESS',
|
|
243
|
+
Params
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
} catch (error) {
|
|
247
|
+
LogError(`Failed to schedule Facebook post: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
248
|
+
|
|
249
|
+
if (this.isAuthError(error)) {
|
|
250
|
+
return this.handleOAuthError(error);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
Success: false,
|
|
255
|
+
Message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
256
|
+
ResultCode: 'ERROR'
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Check if there's a scheduling conflict within 5 minutes
|
|
263
|
+
*/
|
|
264
|
+
private async checkSchedulingConflict(pageId: string, scheduledTime: Date): Promise<boolean> {
|
|
265
|
+
try {
|
|
266
|
+
const pageToken = await this.getPageAccessToken(pageId);
|
|
267
|
+
const fiveMinutesBefore = new Date(scheduledTime.getTime() - 5 * 60 * 1000);
|
|
268
|
+
const fiveMinutesAfter = new Date(scheduledTime.getTime() + 5 * 60 * 1000);
|
|
269
|
+
|
|
270
|
+
// Get scheduled posts in the time window
|
|
271
|
+
const response = await axios.get(`${this.apiBaseUrl}/${pageId}/scheduled_posts`, {
|
|
272
|
+
params: {
|
|
273
|
+
access_token: pageToken,
|
|
274
|
+
since: Math.floor(fiveMinutesBefore.getTime() / 1000),
|
|
275
|
+
until: Math.floor(fiveMinutesAfter.getTime() / 1000),
|
|
276
|
+
limit: 10
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
const scheduledPosts = response.data.data || [];
|
|
281
|
+
return scheduledPosts.length > 0;
|
|
282
|
+
} catch (error) {
|
|
283
|
+
LogError(`Failed to check scheduling conflicts: ${error}`);
|
|
284
|
+
return false; // Don't block on error
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Get details of a scheduled post
|
|
290
|
+
*/
|
|
291
|
+
private async getScheduledPost(pageId: string, postId: string): Promise<any> {
|
|
292
|
+
try {
|
|
293
|
+
const pageToken = await this.getPageAccessToken(pageId);
|
|
294
|
+
|
|
295
|
+
const response = await axios.get(`${this.apiBaseUrl}/${postId}`, {
|
|
296
|
+
params: {
|
|
297
|
+
access_token: pageToken,
|
|
298
|
+
fields: 'id,message,scheduled_publish_time,is_published'
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
return response.data;
|
|
303
|
+
} catch (error) {
|
|
304
|
+
LogError(`Failed to get scheduled post details: ${error}`);
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
}
|