@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,227 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { TwitterBaseAction, CreateTweetData, Tweet } from '../twitter-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
5
|
+
import { MediaFile, SocialPost } from '../../../base/base-social.action';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Action to create a thread (series of connected tweets) on Twitter/X
|
|
9
|
+
*/
|
|
10
|
+
@RegisterClass(TwitterBaseAction, 'TwitterCreateThreadAction')
|
|
11
|
+
export class TwitterCreateThreadAction extends TwitterBaseAction {
|
|
12
|
+
/**
|
|
13
|
+
* Create a thread on 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 tweets = this.getParamValue(Params, 'Tweets');
|
|
27
|
+
const mediaFilesByTweet = this.getParamValue(Params, 'MediaFilesByTweet');
|
|
28
|
+
const includeNumbers = this.getParamValue(Params, 'IncludeNumbers') !== false; // Default true
|
|
29
|
+
const numberFormat = this.getParamValue(Params, 'NumberFormat') || '{n}/{total}'; // Default format
|
|
30
|
+
|
|
31
|
+
// Validate required parameters
|
|
32
|
+
if (!tweets || !Array.isArray(tweets) || tweets.length === 0) {
|
|
33
|
+
throw new Error('Tweets array is required and must not be empty');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (tweets.length < 2) {
|
|
37
|
+
throw new Error('A thread must contain at least 2 tweets');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (tweets.length > 25) {
|
|
41
|
+
throw new Error('Twitter threads are limited to 25 tweets');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Prepare tweets with numbering if requested
|
|
45
|
+
const preparedTweets = includeNumbers
|
|
46
|
+
? this.addThreadNumbers(tweets, numberFormat)
|
|
47
|
+
: tweets;
|
|
48
|
+
|
|
49
|
+
// Validate all tweet lengths
|
|
50
|
+
for (let i = 0; i < preparedTweets.length; i++) {
|
|
51
|
+
if (preparedTweets[i].length > 280) {
|
|
52
|
+
throw new Error(`Tweet ${i + 1} exceeds Twitter's 280 character limit (current: ${preparedTweets[i].length} characters)`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const createdTweets: Tweet[] = [];
|
|
57
|
+
const createdPosts: SocialPost[] = [];
|
|
58
|
+
let previousTweetId: string | undefined;
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
// Create tweets in sequence
|
|
62
|
+
for (let i = 0; i < preparedTweets.length; i++) {
|
|
63
|
+
LogStatus(`Creating tweet ${i + 1} of ${preparedTweets.length}...`);
|
|
64
|
+
|
|
65
|
+
const tweetData: CreateTweetData = {
|
|
66
|
+
text: preparedTweets[i]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Reply to previous tweet in thread
|
|
70
|
+
if (previousTweetId) {
|
|
71
|
+
tweetData.reply = {
|
|
72
|
+
in_reply_to_tweet_id: previousTweetId
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Add media if provided for this tweet
|
|
77
|
+
if (mediaFilesByTweet && mediaFilesByTweet[i]) {
|
|
78
|
+
const mediaFiles = mediaFilesByTweet[i];
|
|
79
|
+
if (Array.isArray(mediaFiles) && mediaFiles.length > 0) {
|
|
80
|
+
if (mediaFiles.length > 4) {
|
|
81
|
+
throw new Error(`Tweet ${i + 1}: Twitter supports a maximum of 4 media items per tweet`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
LogStatus(`Uploading ${mediaFiles.length} media files for tweet ${i + 1}...`);
|
|
85
|
+
const mediaIds = await this.uploadMedia(mediaFiles as MediaFile[]);
|
|
86
|
+
|
|
87
|
+
tweetData.media = {
|
|
88
|
+
media_ids: mediaIds
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Create the tweet
|
|
94
|
+
const tweet = await this.createTweet(tweetData);
|
|
95
|
+
createdTweets.push(tweet);
|
|
96
|
+
createdPosts.push(this.normalizePost(tweet));
|
|
97
|
+
previousTweetId = tweet.id;
|
|
98
|
+
|
|
99
|
+
// Small delay between tweets to avoid rate limiting
|
|
100
|
+
if (i < preparedTweets.length - 1) {
|
|
101
|
+
await new Promise(resolve => setTimeout(resolve, 1000)); // 1 second delay
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Get user info for URLs
|
|
106
|
+
const user = await this.getCurrentUser();
|
|
107
|
+
|
|
108
|
+
// Build thread URL (link to first tweet)
|
|
109
|
+
const threadUrl = `https://twitter.com/${user.username}/status/${createdTweets[0].id}`;
|
|
110
|
+
|
|
111
|
+
// Update output parameters
|
|
112
|
+
const outputParams = [...Params];
|
|
113
|
+
const postsParam = outputParams.find(p => p.Name === 'CreatedPosts');
|
|
114
|
+
if (postsParam) postsParam.Value = createdPosts;
|
|
115
|
+
const tweetIdsParam = outputParams.find(p => p.Name === 'TweetIDs');
|
|
116
|
+
if (tweetIdsParam) tweetIdsParam.Value = createdTweets.map(t => t.id);
|
|
117
|
+
const threadUrlParam = outputParams.find(p => p.Name === 'ThreadURL');
|
|
118
|
+
if (threadUrlParam) threadUrlParam.Value = threadUrl;
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
Success: true,
|
|
122
|
+
ResultCode: 'SUCCESS',
|
|
123
|
+
Message: `Successfully created thread with ${createdTweets.length} tweets`,
|
|
124
|
+
Params: outputParams
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
} catch (error) {
|
|
128
|
+
// If thread creation fails partway through, note which tweets were created
|
|
129
|
+
if (createdTweets.length > 0) {
|
|
130
|
+
LogError(`Thread creation failed after creating ${createdTweets.length} tweets. Tweet IDs: ${createdTweets.map(t => t.id).join(', ')}`);
|
|
131
|
+
}
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
} catch (error) {
|
|
136
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
Success: false,
|
|
140
|
+
ResultCode: this.getErrorCode(error),
|
|
141
|
+
Message: `Failed to create thread: ${errorMessage}`,
|
|
142
|
+
Params
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Add thread numbers to tweets
|
|
149
|
+
*/
|
|
150
|
+
private addThreadNumbers(tweets: string[], format: string): string[] {
|
|
151
|
+
const total = tweets.length;
|
|
152
|
+
|
|
153
|
+
return tweets.map((tweet, index) => {
|
|
154
|
+
const number = index + 1;
|
|
155
|
+
const threadNumber = format
|
|
156
|
+
.replace('{n}', number.toString())
|
|
157
|
+
.replace('{total}', total.toString());
|
|
158
|
+
|
|
159
|
+
// Add number to beginning of tweet with a space
|
|
160
|
+
return `${threadNumber} ${tweet}`;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get error code based on error type
|
|
166
|
+
*/
|
|
167
|
+
private getErrorCode(error: any): string {
|
|
168
|
+
if (error instanceof Error) {
|
|
169
|
+
if (error.message.includes('Rate Limit')) return 'RATE_LIMIT';
|
|
170
|
+
if (error.message.includes('Unauthorized')) return 'INVALID_TOKEN';
|
|
171
|
+
if (error.message.includes('character limit')) return 'CONTENT_TOO_LONG';
|
|
172
|
+
if (error.message.includes('media')) return 'INVALID_MEDIA';
|
|
173
|
+
}
|
|
174
|
+
return 'ERROR';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Define the parameters this action expects
|
|
179
|
+
*/
|
|
180
|
+
public get Params(): ActionParam[] {
|
|
181
|
+
return [
|
|
182
|
+
...this.commonSocialParams,
|
|
183
|
+
{
|
|
184
|
+
Name: 'Tweets',
|
|
185
|
+
Type: 'Input',
|
|
186
|
+
Value: null
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
Name: 'MediaFilesByTweet',
|
|
190
|
+
Type: 'Input',
|
|
191
|
+
Value: null
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
Name: 'IncludeNumbers',
|
|
195
|
+
Type: 'Input',
|
|
196
|
+
Value: true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
Name: 'NumberFormat',
|
|
200
|
+
Type: 'Input',
|
|
201
|
+
Value: '{n}/{total}'
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
Name: 'CreatedPosts',
|
|
205
|
+
Type: 'Output',
|
|
206
|
+
Value: null
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
Name: 'TweetIDs',
|
|
210
|
+
Type: 'Output',
|
|
211
|
+
Value: null
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
Name: 'ThreadURL',
|
|
215
|
+
Type: 'Output',
|
|
216
|
+
Value: null
|
|
217
|
+
}
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Get action description
|
|
223
|
+
*/
|
|
224
|
+
public get Description(): string {
|
|
225
|
+
return 'Creates a thread (series of connected tweets) on Twitter/X with optional media attachments and automatic numbering';
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
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 create a tweet on Twitter/X
|
|
9
|
+
*/
|
|
10
|
+
@RegisterClass(TwitterBaseAction, 'TwitterCreateTweetAction')
|
|
11
|
+
export class TwitterCreateTweetAction extends TwitterBaseAction {
|
|
12
|
+
/**
|
|
13
|
+
* Create a tweet on 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 content = this.getParamValue(Params, 'Content');
|
|
27
|
+
const mediaFiles = this.getParamValue(Params, 'MediaFiles');
|
|
28
|
+
const replyToTweetId = this.getParamValue(Params, 'ReplyToTweetID');
|
|
29
|
+
const quoteTweetId = this.getParamValue(Params, 'QuoteTweetID');
|
|
30
|
+
const pollOptions = this.getParamValue(Params, 'PollOptions');
|
|
31
|
+
const pollDurationMinutes = this.getParamValue(Params, 'PollDurationMinutes') || 1440; // Default 24 hours
|
|
32
|
+
|
|
33
|
+
// Validate required parameters
|
|
34
|
+
if (!content) {
|
|
35
|
+
throw new Error('Content is required');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Validate content length (Twitter's limit is 280 characters)
|
|
39
|
+
if (content.length > 280) {
|
|
40
|
+
throw new Error(`Content exceeds Twitter's 280 character limit (current: ${content.length} characters)`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Build tweet data
|
|
44
|
+
const tweetData: CreateTweetData = {
|
|
45
|
+
text: content
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Add reply if specified
|
|
49
|
+
if (replyToTweetId) {
|
|
50
|
+
tweetData.reply = {
|
|
51
|
+
in_reply_to_tweet_id: replyToTweetId
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Add quote tweet if specified
|
|
56
|
+
if (quoteTweetId) {
|
|
57
|
+
tweetData.quote_tweet_id = quoteTweetId;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Add poll if specified
|
|
61
|
+
if (pollOptions && Array.isArray(pollOptions) && pollOptions.length >= 2) {
|
|
62
|
+
if (pollOptions.length > 4) {
|
|
63
|
+
throw new Error('Twitter polls support a maximum of 4 options');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Validate poll option lengths (max 25 characters each)
|
|
67
|
+
for (const option of pollOptions) {
|
|
68
|
+
if (option.length > 25) {
|
|
69
|
+
throw new Error(`Poll option "${option}" exceeds 25 character limit`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
tweetData.poll = {
|
|
74
|
+
options: pollOptions,
|
|
75
|
+
duration_minutes: Math.min(Math.max(pollDurationMinutes, 5), 10080) // Min 5 minutes, max 7 days
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Upload media if provided
|
|
80
|
+
if (mediaFiles && Array.isArray(mediaFiles) && mediaFiles.length > 0) {
|
|
81
|
+
if (mediaFiles.length > 4) {
|
|
82
|
+
throw new Error('Twitter supports a maximum of 4 media items per tweet');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
LogStatus(`Uploading ${mediaFiles.length} media files...`);
|
|
86
|
+
const mediaIds = await this.uploadMedia(mediaFiles as MediaFile[]);
|
|
87
|
+
|
|
88
|
+
tweetData.media = {
|
|
89
|
+
media_ids: mediaIds
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Create the tweet
|
|
94
|
+
LogStatus('Creating tweet...');
|
|
95
|
+
const tweet = await this.createTweet(tweetData);
|
|
96
|
+
|
|
97
|
+
// Normalize the created tweet
|
|
98
|
+
const normalizedPost = this.normalizePost(tweet);
|
|
99
|
+
|
|
100
|
+
// Get user info for additional context
|
|
101
|
+
const user = await this.getCurrentUser();
|
|
102
|
+
|
|
103
|
+
// Update output parameters
|
|
104
|
+
const outputParams = [...Params];
|
|
105
|
+
const postParam = outputParams.find(p => p.Name === 'CreatedPost');
|
|
106
|
+
if (postParam) postParam.Value = normalizedPost;
|
|
107
|
+
const tweetIdParam = outputParams.find(p => p.Name === 'TweetID');
|
|
108
|
+
if (tweetIdParam) tweetIdParam.Value = tweet.id;
|
|
109
|
+
const tweetUrlParam = outputParams.find(p => p.Name === 'TweetURL');
|
|
110
|
+
if (tweetUrlParam) tweetUrlParam.Value = `https://twitter.com/${user.username}/status/${tweet.id}`;
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
Success: true,
|
|
114
|
+
ResultCode: 'SUCCESS',
|
|
115
|
+
Message: `Successfully created tweet (ID: ${tweet.id})`,
|
|
116
|
+
Params: outputParams
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
} catch (error) {
|
|
120
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
Success: false,
|
|
124
|
+
ResultCode: this.getErrorCode(error),
|
|
125
|
+
Message: `Failed to create tweet: ${errorMessage}`,
|
|
126
|
+
Params
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get error code based on error type
|
|
133
|
+
*/
|
|
134
|
+
private getErrorCode(error: any): string {
|
|
135
|
+
if (error instanceof Error) {
|
|
136
|
+
if (error.message.includes('Rate Limit')) return 'RATE_LIMIT';
|
|
137
|
+
if (error.message.includes('Unauthorized')) return 'INVALID_TOKEN';
|
|
138
|
+
if (error.message.includes('character limit')) return 'CONTENT_TOO_LONG';
|
|
139
|
+
if (error.message.includes('media')) return 'INVALID_MEDIA';
|
|
140
|
+
}
|
|
141
|
+
return 'ERROR';
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Define the parameters this action expects
|
|
146
|
+
*/
|
|
147
|
+
public get Params(): ActionParam[] {
|
|
148
|
+
return [
|
|
149
|
+
...this.commonSocialParams,
|
|
150
|
+
{
|
|
151
|
+
Name: 'Content',
|
|
152
|
+
Type: 'Input',
|
|
153
|
+
Value: null
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
Name: 'MediaFiles',
|
|
157
|
+
Type: 'Input',
|
|
158
|
+
Value: null
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
Name: 'ReplyToTweetID',
|
|
162
|
+
Type: 'Input',
|
|
163
|
+
Value: null
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
Name: 'QuoteTweetID',
|
|
167
|
+
Type: 'Input',
|
|
168
|
+
Value: null
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
Name: 'PollOptions',
|
|
172
|
+
Type: 'Input',
|
|
173
|
+
Value: null
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
Name: 'PollDurationMinutes',
|
|
177
|
+
Type: 'Input',
|
|
178
|
+
Value: 1440 // Default 24 hours
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
Name: 'CreatedPost',
|
|
182
|
+
Type: 'Output',
|
|
183
|
+
Value: null
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
Name: 'TweetID',
|
|
187
|
+
Type: 'Output',
|
|
188
|
+
Value: null
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
Name: 'TweetURL',
|
|
192
|
+
Type: 'Output',
|
|
193
|
+
Value: null
|
|
194
|
+
}
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get action description
|
|
200
|
+
*/
|
|
201
|
+
public get Description(): string {
|
|
202
|
+
return 'Creates a tweet on Twitter/X with optional media attachments, polls, replies, or quote tweets';
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { TwitterBaseAction } from '../twitter-base.action';
|
|
3
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
4
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Action to delete a tweet from Twitter/X
|
|
8
|
+
*/
|
|
9
|
+
@RegisterClass(TwitterBaseAction, 'TwitterDeleteTweetAction')
|
|
10
|
+
export class TwitterDeleteTweetAction extends TwitterBaseAction {
|
|
11
|
+
/**
|
|
12
|
+
* Delete a tweet from Twitter
|
|
13
|
+
*/
|
|
14
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
15
|
+
const { Params, ContextUser } = params;
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Initialize OAuth
|
|
19
|
+
const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
|
|
20
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
21
|
+
throw new Error('Failed to initialize OAuth connection');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Extract parameters
|
|
25
|
+
const tweetId = this.getParamValue(Params, 'TweetID');
|
|
26
|
+
const confirmDeletion = this.getParamValue(Params, 'ConfirmDeletion') === true;
|
|
27
|
+
|
|
28
|
+
// Validate required parameters
|
|
29
|
+
if (!tweetId) {
|
|
30
|
+
throw new Error('TweetID is required');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Safety check - require explicit confirmation
|
|
34
|
+
if (!confirmDeletion) {
|
|
35
|
+
return {
|
|
36
|
+
Success: false,
|
|
37
|
+
ResultCode: 'CONFIRMATION_REQUIRED',
|
|
38
|
+
Message: 'Tweet deletion requires explicit confirmation. Set ConfirmDeletion to true.',
|
|
39
|
+
Params
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Get the tweet details before deletion (for output)
|
|
44
|
+
let tweetDetails: any = null;
|
|
45
|
+
try {
|
|
46
|
+
LogStatus(`Retrieving tweet details for ID: ${tweetId}...`);
|
|
47
|
+
const response = await this.axiosInstance.get(`/tweets/${tweetId}`, {
|
|
48
|
+
params: {
|
|
49
|
+
'tweet.fields': 'id,text,created_at,author_id,public_metrics',
|
|
50
|
+
'expansions': 'author_id',
|
|
51
|
+
'user.fields': 'id,username'
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (response.data.data) {
|
|
56
|
+
tweetDetails = {
|
|
57
|
+
id: response.data.data.id,
|
|
58
|
+
text: response.data.data.text,
|
|
59
|
+
createdAt: response.data.data.created_at,
|
|
60
|
+
metrics: response.data.data.public_metrics
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Verify ownership
|
|
64
|
+
const currentUser = await this.getCurrentUser();
|
|
65
|
+
if (response.data.data.author_id !== currentUser.id) {
|
|
66
|
+
throw new Error('You can only delete your own tweets');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
// If we can't retrieve the tweet, it might already be deleted or we don't have access
|
|
71
|
+
LogStatus('Could not retrieve tweet details. It may already be deleted or inaccessible.');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Delete the tweet
|
|
75
|
+
LogStatus(`Deleting tweet ID: ${tweetId}...`);
|
|
76
|
+
await this.deleteTweet(tweetId);
|
|
77
|
+
|
|
78
|
+
// Update output parameters
|
|
79
|
+
const outputParams = [...Params];
|
|
80
|
+
const deletedDetailsParam = outputParams.find(p => p.Name === 'DeletedTweetDetails');
|
|
81
|
+
if (deletedDetailsParam && tweetDetails) deletedDetailsParam.Value = tweetDetails;
|
|
82
|
+
const deletionTimeParam = outputParams.find(p => p.Name === 'DeletionTime');
|
|
83
|
+
if (deletionTimeParam) deletionTimeParam.Value = new Date().toISOString();
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
Success: true,
|
|
87
|
+
ResultCode: 'SUCCESS',
|
|
88
|
+
Message: `Successfully deleted tweet (ID: ${tweetId})`,
|
|
89
|
+
Params: outputParams
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} catch (error) {
|
|
93
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
Success: false,
|
|
97
|
+
ResultCode: this.getErrorCode(error),
|
|
98
|
+
Message: `Failed to delete tweet: ${errorMessage}`,
|
|
99
|
+
Params
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Get error code based on error type
|
|
106
|
+
*/
|
|
107
|
+
private getErrorCode(error: any): string {
|
|
108
|
+
if (error instanceof Error) {
|
|
109
|
+
if (error.message.includes('Rate Limit')) return 'RATE_LIMIT';
|
|
110
|
+
if (error.message.includes('Unauthorized')) return 'INVALID_TOKEN';
|
|
111
|
+
if (error.message.includes('Not Found')) return 'TWEET_NOT_FOUND';
|
|
112
|
+
if (error.message.includes('Forbidden')) return 'INSUFFICIENT_PERMISSIONS';
|
|
113
|
+
if (error.message.includes('own tweets')) return 'NOT_OWNER';
|
|
114
|
+
}
|
|
115
|
+
return 'ERROR';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Define the parameters this action expects
|
|
120
|
+
*/
|
|
121
|
+
public get Params(): ActionParam[] {
|
|
122
|
+
return [
|
|
123
|
+
...this.commonSocialParams,
|
|
124
|
+
{
|
|
125
|
+
Name: 'TweetID',
|
|
126
|
+
Type: 'Input',
|
|
127
|
+
Value: null
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
Name: 'ConfirmDeletion',
|
|
131
|
+
Type: 'Input',
|
|
132
|
+
Value: false
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
Name: 'DeletedTweetDetails',
|
|
136
|
+
Type: 'Output',
|
|
137
|
+
Value: null
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
Name: 'DeletionTime',
|
|
141
|
+
Type: 'Output',
|
|
142
|
+
Value: null
|
|
143
|
+
}
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get action description
|
|
149
|
+
*/
|
|
150
|
+
public get Description(): string {
|
|
151
|
+
return 'Deletes a tweet from Twitter/X. Requires explicit confirmation and ownership of the tweet.';
|
|
152
|
+
}
|
|
153
|
+
}
|