@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,248 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { TwitterBaseAction, Tweet } from '../twitter-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
5
|
+
import { SocialPost } from '../../../base/base-social.action';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Action to get timeline tweets (home timeline or user timeline) from Twitter/X
|
|
9
|
+
*/
|
|
10
|
+
@RegisterClass(TwitterBaseAction, 'TwitterGetTimelineAction')
|
|
11
|
+
export class TwitterGetTimelineAction extends TwitterBaseAction {
|
|
12
|
+
/**
|
|
13
|
+
* Get timeline tweets from Twitter
|
|
14
|
+
*/
|
|
15
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
16
|
+
const { Params, ContextUser } = params;
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// Initialize OAuth
|
|
20
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
21
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
22
|
+
throw new Error('Failed to initialize OAuth connection');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Extract parameters
|
|
26
|
+
const timelineType = this.getParamValue(Params, 'TimelineType') || 'home'; // 'home' or 'user'
|
|
27
|
+
const userId = this.getParamValue(Params, 'UserID');
|
|
28
|
+
const username = this.getParamValue(Params, 'Username');
|
|
29
|
+
const maxResults = this.getParamValue(Params, 'MaxResults') || 100;
|
|
30
|
+
const excludeReplies = this.getParamValue(Params, 'ExcludeReplies') === true;
|
|
31
|
+
const excludeRetweets = this.getParamValue(Params, 'ExcludeRetweets') === true;
|
|
32
|
+
const startTime = this.getParamValue(Params, 'StartTime');
|
|
33
|
+
const endTime = this.getParamValue(Params, 'EndTime');
|
|
34
|
+
const sinceId = this.getParamValue(Params, 'SinceID');
|
|
35
|
+
const untilId = this.getParamValue(Params, 'UntilID');
|
|
36
|
+
|
|
37
|
+
let tweets: Tweet[] = [];
|
|
38
|
+
let endpoint: string;
|
|
39
|
+
const queryParams: Record<string, any> = {
|
|
40
|
+
'tweet.fields': 'id,text,created_at,author_id,conversation_id,public_metrics,attachments,entities,referenced_tweets',
|
|
41
|
+
'user.fields': 'id,name,username,profile_image_url,description,created_at,verified',
|
|
42
|
+
'media.fields': 'url,preview_image_url,type,width,height',
|
|
43
|
+
'expansions': 'author_id,attachments.media_keys,referenced_tweets.id,referenced_tweets.id.author_id',
|
|
44
|
+
'max_results': Math.min(maxResults, 100) // API limit per request
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (timelineType === 'home') {
|
|
48
|
+
// Get home timeline (requires user context)
|
|
49
|
+
const currentUser = await this.getCurrentUser();
|
|
50
|
+
endpoint = `/users/${currentUser.id}/timelines/reverse_chronological`;
|
|
51
|
+
|
|
52
|
+
// Home timeline specific parameters
|
|
53
|
+
if (excludeReplies) {
|
|
54
|
+
queryParams['exclude'] = queryParams['exclude'] ? `${queryParams['exclude']},replies` : 'replies';
|
|
55
|
+
}
|
|
56
|
+
if (excludeRetweets) {
|
|
57
|
+
queryParams['exclude'] = queryParams['exclude'] ? `${queryParams['exclude']},retweets` : 'retweets';
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
// Get user timeline
|
|
61
|
+
let targetUserId: string;
|
|
62
|
+
|
|
63
|
+
if (userId) {
|
|
64
|
+
targetUserId = userId;
|
|
65
|
+
} else if (username) {
|
|
66
|
+
// Look up user by username
|
|
67
|
+
const userResponse = await this.axiosInstance.get(`/users/by/username/${username}`, {
|
|
68
|
+
params: { 'user.fields': 'id' }
|
|
69
|
+
});
|
|
70
|
+
targetUserId = userResponse.data.data.id;
|
|
71
|
+
} else {
|
|
72
|
+
// Default to authenticated user
|
|
73
|
+
const currentUser = await this.getCurrentUser();
|
|
74
|
+
targetUserId = currentUser.id;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
endpoint = `/users/${targetUserId}/tweets`;
|
|
78
|
+
|
|
79
|
+
// User timeline specific parameters
|
|
80
|
+
if (excludeReplies) {
|
|
81
|
+
queryParams['exclude'] = queryParams['exclude'] ? `${queryParams['exclude']},replies` : 'replies';
|
|
82
|
+
}
|
|
83
|
+
if (excludeRetweets) {
|
|
84
|
+
queryParams['exclude'] = queryParams['exclude'] ? `${queryParams['exclude']},retweets` : 'retweets';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Add time-based filters if provided
|
|
89
|
+
if (startTime) {
|
|
90
|
+
queryParams['start_time'] = this.formatTwitterDate(startTime);
|
|
91
|
+
}
|
|
92
|
+
if (endTime) {
|
|
93
|
+
queryParams['end_time'] = this.formatTwitterDate(endTime);
|
|
94
|
+
}
|
|
95
|
+
if (sinceId) {
|
|
96
|
+
queryParams['since_id'] = sinceId;
|
|
97
|
+
}
|
|
98
|
+
if (untilId) {
|
|
99
|
+
queryParams['until_id'] = untilId;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Get paginated tweets
|
|
103
|
+
LogStatus(`Getting ${timelineType} timeline tweets...`);
|
|
104
|
+
tweets = await this.getPaginatedTweets(endpoint, queryParams, maxResults);
|
|
105
|
+
|
|
106
|
+
// Convert to normalized format
|
|
107
|
+
const normalizedPosts: SocialPost[] = tweets.map(tweet => this.normalizePost(tweet));
|
|
108
|
+
|
|
109
|
+
// Calculate summary statistics
|
|
110
|
+
const stats = {
|
|
111
|
+
totalTweets: normalizedPosts.length,
|
|
112
|
+
totalLikes: 0,
|
|
113
|
+
totalRetweets: 0,
|
|
114
|
+
totalReplies: 0,
|
|
115
|
+
totalImpressions: 0
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
normalizedPosts.forEach(post => {
|
|
119
|
+
if (post.analytics) {
|
|
120
|
+
stats.totalLikes += post.analytics.likes;
|
|
121
|
+
stats.totalRetweets += post.analytics.shares;
|
|
122
|
+
stats.totalReplies += post.analytics.comments;
|
|
123
|
+
stats.totalImpressions += post.analytics.impressions;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Update output parameters
|
|
128
|
+
const outputParams = [...Params];
|
|
129
|
+
const postsParam = outputParams.find(p => p.Name === 'Posts');
|
|
130
|
+
if (postsParam) postsParam.Value = normalizedPosts;
|
|
131
|
+
const tweetsParam = outputParams.find(p => p.Name === 'Tweets');
|
|
132
|
+
if (tweetsParam) tweetsParam.Value = tweets;
|
|
133
|
+
const statsParam = outputParams.find(p => p.Name === 'Statistics');
|
|
134
|
+
if (statsParam) statsParam.Value = stats;
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
Success: true,
|
|
138
|
+
ResultCode: 'SUCCESS',
|
|
139
|
+
Message: `Successfully retrieved ${normalizedPosts.length} tweets from ${timelineType} timeline`,
|
|
140
|
+
Params: outputParams
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
} catch (error) {
|
|
144
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
Success: false,
|
|
148
|
+
ResultCode: this.getErrorCode(error),
|
|
149
|
+
Message: `Failed to get timeline: ${errorMessage}`,
|
|
150
|
+
Params
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Get error code based on error type
|
|
157
|
+
*/
|
|
158
|
+
private getErrorCode(error: any): string {
|
|
159
|
+
if (error instanceof Error) {
|
|
160
|
+
if (error.message.includes('Rate Limit')) return 'RATE_LIMIT';
|
|
161
|
+
if (error.message.includes('Unauthorized')) return 'INVALID_TOKEN';
|
|
162
|
+
if (error.message.includes('Not Found')) return 'USER_NOT_FOUND';
|
|
163
|
+
if (error.message.includes('Forbidden')) return 'INSUFFICIENT_PERMISSIONS';
|
|
164
|
+
}
|
|
165
|
+
return 'ERROR';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Define the parameters this action expects
|
|
170
|
+
*/
|
|
171
|
+
public get Params(): ActionParam[] {
|
|
172
|
+
return [
|
|
173
|
+
...this.commonSocialParams,
|
|
174
|
+
{
|
|
175
|
+
Name: 'TimelineType',
|
|
176
|
+
Type: 'Input',
|
|
177
|
+
Value: 'home' // 'home' or 'user'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
Name: 'UserID',
|
|
181
|
+
Type: 'Input',
|
|
182
|
+
Value: null
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
Name: 'Username',
|
|
186
|
+
Type: 'Input',
|
|
187
|
+
Value: null
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
Name: 'MaxResults',
|
|
191
|
+
Type: 'Input',
|
|
192
|
+
Value: 100
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
Name: 'ExcludeReplies',
|
|
196
|
+
Type: 'Input',
|
|
197
|
+
Value: false
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
Name: 'ExcludeRetweets',
|
|
201
|
+
Type: 'Input',
|
|
202
|
+
Value: false
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
Name: 'StartTime',
|
|
206
|
+
Type: 'Input',
|
|
207
|
+
Value: null
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
Name: 'EndTime',
|
|
211
|
+
Type: 'Input',
|
|
212
|
+
Value: null
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
Name: 'SinceID',
|
|
216
|
+
Type: 'Input',
|
|
217
|
+
Value: null
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
Name: 'UntilID',
|
|
221
|
+
Type: 'Input',
|
|
222
|
+
Value: null
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
Name: 'Posts',
|
|
226
|
+
Type: 'Output',
|
|
227
|
+
Value: null
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
Name: 'Tweets',
|
|
231
|
+
Type: 'Output',
|
|
232
|
+
Value: null
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
Name: 'Statistics',
|
|
236
|
+
Type: 'Output',
|
|
237
|
+
Value: null
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Get action description
|
|
244
|
+
*/
|
|
245
|
+
public get Description(): string {
|
|
246
|
+
return 'Gets timeline tweets from Twitter/X including home timeline or a specific user\'s timeline with filtering options';
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Twitter/X Actions for MemberJunction
|
|
3
|
+
*
|
|
4
|
+
* This module exports all Twitter-specific actions for social media automation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from './create-tweet.action';
|
|
8
|
+
export * from './create-thread.action';
|
|
9
|
+
export * from './get-timeline.action';
|
|
10
|
+
export * from './get-mentions.action';
|
|
11
|
+
export * from './get-analytics.action';
|
|
12
|
+
export * from './schedule-tweet.action';
|
|
13
|
+
export * from './delete-tweet.action';
|
|
14
|
+
export * from './search-tweets.action';
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { TwitterBaseAction, CreateTweetData } from '../twitter-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
5
|
+
import { MediaFile } from '../../../base/base-social.action';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Action to schedule a tweet for future posting on Twitter/X
|
|
9
|
+
* Note: Twitter API v2 doesn't have native scheduling, so this action
|
|
10
|
+
* saves the tweet data for later posting via a separate scheduler service
|
|
11
|
+
*/
|
|
12
|
+
@RegisterClass(TwitterBaseAction, 'TwitterScheduleTweetAction')
|
|
13
|
+
export class TwitterScheduleTweetAction extends TwitterBaseAction {
|
|
14
|
+
/**
|
|
15
|
+
* Schedule a tweet for future posting
|
|
16
|
+
*/
|
|
17
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
18
|
+
const { Params, ContextUser } = params;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
// Initialize OAuth
|
|
22
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
23
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
24
|
+
throw new Error('Failed to initialize OAuth connection');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Extract parameters
|
|
28
|
+
const content = this.getParamValue(Params, 'Content');
|
|
29
|
+
const scheduledTime = this.getParamValue(Params, 'ScheduledTime');
|
|
30
|
+
const mediaFiles = this.getParamValue(Params, 'MediaFiles');
|
|
31
|
+
const replyToTweetId = this.getParamValue(Params, 'ReplyToTweetID');
|
|
32
|
+
const quoteTweetId = this.getParamValue(Params, 'QuoteTweetID');
|
|
33
|
+
const pollOptions = this.getParamValue(Params, 'PollOptions');
|
|
34
|
+
const pollDurationMinutes = this.getParamValue(Params, 'PollDurationMinutes') || 1440; // Default 24 hours
|
|
35
|
+
|
|
36
|
+
// Validate required parameters
|
|
37
|
+
if (!content) {
|
|
38
|
+
throw new Error('Content is required');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!scheduledTime) {
|
|
42
|
+
throw new Error('ScheduledTime is required');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Validate scheduled time is in the future
|
|
46
|
+
const scheduleDate = new Date(scheduledTime);
|
|
47
|
+
const now = new Date();
|
|
48
|
+
|
|
49
|
+
if (scheduleDate <= now) {
|
|
50
|
+
throw new Error('ScheduledTime must be in the future');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Validate scheduled time is not too far in the future (e.g., 1 year)
|
|
54
|
+
const maxFutureDate = new Date();
|
|
55
|
+
maxFutureDate.setFullYear(maxFutureDate.getFullYear() + 1);
|
|
56
|
+
|
|
57
|
+
if (scheduleDate > maxFutureDate) {
|
|
58
|
+
throw new Error('ScheduledTime cannot be more than 1 year in the future');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Validate content length
|
|
62
|
+
if (content.length > 280) {
|
|
63
|
+
throw new Error(`Content exceeds Twitter's 280 character limit (current: ${content.length} characters)`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Build tweet data structure
|
|
67
|
+
const tweetData: CreateTweetData = {
|
|
68
|
+
text: content
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Add reply if specified
|
|
72
|
+
if (replyToTweetId) {
|
|
73
|
+
tweetData.reply = {
|
|
74
|
+
in_reply_to_tweet_id: replyToTweetId
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Add quote tweet if specified
|
|
79
|
+
if (quoteTweetId) {
|
|
80
|
+
tweetData.quote_tweet_id = quoteTweetId;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Add poll if specified
|
|
84
|
+
if (pollOptions && Array.isArray(pollOptions) && pollOptions.length >= 2) {
|
|
85
|
+
if (pollOptions.length > 4) {
|
|
86
|
+
throw new Error('Twitter polls support a maximum of 4 options');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Validate poll option lengths
|
|
90
|
+
for (const option of pollOptions) {
|
|
91
|
+
if (option.length > 25) {
|
|
92
|
+
throw new Error(`Poll option "${option}" exceeds 25 character limit`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
tweetData.poll = {
|
|
97
|
+
options: pollOptions,
|
|
98
|
+
duration_minutes: Math.min(Math.max(pollDurationMinutes, 5), 10080)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Handle media files
|
|
103
|
+
let uploadedMediaIds: string[] = [];
|
|
104
|
+
if (mediaFiles && Array.isArray(mediaFiles) && mediaFiles.length > 0) {
|
|
105
|
+
if (mediaFiles.length > 4) {
|
|
106
|
+
throw new Error('Twitter supports a maximum of 4 media items per tweet');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// For scheduling, we'll upload the media now and store the IDs
|
|
110
|
+
// Note: Twitter media IDs expire after 24 hours if not used
|
|
111
|
+
const hoursUntilScheduled = (scheduleDate.getTime() - now.getTime()) / (1000 * 60 * 60);
|
|
112
|
+
|
|
113
|
+
if (hoursUntilScheduled <= 24) {
|
|
114
|
+
// Upload now if scheduling within 24 hours
|
|
115
|
+
LogStatus(`Uploading ${mediaFiles.length} media files...`);
|
|
116
|
+
uploadedMediaIds = await this.uploadMedia(mediaFiles as MediaFile[]);
|
|
117
|
+
tweetData.media = {
|
|
118
|
+
media_ids: uploadedMediaIds
|
|
119
|
+
};
|
|
120
|
+
} else {
|
|
121
|
+
// For tweets scheduled beyond 24 hours, we'll need to store media
|
|
122
|
+
// data and upload closer to the scheduled time
|
|
123
|
+
LogStatus('Media will be uploaded closer to scheduled time due to Twitter\'s 24-hour media expiration');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Create scheduled tweet record
|
|
128
|
+
// In a real implementation, this would save to a database or queue service
|
|
129
|
+
const scheduledTweet = {
|
|
130
|
+
id: this.generateScheduledTweetId(),
|
|
131
|
+
scheduledFor: scheduleDate.toISOString(),
|
|
132
|
+
tweetData: tweetData,
|
|
133
|
+
mediaFiles: mediaFiles, // Store for later upload if needed
|
|
134
|
+
companyIntegrationId: companyIntegrationId,
|
|
135
|
+
createdAt: new Date().toISOString(),
|
|
136
|
+
status: 'scheduled'
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Simulate saving to a scheduling service
|
|
140
|
+
LogStatus(`Tweet scheduled for ${scheduleDate.toLocaleString()}`);
|
|
141
|
+
|
|
142
|
+
// Get user info for context
|
|
143
|
+
const user = await this.getCurrentUser();
|
|
144
|
+
|
|
145
|
+
// Update output parameters
|
|
146
|
+
const outputParams = [...Params];
|
|
147
|
+
const scheduledIdParam = outputParams.find(p => p.Name === 'ScheduledTweetID');
|
|
148
|
+
if (scheduledIdParam) scheduledIdParam.Value = scheduledTweet.id;
|
|
149
|
+
const scheduledDataParam = outputParams.find(p => p.Name === 'ScheduledTweetData');
|
|
150
|
+
if (scheduledDataParam) scheduledDataParam.Value = scheduledTweet;
|
|
151
|
+
const estimatedUrlParam = outputParams.find(p => p.Name === 'EstimatedURL');
|
|
152
|
+
if (estimatedUrlParam) estimatedUrlParam.Value = `https://twitter.com/${user.username}/status/[pending]`;
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
Success: true,
|
|
156
|
+
ResultCode: 'SUCCESS',
|
|
157
|
+
Message: `Successfully scheduled tweet for ${scheduleDate.toLocaleString()}`,
|
|
158
|
+
Params: outputParams
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
} catch (error) {
|
|
162
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
Success: false,
|
|
166
|
+
ResultCode: this.getErrorCode(error),
|
|
167
|
+
Message: `Failed to schedule tweet: ${errorMessage}`,
|
|
168
|
+
Params
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Generate a unique ID for scheduled tweet
|
|
175
|
+
*/
|
|
176
|
+
private generateScheduledTweetId(): string {
|
|
177
|
+
return `scheduled_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Get error code based on error type
|
|
182
|
+
*/
|
|
183
|
+
private getErrorCode(error: any): string {
|
|
184
|
+
if (error instanceof Error) {
|
|
185
|
+
if (error.message.includes('Rate Limit')) return 'RATE_LIMIT';
|
|
186
|
+
if (error.message.includes('Unauthorized')) return 'INVALID_TOKEN';
|
|
187
|
+
if (error.message.includes('character limit')) return 'CONTENT_TOO_LONG';
|
|
188
|
+
if (error.message.includes('media')) return 'INVALID_MEDIA';
|
|
189
|
+
if (error.message.includes('future')) return 'INVALID_SCHEDULE_TIME';
|
|
190
|
+
}
|
|
191
|
+
return 'ERROR';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Define the parameters this action expects
|
|
196
|
+
*/
|
|
197
|
+
public get Params(): ActionParam[] {
|
|
198
|
+
return [
|
|
199
|
+
...this.commonSocialParams,
|
|
200
|
+
{
|
|
201
|
+
Name: 'Content',
|
|
202
|
+
Type: 'Input',
|
|
203
|
+
Value: null
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
Name: 'ScheduledTime',
|
|
207
|
+
Type: 'Input',
|
|
208
|
+
Value: null
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
Name: 'MediaFiles',
|
|
212
|
+
Type: 'Input',
|
|
213
|
+
Value: null
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
Name: 'ReplyToTweetID',
|
|
217
|
+
Type: 'Input',
|
|
218
|
+
Value: null
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
Name: 'QuoteTweetID',
|
|
222
|
+
Type: 'Input',
|
|
223
|
+
Value: null
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
Name: 'PollOptions',
|
|
227
|
+
Type: 'Input',
|
|
228
|
+
Value: null
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
Name: 'PollDurationMinutes',
|
|
232
|
+
Type: 'Input',
|
|
233
|
+
Value: 1440 // Default 24 hours
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
Name: 'ScheduledTweetID',
|
|
237
|
+
Type: 'Output',
|
|
238
|
+
Value: null
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
Name: 'ScheduledTweetData',
|
|
242
|
+
Type: 'Output',
|
|
243
|
+
Value: null
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
Name: 'EstimatedURL',
|
|
247
|
+
Type: 'Output',
|
|
248
|
+
Value: null
|
|
249
|
+
}
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Get action description
|
|
255
|
+
*/
|
|
256
|
+
public get Description(): string {
|
|
257
|
+
return 'Schedules a tweet for future posting on Twitter/X with optional media attachments, polls, replies, or quote tweets';
|
|
258
|
+
}
|
|
259
|
+
}
|