@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,481 @@
|
|
|
1
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
2
|
+
import { BaseSocialMediaAction, MediaFile, SocialPost, SearchParams, SocialAnalytics } from '../../base/base-social.action';
|
|
3
|
+
import axios, { AxiosInstance, AxiosError } from 'axios';
|
|
4
|
+
import { ActionParam } from '@memberjunction/actions-base';
|
|
5
|
+
import { LogStatus, LogError } from '@memberjunction/core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Base class for all LinkedIn actions.
|
|
9
|
+
* Handles LinkedIn-specific authentication, API interactions, and rate limiting.
|
|
10
|
+
* Uses LinkedIn Marketing Developer Platform API v2.
|
|
11
|
+
*/
|
|
12
|
+
@RegisterClass(BaseSocialMediaAction, 'LinkedInBaseAction')
|
|
13
|
+
export abstract class LinkedInBaseAction extends BaseSocialMediaAction {
|
|
14
|
+
protected get platformName(): string {
|
|
15
|
+
return 'LinkedIn';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
protected get apiBaseUrl(): string {
|
|
19
|
+
return 'https://api.linkedin.com/v2';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Axios instance for making HTTP requests
|
|
24
|
+
*/
|
|
25
|
+
private _axiosInstance: AxiosInstance | null = null;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get or create axios instance with interceptors
|
|
29
|
+
*/
|
|
30
|
+
protected get axiosInstance(): AxiosInstance {
|
|
31
|
+
if (!this._axiosInstance) {
|
|
32
|
+
this._axiosInstance = axios.create({
|
|
33
|
+
baseURL: this.apiBaseUrl,
|
|
34
|
+
timeout: 30000,
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
'Accept': 'application/json',
|
|
38
|
+
'X-Restli-Protocol-Version': '2.0.0' // LinkedIn specific header
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Add request interceptor for auth
|
|
43
|
+
this._axiosInstance.interceptors.request.use(
|
|
44
|
+
(config) => {
|
|
45
|
+
const token = this.getAccessToken();
|
|
46
|
+
if (token) {
|
|
47
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
48
|
+
}
|
|
49
|
+
return config;
|
|
50
|
+
},
|
|
51
|
+
(error) => Promise.reject(error)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// Add response interceptor for rate limit handling
|
|
55
|
+
this._axiosInstance.interceptors.response.use(
|
|
56
|
+
(response) => {
|
|
57
|
+
// Log rate limit info
|
|
58
|
+
const rateLimitInfo = this.parseRateLimitHeaders(response.headers);
|
|
59
|
+
if (rateLimitInfo) {
|
|
60
|
+
LogStatus(`LinkedIn Rate Limit - Remaining: ${rateLimitInfo.remaining}/${rateLimitInfo.limit}, Reset: ${rateLimitInfo.reset}`);
|
|
61
|
+
}
|
|
62
|
+
return response;
|
|
63
|
+
},
|
|
64
|
+
async (error: AxiosError) => {
|
|
65
|
+
if (error.response?.status === 429) {
|
|
66
|
+
// Rate limit exceeded
|
|
67
|
+
const retryAfter = error.response.headers['retry-after'];
|
|
68
|
+
const waitTime = retryAfter ? parseInt(retryAfter) : 60;
|
|
69
|
+
await this.handleRateLimit(waitTime);
|
|
70
|
+
|
|
71
|
+
// Retry the request
|
|
72
|
+
return this._axiosInstance!.request(error.config!);
|
|
73
|
+
}
|
|
74
|
+
return Promise.reject(error);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return this._axiosInstance;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Refresh the access token using the refresh token
|
|
83
|
+
*/
|
|
84
|
+
protected async refreshAccessToken(): Promise<void> {
|
|
85
|
+
const refreshToken = this.getRefreshToken();
|
|
86
|
+
if (!refreshToken) {
|
|
87
|
+
throw new Error('No refresh token available for LinkedIn');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
const response = await axios.post('https://www.linkedin.com/oauth/v2/accessToken',
|
|
92
|
+
new URLSearchParams({
|
|
93
|
+
grant_type: 'refresh_token',
|
|
94
|
+
refresh_token: refreshToken,
|
|
95
|
+
client_id: this.getCustomAttribute(2) || '', // Client ID stored in CustomAttribute2
|
|
96
|
+
client_secret: this.getCustomAttribute(3) || '' // Client Secret stored in CustomAttribute3
|
|
97
|
+
}).toString(),
|
|
98
|
+
{
|
|
99
|
+
headers: {
|
|
100
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const { access_token, refresh_token: newRefreshToken, expires_in } = response.data;
|
|
106
|
+
|
|
107
|
+
// Update stored tokens
|
|
108
|
+
await this.updateStoredTokens(
|
|
109
|
+
access_token,
|
|
110
|
+
newRefreshToken || refreshToken,
|
|
111
|
+
expires_in
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
LogStatus('LinkedIn access token refreshed successfully');
|
|
115
|
+
} catch (error) {
|
|
116
|
+
LogError(`Failed to refresh LinkedIn access token: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get the authenticated user's profile URN
|
|
123
|
+
*/
|
|
124
|
+
protected async getCurrentUserUrn(): Promise<string> {
|
|
125
|
+
try {
|
|
126
|
+
const response = await this.axiosInstance.get('/me');
|
|
127
|
+
return `urn:li:person:${response.data.id}`;
|
|
128
|
+
} catch (error) {
|
|
129
|
+
LogError(`Failed to get current user URN: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Get organizations the user has admin access to
|
|
136
|
+
*/
|
|
137
|
+
protected async getAdminOrganizations(): Promise<LinkedInOrganization[]> {
|
|
138
|
+
try {
|
|
139
|
+
const response = await this.axiosInstance.get('/organizationalEntityAcls', {
|
|
140
|
+
params: {
|
|
141
|
+
q: 'roleAssignee',
|
|
142
|
+
role: 'ADMINISTRATOR',
|
|
143
|
+
projection: '(elements*(*,organizationalTarget~(localizedName)))'
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const organizations: LinkedInOrganization[] = [];
|
|
148
|
+
if (response.data.elements) {
|
|
149
|
+
for (const element of response.data.elements) {
|
|
150
|
+
if (element.organizationalTarget) {
|
|
151
|
+
organizations.push({
|
|
152
|
+
urn: element.organizationalTarget,
|
|
153
|
+
name: element['organizationalTarget~']?.localizedName || 'Unknown',
|
|
154
|
+
id: element.organizationalTarget.split(':').pop() || ''
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return organizations;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
LogError(`Failed to get admin organizations: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Upload media to LinkedIn
|
|
169
|
+
*/
|
|
170
|
+
protected async uploadSingleMedia(file: MediaFile): Promise<string> {
|
|
171
|
+
try {
|
|
172
|
+
// Step 1: Register upload
|
|
173
|
+
const registerResponse = await this.axiosInstance.post('/assets?action=registerUpload', {
|
|
174
|
+
registerUploadRequest: {
|
|
175
|
+
recipes: ['urn:li:digitalmediaRecipe:feedshare-image'],
|
|
176
|
+
owner: await this.getCurrentUserUrn(),
|
|
177
|
+
serviceRelationships: [{
|
|
178
|
+
relationshipType: 'OWNER',
|
|
179
|
+
identifier: 'urn:li:userGeneratedContent'
|
|
180
|
+
}]
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const uploadUrl = registerResponse.data.value.uploadMechanism['com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest'].uploadUrl;
|
|
185
|
+
const asset = registerResponse.data.value.asset;
|
|
186
|
+
|
|
187
|
+
// Step 2: Upload the file
|
|
188
|
+
const fileData = typeof file.data === 'string'
|
|
189
|
+
? Buffer.from(file.data, 'base64')
|
|
190
|
+
: file.data;
|
|
191
|
+
|
|
192
|
+
await axios.put(uploadUrl, fileData, {
|
|
193
|
+
headers: {
|
|
194
|
+
'Authorization': `Bearer ${this.getAccessToken()}`,
|
|
195
|
+
'Content-Type': file.mimeType
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Return the asset URN
|
|
200
|
+
return asset;
|
|
201
|
+
} catch (error) {
|
|
202
|
+
LogError(`Failed to upload media to LinkedIn: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Validate media file meets LinkedIn requirements
|
|
209
|
+
*/
|
|
210
|
+
protected validateMediaFile(file: MediaFile): void {
|
|
211
|
+
const supportedTypes = [
|
|
212
|
+
'image/jpeg',
|
|
213
|
+
'image/png',
|
|
214
|
+
'image/gif',
|
|
215
|
+
'image/webp'
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
if (!supportedTypes.includes(file.mimeType)) {
|
|
219
|
+
throw new Error(`Unsupported media type: ${file.mimeType}. Supported types: ${supportedTypes.join(', ')}`);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// LinkedIn image size limits
|
|
223
|
+
const maxSize = 10 * 1024 * 1024; // 10MB
|
|
224
|
+
if (file.size > maxSize) {
|
|
225
|
+
throw new Error(`File size exceeds limit. Max: ${maxSize / 1024 / 1024}MB, Got: ${file.size / 1024 / 1024}MB`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Create a share (post) on LinkedIn
|
|
231
|
+
*/
|
|
232
|
+
protected async createShare(shareData: LinkedInShareData): Promise<string> {
|
|
233
|
+
try {
|
|
234
|
+
const response = await this.axiosInstance.post('/ugcPosts', shareData);
|
|
235
|
+
return response.data.id;
|
|
236
|
+
} catch (error) {
|
|
237
|
+
this.handleLinkedInError(error as AxiosError);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Get shares for a specific author (person or organization)
|
|
243
|
+
*/
|
|
244
|
+
protected async getShares(authorUrn: string, count: number = 50, start: number = 0): Promise<LinkedInShare[]> {
|
|
245
|
+
try {
|
|
246
|
+
const response = await this.axiosInstance.get('/ugcPosts', {
|
|
247
|
+
params: {
|
|
248
|
+
q: 'authors',
|
|
249
|
+
authors: `List(${authorUrn})`,
|
|
250
|
+
count: count,
|
|
251
|
+
start: start
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
return response.data.elements || [];
|
|
256
|
+
} catch (error) {
|
|
257
|
+
LogError(`Failed to get shares: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Convert LinkedIn share to common format
|
|
264
|
+
*/
|
|
265
|
+
protected normalizePost(linkedInShare: LinkedInShare): SocialPost {
|
|
266
|
+
const publishedAt = new Date(linkedInShare.firstPublishedAt || linkedInShare.created.time);
|
|
267
|
+
|
|
268
|
+
// Extract media URLs
|
|
269
|
+
const mediaUrls: string[] = [];
|
|
270
|
+
if (linkedInShare.specificContent?.['com.linkedin.ugc.ShareContent']?.media) {
|
|
271
|
+
for (const media of linkedInShare.specificContent['com.linkedin.ugc.ShareContent'].media) {
|
|
272
|
+
if (media.media) {
|
|
273
|
+
mediaUrls.push(media.media);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return {
|
|
279
|
+
id: linkedInShare.id,
|
|
280
|
+
platform: 'LinkedIn',
|
|
281
|
+
profileId: linkedInShare.author,
|
|
282
|
+
content: linkedInShare.specificContent?.['com.linkedin.ugc.ShareContent']?.shareCommentary?.text || '',
|
|
283
|
+
mediaUrls: mediaUrls,
|
|
284
|
+
publishedAt: publishedAt,
|
|
285
|
+
platformSpecificData: {
|
|
286
|
+
lifecycleState: linkedInShare.lifecycleState,
|
|
287
|
+
visibility: linkedInShare.visibility,
|
|
288
|
+
distribution: linkedInShare.distribution
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Normalize LinkedIn analytics to common format
|
|
295
|
+
*/
|
|
296
|
+
protected normalizeAnalytics(linkedInAnalytics: LinkedInAnalytics): SocialAnalytics {
|
|
297
|
+
return {
|
|
298
|
+
impressions: linkedInAnalytics.totalShareStatistics?.impressionCount || 0,
|
|
299
|
+
engagements: linkedInAnalytics.totalShareStatistics?.engagement || 0,
|
|
300
|
+
clicks: linkedInAnalytics.totalShareStatistics?.clickCount || 0,
|
|
301
|
+
shares: linkedInAnalytics.totalShareStatistics?.shareCount || 0,
|
|
302
|
+
comments: linkedInAnalytics.totalShareStatistics?.commentCount || 0,
|
|
303
|
+
likes: linkedInAnalytics.totalShareStatistics?.likeCount || 0,
|
|
304
|
+
reach: linkedInAnalytics.totalShareStatistics?.uniqueImpressionsCount || 0,
|
|
305
|
+
platformMetrics: linkedInAnalytics
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Search for posts - implemented in search action
|
|
311
|
+
*/
|
|
312
|
+
protected async searchPosts(params: SearchParams): Promise<SocialPost[]> {
|
|
313
|
+
// This is implemented in the search-posts.action.ts
|
|
314
|
+
throw new Error('Search posts is implemented in LinkedInSearchPostsAction');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Handle LinkedIn-specific errors
|
|
319
|
+
*/
|
|
320
|
+
protected handleLinkedInError(error: AxiosError): never {
|
|
321
|
+
if (error.response) {
|
|
322
|
+
const { status, data } = error.response;
|
|
323
|
+
const errorData = data as any;
|
|
324
|
+
|
|
325
|
+
switch (status) {
|
|
326
|
+
case 400:
|
|
327
|
+
throw new Error(`Bad Request: ${errorData.message || 'Invalid request parameters'}`);
|
|
328
|
+
case 401:
|
|
329
|
+
throw new Error('Unauthorized: Invalid or expired access token');
|
|
330
|
+
case 403:
|
|
331
|
+
throw new Error('Forbidden: Insufficient permissions. Ensure the app has required LinkedIn scopes.');
|
|
332
|
+
case 404:
|
|
333
|
+
throw new Error('Not Found: Resource does not exist');
|
|
334
|
+
case 422:
|
|
335
|
+
throw new Error(`Unprocessable Entity: ${errorData.message || 'Invalid data provided'}`);
|
|
336
|
+
case 429:
|
|
337
|
+
throw new Error('Rate Limit Exceeded: Too many requests');
|
|
338
|
+
case 500:
|
|
339
|
+
throw new Error('Internal Server Error: LinkedIn service error');
|
|
340
|
+
default:
|
|
341
|
+
throw new Error(`LinkedIn API Error (${status}): ${errorData.message || 'Unknown error'}`);
|
|
342
|
+
}
|
|
343
|
+
} else if (error.request) {
|
|
344
|
+
throw new Error('Network Error: No response from LinkedIn');
|
|
345
|
+
} else {
|
|
346
|
+
throw new Error(`Request Error: ${error.message}`);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Parse LinkedIn-specific rate limit headers
|
|
352
|
+
*/
|
|
353
|
+
protected parseRateLimitHeaders(headers: any): { remaining: number; reset: Date; limit: number; } | null {
|
|
354
|
+
// LinkedIn uses different header names
|
|
355
|
+
const appRemaining = headers['x-app-rate-limit-remaining'];
|
|
356
|
+
const appLimit = headers['x-app-rate-limit-limit'];
|
|
357
|
+
const memberRemaining = headers['x-member-rate-limit-remaining'];
|
|
358
|
+
const memberLimit = headers['x-member-rate-limit-limit'];
|
|
359
|
+
|
|
360
|
+
// Use the more restrictive limit
|
|
361
|
+
const remaining = Math.min(
|
|
362
|
+
appRemaining ? parseInt(appRemaining) : Infinity,
|
|
363
|
+
memberRemaining ? parseInt(memberRemaining) : Infinity
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
const limit = Math.min(
|
|
367
|
+
appLimit ? parseInt(appLimit) : Infinity,
|
|
368
|
+
memberLimit ? parseInt(memberLimit) : Infinity
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
if (remaining !== Infinity && limit !== Infinity) {
|
|
372
|
+
// LinkedIn resets rate limits at the top of each hour
|
|
373
|
+
const now = new Date();
|
|
374
|
+
const reset = new Date(now);
|
|
375
|
+
reset.setHours(reset.getHours() + 1, 0, 0, 0);
|
|
376
|
+
|
|
377
|
+
return { remaining, reset, limit };
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* LinkedIn-specific interfaces
|
|
386
|
+
*/
|
|
387
|
+
export interface LinkedInOrganization {
|
|
388
|
+
urn: string;
|
|
389
|
+
name: string;
|
|
390
|
+
id: string;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface LinkedInShareData {
|
|
394
|
+
author: string; // URN of the author (person or organization)
|
|
395
|
+
lifecycleState: 'PUBLISHED' | 'DRAFT';
|
|
396
|
+
specificContent: {
|
|
397
|
+
'com.linkedin.ugc.ShareContent': {
|
|
398
|
+
shareCommentary: {
|
|
399
|
+
text: string;
|
|
400
|
+
};
|
|
401
|
+
shareMediaCategory: 'NONE' | 'ARTICLE' | 'IMAGE' | 'VIDEO' | 'RICH';
|
|
402
|
+
media?: Array<{
|
|
403
|
+
status: 'READY';
|
|
404
|
+
media: string; // Asset URN
|
|
405
|
+
title?: {
|
|
406
|
+
text: string;
|
|
407
|
+
};
|
|
408
|
+
description?: {
|
|
409
|
+
text: string;
|
|
410
|
+
};
|
|
411
|
+
}>;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
visibility: {
|
|
415
|
+
'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC' | 'CONNECTIONS' | 'LOGGED_IN' | 'CONTAINER';
|
|
416
|
+
};
|
|
417
|
+
distribution?: {
|
|
418
|
+
linkedInDistributionTarget?: {
|
|
419
|
+
visibleToGuest?: boolean;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface LinkedInShare {
|
|
425
|
+
id: string;
|
|
426
|
+
author: string;
|
|
427
|
+
created: {
|
|
428
|
+
actor: string;
|
|
429
|
+
time: number;
|
|
430
|
+
};
|
|
431
|
+
firstPublishedAt?: number;
|
|
432
|
+
lastModified?: {
|
|
433
|
+
actor: string;
|
|
434
|
+
time: number;
|
|
435
|
+
};
|
|
436
|
+
lifecycleState: string;
|
|
437
|
+
specificContent: {
|
|
438
|
+
'com.linkedin.ugc.ShareContent': {
|
|
439
|
+
shareCommentary: {
|
|
440
|
+
text: string;
|
|
441
|
+
};
|
|
442
|
+
shareMediaCategory: string;
|
|
443
|
+
media?: Array<{
|
|
444
|
+
media: string;
|
|
445
|
+
title?: {
|
|
446
|
+
text: string;
|
|
447
|
+
};
|
|
448
|
+
}>;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
visibility: {
|
|
452
|
+
'com.linkedin.ugc.MemberNetworkVisibility': string;
|
|
453
|
+
};
|
|
454
|
+
distribution?: any;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface LinkedInAnalytics {
|
|
458
|
+
totalShareStatistics?: {
|
|
459
|
+
impressionCount: number;
|
|
460
|
+
clickCount: number;
|
|
461
|
+
engagement: number;
|
|
462
|
+
likeCount: number;
|
|
463
|
+
commentCount: number;
|
|
464
|
+
shareCount: number;
|
|
465
|
+
uniqueImpressionsCount: number;
|
|
466
|
+
};
|
|
467
|
+
timeRange?: {
|
|
468
|
+
start: number;
|
|
469
|
+
end: number;
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface LinkedInArticle {
|
|
474
|
+
author: string;
|
|
475
|
+
publishedAt: number;
|
|
476
|
+
coverImage?: string;
|
|
477
|
+
title: string;
|
|
478
|
+
description?: string;
|
|
479
|
+
content: string;
|
|
480
|
+
visibility: string;
|
|
481
|
+
}
|