@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.
Files changed (458) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +16 -0
  3. package/README.md +375 -0
  4. package/dist/base/base-social.action.d.ts +137 -0
  5. package/dist/base/base-social.action.d.ts.map +1 -0
  6. package/dist/base/base-social.action.js +176 -0
  7. package/dist/base/base-social.action.js.map +1 -0
  8. package/dist/index.d.ts +10 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +35 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/providers/buffer/actions/create-post.action.d.ts +20 -0
  13. package/dist/providers/buffer/actions/create-post.action.d.ts.map +1 -0
  14. package/dist/providers/buffer/actions/create-post.action.js +195 -0
  15. package/dist/providers/buffer/actions/create-post.action.js.map +1 -0
  16. package/dist/providers/buffer/actions/delete-post.action.d.ts +20 -0
  17. package/dist/providers/buffer/actions/delete-post.action.d.ts.map +1 -0
  18. package/dist/providers/buffer/actions/delete-post.action.js +119 -0
  19. package/dist/providers/buffer/actions/delete-post.action.js.map +1 -0
  20. package/dist/providers/buffer/actions/get-analytics.action.d.ts +28 -0
  21. package/dist/providers/buffer/actions/get-analytics.action.d.ts.map +1 -0
  22. package/dist/providers/buffer/actions/get-analytics.action.js +143 -0
  23. package/dist/providers/buffer/actions/get-analytics.action.js.map +1 -0
  24. package/dist/providers/buffer/actions/get-pending-posts.action.d.ts +24 -0
  25. package/dist/providers/buffer/actions/get-pending-posts.action.d.ts.map +1 -0
  26. package/dist/providers/buffer/actions/get-pending-posts.action.js +161 -0
  27. package/dist/providers/buffer/actions/get-pending-posts.action.js.map +1 -0
  28. package/dist/providers/buffer/actions/get-profiles.action.d.ts +24 -0
  29. package/dist/providers/buffer/actions/get-profiles.action.d.ts.map +1 -0
  30. package/dist/providers/buffer/actions/get-profiles.action.js +128 -0
  31. package/dist/providers/buffer/actions/get-profiles.action.js.map +1 -0
  32. package/dist/providers/buffer/actions/get-sent-posts.action.d.ts +32 -0
  33. package/dist/providers/buffer/actions/get-sent-posts.action.d.ts.map +1 -0
  34. package/dist/providers/buffer/actions/get-sent-posts.action.js +187 -0
  35. package/dist/providers/buffer/actions/get-sent-posts.action.js.map +1 -0
  36. package/dist/providers/buffer/actions/index.d.ts +9 -0
  37. package/dist/providers/buffer/actions/index.d.ts.map +1 -0
  38. package/dist/providers/buffer/actions/index.js +25 -0
  39. package/dist/providers/buffer/actions/index.js.map +1 -0
  40. package/dist/providers/buffer/actions/reorder-queue.action.d.ts +20 -0
  41. package/dist/providers/buffer/actions/reorder-queue.action.d.ts.map +1 -0
  42. package/dist/providers/buffer/actions/reorder-queue.action.js +138 -0
  43. package/dist/providers/buffer/actions/reorder-queue.action.js.map +1 -0
  44. package/dist/providers/buffer/actions/search-posts.action.d.ts +28 -0
  45. package/dist/providers/buffer/actions/search-posts.action.d.ts.map +1 -0
  46. package/dist/providers/buffer/actions/search-posts.action.js +249 -0
  47. package/dist/providers/buffer/actions/search-posts.action.js.map +1 -0
  48. package/dist/providers/buffer/buffer-base.action.d.ts +95 -0
  49. package/dist/providers/buffer/buffer-base.action.d.ts.map +1 -0
  50. package/dist/providers/buffer/buffer-base.action.js +419 -0
  51. package/dist/providers/buffer/buffer-base.action.js.map +1 -0
  52. package/dist/providers/buffer/index.d.ts +3 -0
  53. package/dist/providers/buffer/index.d.ts.map +1 -0
  54. package/dist/providers/buffer/index.js +19 -0
  55. package/dist/providers/buffer/index.js.map +1 -0
  56. package/dist/providers/facebook/actions/boost-post.action.d.ts +45 -0
  57. package/dist/providers/facebook/actions/boost-post.action.d.ts.map +1 -0
  58. package/dist/providers/facebook/actions/boost-post.action.js +340 -0
  59. package/dist/providers/facebook/actions/boost-post.action.js.map +1 -0
  60. package/dist/providers/facebook/actions/create-album.action.d.ts +33 -0
  61. package/dist/providers/facebook/actions/create-album.action.d.ts.map +1 -0
  62. package/dist/providers/facebook/actions/create-album.action.js +285 -0
  63. package/dist/providers/facebook/actions/create-album.action.js.map +1 -0
  64. package/dist/providers/facebook/actions/create-post.action.d.ts +21 -0
  65. package/dist/providers/facebook/actions/create-post.action.d.ts.map +1 -0
  66. package/dist/providers/facebook/actions/create-post.action.js +223 -0
  67. package/dist/providers/facebook/actions/create-post.action.js.map +1 -0
  68. package/dist/providers/facebook/actions/get-page-insights.action.d.ts +37 -0
  69. package/dist/providers/facebook/actions/get-page-insights.action.d.ts.map +1 -0
  70. package/dist/providers/facebook/actions/get-page-insights.action.js +359 -0
  71. package/dist/providers/facebook/actions/get-page-insights.action.js.map +1 -0
  72. package/dist/providers/facebook/actions/get-page-posts.action.d.ts +29 -0
  73. package/dist/providers/facebook/actions/get-page-posts.action.d.ts.map +1 -0
  74. package/dist/providers/facebook/actions/get-page-posts.action.js +216 -0
  75. package/dist/providers/facebook/actions/get-page-posts.action.js.map +1 -0
  76. package/dist/providers/facebook/actions/get-post-insights.action.d.ts +33 -0
  77. package/dist/providers/facebook/actions/get-post-insights.action.d.ts.map +1 -0
  78. package/dist/providers/facebook/actions/get-post-insights.action.js +287 -0
  79. package/dist/providers/facebook/actions/get-post-insights.action.js.map +1 -0
  80. package/dist/providers/facebook/actions/index.d.ts +10 -0
  81. package/dist/providers/facebook/actions/index.d.ts.map +1 -0
  82. package/dist/providers/facebook/actions/index.js +26 -0
  83. package/dist/providers/facebook/actions/index.js.map +1 -0
  84. package/dist/providers/facebook/actions/respond-to-comments.action.d.ts +41 -0
  85. package/dist/providers/facebook/actions/respond-to-comments.action.d.ts.map +1 -0
  86. package/dist/providers/facebook/actions/respond-to-comments.action.js +328 -0
  87. package/dist/providers/facebook/actions/respond-to-comments.action.js.map +1 -0
  88. package/dist/providers/facebook/actions/schedule-post.action.d.ts +29 -0
  89. package/dist/providers/facebook/actions/schedule-post.action.d.ts.map +1 -0
  90. package/dist/providers/facebook/actions/schedule-post.action.js +289 -0
  91. package/dist/providers/facebook/actions/schedule-post.action.js.map +1 -0
  92. package/dist/providers/facebook/actions/search-posts.action.d.ts +54 -0
  93. package/dist/providers/facebook/actions/search-posts.action.d.ts.map +1 -0
  94. package/dist/providers/facebook/actions/search-posts.action.js +396 -0
  95. package/dist/providers/facebook/actions/search-posts.action.js.map +1 -0
  96. package/dist/providers/facebook/facebook-base.action.d.ts +230 -0
  97. package/dist/providers/facebook/facebook-base.action.d.ts.map +1 -0
  98. package/dist/providers/facebook/facebook-base.action.js +566 -0
  99. package/dist/providers/facebook/facebook-base.action.js.map +1 -0
  100. package/dist/providers/facebook/index.d.ts +3 -0
  101. package/dist/providers/facebook/index.d.ts.map +1 -0
  102. package/dist/providers/facebook/index.js +19 -0
  103. package/dist/providers/facebook/index.js.map +1 -0
  104. package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.d.ts +24 -0
  105. package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.d.ts.map +1 -0
  106. package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.js +266 -0
  107. package/dist/providers/hootsuite/actions/bulk-schedule-posts.action.js.map +1 -0
  108. package/dist/providers/hootsuite/actions/create-scheduled-post.action.d.ts +25 -0
  109. package/dist/providers/hootsuite/actions/create-scheduled-post.action.d.ts.map +1 -0
  110. package/dist/providers/hootsuite/actions/create-scheduled-post.action.js +202 -0
  111. package/dist/providers/hootsuite/actions/create-scheduled-post.action.js.map +1 -0
  112. package/dist/providers/hootsuite/actions/delete-scheduled-post.action.d.ts +20 -0
  113. package/dist/providers/hootsuite/actions/delete-scheduled-post.action.d.ts.map +1 -0
  114. package/dist/providers/hootsuite/actions/delete-scheduled-post.action.js +172 -0
  115. package/dist/providers/hootsuite/actions/delete-scheduled-post.action.js.map +1 -0
  116. package/dist/providers/hootsuite/actions/get-analytics.action.d.ts +52 -0
  117. package/dist/providers/hootsuite/actions/get-analytics.action.d.ts.map +1 -0
  118. package/dist/providers/hootsuite/actions/get-analytics.action.js +265 -0
  119. package/dist/providers/hootsuite/actions/get-analytics.action.js.map +1 -0
  120. package/dist/providers/hootsuite/actions/get-scheduled-posts.action.d.ts +37 -0
  121. package/dist/providers/hootsuite/actions/get-scheduled-posts.action.d.ts.map +1 -0
  122. package/dist/providers/hootsuite/actions/get-scheduled-posts.action.js +208 -0
  123. package/dist/providers/hootsuite/actions/get-scheduled-posts.action.js.map +1 -0
  124. package/dist/providers/hootsuite/actions/get-social-profiles.action.d.ts +36 -0
  125. package/dist/providers/hootsuite/actions/get-social-profiles.action.d.ts.map +1 -0
  126. package/dist/providers/hootsuite/actions/get-social-profiles.action.js +212 -0
  127. package/dist/providers/hootsuite/actions/get-social-profiles.action.js.map +1 -0
  128. package/dist/providers/hootsuite/actions/search-posts.action.d.ts +53 -0
  129. package/dist/providers/hootsuite/actions/search-posts.action.d.ts.map +1 -0
  130. package/dist/providers/hootsuite/actions/search-posts.action.js +353 -0
  131. package/dist/providers/hootsuite/actions/search-posts.action.js.map +1 -0
  132. package/dist/providers/hootsuite/actions/update-scheduled-post.action.d.ts +20 -0
  133. package/dist/providers/hootsuite/actions/update-scheduled-post.action.d.ts.map +1 -0
  134. package/dist/providers/hootsuite/actions/update-scheduled-post.action.js +217 -0
  135. package/dist/providers/hootsuite/actions/update-scheduled-post.action.js.map +1 -0
  136. package/dist/providers/hootsuite/hootsuite-base.action.d.ts +101 -0
  137. package/dist/providers/hootsuite/hootsuite-base.action.d.ts.map +1 -0
  138. package/dist/providers/hootsuite/hootsuite-base.action.js +274 -0
  139. package/dist/providers/hootsuite/hootsuite-base.action.js.map +1 -0
  140. package/dist/providers/hootsuite/index.d.ts +10 -0
  141. package/dist/providers/hootsuite/index.d.ts.map +1 -0
  142. package/dist/providers/hootsuite/index.js +28 -0
  143. package/dist/providers/hootsuite/index.js.map +1 -0
  144. package/dist/providers/instagram/actions/create-post.action.d.ts +30 -0
  145. package/dist/providers/instagram/actions/create-post.action.d.ts.map +1 -0
  146. package/dist/providers/instagram/actions/create-post.action.js +269 -0
  147. package/dist/providers/instagram/actions/create-post.action.js.map +1 -0
  148. package/dist/providers/instagram/actions/create-story.action.d.ts +43 -0
  149. package/dist/providers/instagram/actions/create-story.action.d.ts.map +1 -0
  150. package/dist/providers/instagram/actions/create-story.action.js +365 -0
  151. package/dist/providers/instagram/actions/create-story.action.js.map +1 -0
  152. package/dist/providers/instagram/actions/get-account-insights.action.d.ts +50 -0
  153. package/dist/providers/instagram/actions/get-account-insights.action.d.ts.map +1 -0
  154. package/dist/providers/instagram/actions/get-account-insights.action.js +390 -0
  155. package/dist/providers/instagram/actions/get-account-insights.action.js.map +1 -0
  156. package/dist/providers/instagram/actions/get-business-posts.action.d.ts +30 -0
  157. package/dist/providers/instagram/actions/get-business-posts.action.d.ts.map +1 -0
  158. package/dist/providers/instagram/actions/get-business-posts.action.js +246 -0
  159. package/dist/providers/instagram/actions/get-business-posts.action.js.map +1 -0
  160. package/dist/providers/instagram/actions/get-comments.action.d.ts +41 -0
  161. package/dist/providers/instagram/actions/get-comments.action.d.ts.map +1 -0
  162. package/dist/providers/instagram/actions/get-comments.action.js +337 -0
  163. package/dist/providers/instagram/actions/get-comments.action.js.map +1 -0
  164. package/dist/providers/instagram/actions/get-post-insights.action.d.ts +42 -0
  165. package/dist/providers/instagram/actions/get-post-insights.action.d.ts.map +1 -0
  166. package/dist/providers/instagram/actions/get-post-insights.action.js +271 -0
  167. package/dist/providers/instagram/actions/get-post-insights.action.js.map +1 -0
  168. package/dist/providers/instagram/actions/index.d.ts +9 -0
  169. package/dist/providers/instagram/actions/index.d.ts.map +1 -0
  170. package/dist/providers/instagram/actions/index.js +26 -0
  171. package/dist/providers/instagram/actions/index.js.map +1 -0
  172. package/dist/providers/instagram/actions/schedule-post.action.d.ts +34 -0
  173. package/dist/providers/instagram/actions/schedule-post.action.d.ts.map +1 -0
  174. package/dist/providers/instagram/actions/schedule-post.action.js +234 -0
  175. package/dist/providers/instagram/actions/schedule-post.action.js.map +1 -0
  176. package/dist/providers/instagram/actions/search-posts.action.d.ts +56 -0
  177. package/dist/providers/instagram/actions/search-posts.action.d.ts.map +1 -0
  178. package/dist/providers/instagram/actions/search-posts.action.js +479 -0
  179. package/dist/providers/instagram/actions/search-posts.action.js.map +1 -0
  180. package/dist/providers/instagram/index.d.ts +3 -0
  181. package/dist/providers/instagram/index.d.ts.map +1 -0
  182. package/dist/providers/instagram/index.js +20 -0
  183. package/dist/providers/instagram/index.js.map +1 -0
  184. package/dist/providers/instagram/instagram-base.action.d.ts +76 -0
  185. package/dist/providers/instagram/instagram-base.action.d.ts.map +1 -0
  186. package/dist/providers/instagram/instagram-base.action.js +362 -0
  187. package/dist/providers/instagram/instagram-base.action.js.map +1 -0
  188. package/dist/providers/linkedin/actions/create-article.action.d.ts +28 -0
  189. package/dist/providers/linkedin/actions/create-article.action.d.ts.map +1 -0
  190. package/dist/providers/linkedin/actions/create-article.action.js +275 -0
  191. package/dist/providers/linkedin/actions/create-article.action.js.map +1 -0
  192. package/dist/providers/linkedin/actions/create-post.action.d.ts +20 -0
  193. package/dist/providers/linkedin/actions/create-post.action.d.ts.map +1 -0
  194. package/dist/providers/linkedin/actions/create-post.action.js +188 -0
  195. package/dist/providers/linkedin/actions/create-post.action.js.map +1 -0
  196. package/dist/providers/linkedin/actions/get-followers.action.d.ts +29 -0
  197. package/dist/providers/linkedin/actions/get-followers.action.d.ts.map +1 -0
  198. package/dist/providers/linkedin/actions/get-followers.action.js +222 -0
  199. package/dist/providers/linkedin/actions/get-followers.action.js.map +1 -0
  200. package/dist/providers/linkedin/actions/get-organization-posts.action.d.ts +24 -0
  201. package/dist/providers/linkedin/actions/get-organization-posts.action.d.ts.map +1 -0
  202. package/dist/providers/linkedin/actions/get-organization-posts.action.js +163 -0
  203. package/dist/providers/linkedin/actions/get-organization-posts.action.js.map +1 -0
  204. package/dist/providers/linkedin/actions/get-personal-posts.action.d.ts +25 -0
  205. package/dist/providers/linkedin/actions/get-personal-posts.action.d.ts.map +1 -0
  206. package/dist/providers/linkedin/actions/get-personal-posts.action.js +156 -0
  207. package/dist/providers/linkedin/actions/get-personal-posts.action.js.map +1 -0
  208. package/dist/providers/linkedin/actions/get-post-analytics.action.d.ts +28 -0
  209. package/dist/providers/linkedin/actions/get-post-analytics.action.d.ts.map +1 -0
  210. package/dist/providers/linkedin/actions/get-post-analytics.action.js +200 -0
  211. package/dist/providers/linkedin/actions/get-post-analytics.action.js.map +1 -0
  212. package/dist/providers/linkedin/actions/index.d.ts +9 -0
  213. package/dist/providers/linkedin/actions/index.d.ts.map +1 -0
  214. package/dist/providers/linkedin/actions/index.js +25 -0
  215. package/dist/providers/linkedin/actions/index.js.map +1 -0
  216. package/dist/providers/linkedin/actions/schedule-post.action.d.ts +22 -0
  217. package/dist/providers/linkedin/actions/schedule-post.action.d.ts.map +1 -0
  218. package/dist/providers/linkedin/actions/schedule-post.action.js +205 -0
  219. package/dist/providers/linkedin/actions/schedule-post.action.js.map +1 -0
  220. package/dist/providers/linkedin/actions/search-posts.action.d.ts +41 -0
  221. package/dist/providers/linkedin/actions/search-posts.action.d.ts.map +1 -0
  222. package/dist/providers/linkedin/actions/search-posts.action.js +292 -0
  223. package/dist/providers/linkedin/actions/search-posts.action.js.map +1 -0
  224. package/dist/providers/linkedin/index.d.ts +3 -0
  225. package/dist/providers/linkedin/index.d.ts.map +1 -0
  226. package/dist/providers/linkedin/index.js +19 -0
  227. package/dist/providers/linkedin/index.js.map +1 -0
  228. package/dist/providers/linkedin/linkedin-base.action.d.ts +166 -0
  229. package/dist/providers/linkedin/linkedin-base.action.d.ts.map +1 -0
  230. package/dist/providers/linkedin/linkedin-base.action.js +346 -0
  231. package/dist/providers/linkedin/linkedin-base.action.js.map +1 -0
  232. package/dist/providers/tiktok/actions/create-video-post.action.d.ts +21 -0
  233. package/dist/providers/tiktok/actions/create-video-post.action.d.ts.map +1 -0
  234. package/dist/providers/tiktok/actions/create-video-post.action.js +226 -0
  235. package/dist/providers/tiktok/actions/create-video-post.action.js.map +1 -0
  236. package/dist/providers/tiktok/actions/get-account-analytics.action.d.ts +32 -0
  237. package/dist/providers/tiktok/actions/get-account-analytics.action.d.ts.map +1 -0
  238. package/dist/providers/tiktok/actions/get-account-analytics.action.js +242 -0
  239. package/dist/providers/tiktok/actions/get-account-analytics.action.js.map +1 -0
  240. package/dist/providers/tiktok/actions/get-comments.action.d.ts +44 -0
  241. package/dist/providers/tiktok/actions/get-comments.action.d.ts.map +1 -0
  242. package/dist/providers/tiktok/actions/get-comments.action.js +290 -0
  243. package/dist/providers/tiktok/actions/get-comments.action.js.map +1 -0
  244. package/dist/providers/tiktok/actions/get-trending-hashtags.action.d.ts +48 -0
  245. package/dist/providers/tiktok/actions/get-trending-hashtags.action.d.ts.map +1 -0
  246. package/dist/providers/tiktok/actions/get-trending-hashtags.action.js +309 -0
  247. package/dist/providers/tiktok/actions/get-trending-hashtags.action.js.map +1 -0
  248. package/dist/providers/tiktok/actions/get-user-videos.action.d.ts +20 -0
  249. package/dist/providers/tiktok/actions/get-user-videos.action.d.ts.map +1 -0
  250. package/dist/providers/tiktok/actions/get-user-videos.action.js +131 -0
  251. package/dist/providers/tiktok/actions/get-user-videos.action.js.map +1 -0
  252. package/dist/providers/tiktok/actions/get-video-analytics.action.d.ts +28 -0
  253. package/dist/providers/tiktok/actions/get-video-analytics.action.d.ts.map +1 -0
  254. package/dist/providers/tiktok/actions/get-video-analytics.action.js +198 -0
  255. package/dist/providers/tiktok/actions/get-video-analytics.action.js.map +1 -0
  256. package/dist/providers/tiktok/actions/index.d.ts +8 -0
  257. package/dist/providers/tiktok/actions/index.d.ts.map +1 -0
  258. package/dist/providers/tiktok/actions/index.js +25 -0
  259. package/dist/providers/tiktok/actions/index.js.map +1 -0
  260. package/dist/providers/tiktok/actions/search-videos.action.d.ts +89 -0
  261. package/dist/providers/tiktok/actions/search-videos.action.d.ts.map +1 -0
  262. package/dist/providers/tiktok/actions/search-videos.action.js +653 -0
  263. package/dist/providers/tiktok/actions/search-videos.action.js.map +1 -0
  264. package/dist/providers/tiktok/index.d.ts +3 -0
  265. package/dist/providers/tiktok/index.d.ts.map +1 -0
  266. package/dist/providers/tiktok/index.js +20 -0
  267. package/dist/providers/tiktok/index.js.map +1 -0
  268. package/dist/providers/tiktok/tiktok-base.action.d.ts +87 -0
  269. package/dist/providers/tiktok/tiktok-base.action.d.ts.map +1 -0
  270. package/dist/providers/tiktok/tiktok-base.action.js +294 -0
  271. package/dist/providers/tiktok/tiktok-base.action.js.map +1 -0
  272. package/dist/providers/twitter/actions/create-thread.action.d.ts +28 -0
  273. package/dist/providers/twitter/actions/create-thread.action.d.ts.map +1 -0
  274. package/dist/providers/twitter/actions/create-thread.action.js +217 -0
  275. package/dist/providers/twitter/actions/create-thread.action.js.map +1 -0
  276. package/dist/providers/twitter/actions/create-tweet.action.d.ts +24 -0
  277. package/dist/providers/twitter/actions/create-tweet.action.d.ts.map +1 -0
  278. package/dist/providers/twitter/actions/create-tweet.action.js +199 -0
  279. package/dist/providers/twitter/actions/create-tweet.action.js.map +1 -0
  280. package/dist/providers/twitter/actions/delete-tweet.action.d.ts +24 -0
  281. package/dist/providers/twitter/actions/delete-tweet.action.d.ts.map +1 -0
  282. package/dist/providers/twitter/actions/delete-tweet.action.js +158 -0
  283. package/dist/providers/twitter/actions/delete-tweet.action.js.map +1 -0
  284. package/dist/providers/twitter/actions/get-analytics.action.d.ts +44 -0
  285. package/dist/providers/twitter/actions/get-analytics.action.d.ts.map +1 -0
  286. package/dist/providers/twitter/actions/get-analytics.action.js +399 -0
  287. package/dist/providers/twitter/actions/get-analytics.action.js.map +1 -0
  288. package/dist/providers/twitter/actions/get-mentions.action.d.ts +24 -0
  289. package/dist/providers/twitter/actions/get-mentions.action.d.ts.map +1 -0
  290. package/dist/providers/twitter/actions/get-mentions.action.js +229 -0
  291. package/dist/providers/twitter/actions/get-mentions.action.js.map +1 -0
  292. package/dist/providers/twitter/actions/get-timeline.action.d.ts +24 -0
  293. package/dist/providers/twitter/actions/get-timeline.action.d.ts.map +1 -0
  294. package/dist/providers/twitter/actions/get-timeline.action.js +249 -0
  295. package/dist/providers/twitter/actions/get-timeline.action.js.map +1 -0
  296. package/dist/providers/twitter/actions/index.d.ts +14 -0
  297. package/dist/providers/twitter/actions/index.d.ts.map +1 -0
  298. package/dist/providers/twitter/actions/index.js +30 -0
  299. package/dist/providers/twitter/actions/index.js.map +1 -0
  300. package/dist/providers/twitter/actions/schedule-tweet.action.d.ts +30 -0
  301. package/dist/providers/twitter/actions/schedule-tweet.action.d.ts.map +1 -0
  302. package/dist/providers/twitter/actions/schedule-tweet.action.js +250 -0
  303. package/dist/providers/twitter/actions/schedule-tweet.action.js.map +1 -0
  304. package/dist/providers/twitter/actions/search-tweets.action.d.ts +41 -0
  305. package/dist/providers/twitter/actions/search-tweets.action.d.ts.map +1 -0
  306. package/dist/providers/twitter/actions/search-tweets.action.js +559 -0
  307. package/dist/providers/twitter/actions/search-tweets.action.js.map +1 -0
  308. package/dist/providers/twitter/index.d.ts +8 -0
  309. package/dist/providers/twitter/index.d.ts.map +1 -0
  310. package/dist/providers/twitter/index.js +24 -0
  311. package/dist/providers/twitter/index.js.map +1 -0
  312. package/dist/providers/twitter/twitter-base.action.d.ts +185 -0
  313. package/dist/providers/twitter/twitter-base.action.d.ts.map +1 -0
  314. package/dist/providers/twitter/twitter-base.action.js +484 -0
  315. package/dist/providers/twitter/twitter-base.action.js.map +1 -0
  316. package/dist/providers/youtube/actions/create-playlist.action.d.ts +28 -0
  317. package/dist/providers/youtube/actions/create-playlist.action.d.ts.map +1 -0
  318. package/dist/providers/youtube/actions/create-playlist.action.js +235 -0
  319. package/dist/providers/youtube/actions/create-playlist.action.js.map +1 -0
  320. package/dist/providers/youtube/actions/get-channel-analytics.action.d.ts +60 -0
  321. package/dist/providers/youtube/actions/get-channel-analytics.action.d.ts.map +1 -0
  322. package/dist/providers/youtube/actions/get-channel-analytics.action.js +429 -0
  323. package/dist/providers/youtube/actions/get-channel-analytics.action.js.map +1 -0
  324. package/dist/providers/youtube/actions/get-channel-videos.action.d.ts +28 -0
  325. package/dist/providers/youtube/actions/get-channel-videos.action.d.ts.map +1 -0
  326. package/dist/providers/youtube/actions/get-channel-videos.action.js +263 -0
  327. package/dist/providers/youtube/actions/get-channel-videos.action.js.map +1 -0
  328. package/dist/providers/youtube/actions/get-comments.action.d.ts +40 -0
  329. package/dist/providers/youtube/actions/get-comments.action.d.ts.map +1 -0
  330. package/dist/providers/youtube/actions/get-comments.action.js +381 -0
  331. package/dist/providers/youtube/actions/get-comments.action.js.map +1 -0
  332. package/dist/providers/youtube/actions/get-video-analytics.action.d.ts +48 -0
  333. package/dist/providers/youtube/actions/get-video-analytics.action.d.ts.map +1 -0
  334. package/dist/providers/youtube/actions/get-video-analytics.action.js +280 -0
  335. package/dist/providers/youtube/actions/get-video-analytics.action.js.map +1 -0
  336. package/dist/providers/youtube/actions/index.d.ts +10 -0
  337. package/dist/providers/youtube/actions/index.d.ts.map +1 -0
  338. package/dist/providers/youtube/actions/index.js +26 -0
  339. package/dist/providers/youtube/actions/index.js.map +1 -0
  340. package/dist/providers/youtube/actions/schedule-video.action.d.ts +24 -0
  341. package/dist/providers/youtube/actions/schedule-video.action.d.ts.map +1 -0
  342. package/dist/providers/youtube/actions/schedule-video.action.js +225 -0
  343. package/dist/providers/youtube/actions/schedule-video.action.js.map +1 -0
  344. package/dist/providers/youtube/actions/search-videos.action.d.ts +40 -0
  345. package/dist/providers/youtube/actions/search-videos.action.d.ts.map +1 -0
  346. package/dist/providers/youtube/actions/search-videos.action.js +483 -0
  347. package/dist/providers/youtube/actions/search-videos.action.js.map +1 -0
  348. package/dist/providers/youtube/actions/update-video-metadata.action.d.ts +32 -0
  349. package/dist/providers/youtube/actions/update-video-metadata.action.d.ts.map +1 -0
  350. package/dist/providers/youtube/actions/update-video-metadata.action.js +298 -0
  351. package/dist/providers/youtube/actions/update-video-metadata.action.js.map +1 -0
  352. package/dist/providers/youtube/actions/upload-video.action.d.ts +28 -0
  353. package/dist/providers/youtube/actions/upload-video.action.d.ts.map +1 -0
  354. package/dist/providers/youtube/actions/upload-video.action.js +266 -0
  355. package/dist/providers/youtube/actions/upload-video.action.js.map +1 -0
  356. package/dist/providers/youtube/index.d.ts +3 -0
  357. package/dist/providers/youtube/index.d.ts.map +1 -0
  358. package/dist/providers/youtube/index.js +19 -0
  359. package/dist/providers/youtube/index.js.map +1 -0
  360. package/dist/providers/youtube/youtube-base.action.d.ts +83 -0
  361. package/dist/providers/youtube/youtube-base.action.d.ts.map +1 -0
  362. package/dist/providers/youtube/youtube-base.action.js +319 -0
  363. package/dist/providers/youtube/youtube-base.action.js.map +1 -0
  364. package/package.json +42 -0
  365. package/social_actions_summary.md +439 -0
  366. package/src/base/base-social.action.ts +270 -0
  367. package/src/index.ts +26 -0
  368. package/src/providers/buffer/actions/create-post.action.ts +205 -0
  369. package/src/providers/buffer/actions/delete-post.action.ts +116 -0
  370. package/src/providers/buffer/actions/get-analytics.action.ts +146 -0
  371. package/src/providers/buffer/actions/get-pending-posts.action.ts +161 -0
  372. package/src/providers/buffer/actions/get-profiles.action.ts +126 -0
  373. package/src/providers/buffer/actions/get-sent-posts.action.ts +189 -0
  374. package/src/providers/buffer/actions/index.ts +8 -0
  375. package/src/providers/buffer/actions/reorder-queue.action.ts +141 -0
  376. package/src/providers/buffer/actions/search-posts.action.ts +262 -0
  377. package/src/providers/buffer/buffer-base.action.ts +490 -0
  378. package/src/providers/buffer/index.ts +2 -0
  379. package/src/providers/facebook/actions/boost-post.action.ts +412 -0
  380. package/src/providers/facebook/actions/create-album.action.ts +335 -0
  381. package/src/providers/facebook/actions/create-post.action.ts +243 -0
  382. package/src/providers/facebook/actions/get-page-insights.action.ts +427 -0
  383. package/src/providers/facebook/actions/get-page-posts.action.ts +241 -0
  384. package/src/providers/facebook/actions/get-post-insights.action.ts +338 -0
  385. package/src/providers/facebook/actions/index.ts +9 -0
  386. package/src/providers/facebook/actions/respond-to-comments.action.ts +372 -0
  387. package/src/providers/facebook/actions/schedule-post.action.ts +310 -0
  388. package/src/providers/facebook/actions/search-posts.action.ts +449 -0
  389. package/src/providers/facebook/facebook-base.action.ts +750 -0
  390. package/src/providers/facebook/index.ts +2 -0
  391. package/src/providers/hootsuite/actions/bulk-schedule-posts.action.ts +293 -0
  392. package/src/providers/hootsuite/actions/create-scheduled-post.action.ts +206 -0
  393. package/src/providers/hootsuite/actions/delete-scheduled-post.action.ts +173 -0
  394. package/src/providers/hootsuite/actions/get-analytics.action.ts +281 -0
  395. package/src/providers/hootsuite/actions/get-scheduled-posts.action.ts +220 -0
  396. package/src/providers/hootsuite/actions/get-social-profiles.action.ts +220 -0
  397. package/src/providers/hootsuite/actions/search-posts.action.ts +395 -0
  398. package/src/providers/hootsuite/actions/update-scheduled-post.action.ts +222 -0
  399. package/src/providers/hootsuite/hootsuite-base.action.ts +346 -0
  400. package/src/providers/hootsuite/index.ts +12 -0
  401. package/src/providers/instagram/README.md +129 -0
  402. package/src/providers/instagram/actions/create-post.action.ts +329 -0
  403. package/src/providers/instagram/actions/create-story.action.ts +415 -0
  404. package/src/providers/instagram/actions/get-account-insights.action.ts +449 -0
  405. package/src/providers/instagram/actions/get-business-posts.action.ts +281 -0
  406. package/src/providers/instagram/actions/get-comments.action.ts +395 -0
  407. package/src/providers/instagram/actions/get-post-insights.action.ts +302 -0
  408. package/src/providers/instagram/actions/index.ts +9 -0
  409. package/src/providers/instagram/actions/schedule-post.action.ts +248 -0
  410. package/src/providers/instagram/actions/search-posts.action.ts +569 -0
  411. package/src/providers/instagram/index.ts +3 -0
  412. package/src/providers/instagram/instagram-base.action.ts +430 -0
  413. package/src/providers/linkedin/actions/create-article.action.ts +301 -0
  414. package/src/providers/linkedin/actions/create-post.action.ts +190 -0
  415. package/src/providers/linkedin/actions/get-followers.action.ts +226 -0
  416. package/src/providers/linkedin/actions/get-organization-posts.action.ts +164 -0
  417. package/src/providers/linkedin/actions/get-personal-posts.action.ts +158 -0
  418. package/src/providers/linkedin/actions/get-post-analytics.action.ts +205 -0
  419. package/src/providers/linkedin/actions/index.ts +8 -0
  420. package/src/providers/linkedin/actions/schedule-post.action.ts +206 -0
  421. package/src/providers/linkedin/actions/search-posts.action.ts +323 -0
  422. package/src/providers/linkedin/index.ts +2 -0
  423. package/src/providers/linkedin/linkedin-base.action.ts +481 -0
  424. package/src/providers/tiktok/actions/create-video-post.action.ts +234 -0
  425. package/src/providers/tiktok/actions/get-account-analytics.action.ts +255 -0
  426. package/src/providers/tiktok/actions/get-comments.action.ts +332 -0
  427. package/src/providers/tiktok/actions/get-trending-hashtags.action.ts +341 -0
  428. package/src/providers/tiktok/actions/get-user-videos.action.ts +136 -0
  429. package/src/providers/tiktok/actions/get-video-analytics.action.ts +218 -0
  430. package/src/providers/tiktok/actions/index.ts +8 -0
  431. package/src/providers/tiktok/actions/search-videos.action.ts +717 -0
  432. package/src/providers/tiktok/index.ts +3 -0
  433. package/src/providers/tiktok/tiktok-base.action.ts +356 -0
  434. package/src/providers/twitter/README.md +207 -0
  435. package/src/providers/twitter/actions/create-thread.action.ts +227 -0
  436. package/src/providers/twitter/actions/create-tweet.action.ts +204 -0
  437. package/src/providers/twitter/actions/delete-tweet.action.ts +153 -0
  438. package/src/providers/twitter/actions/get-analytics.action.ts +440 -0
  439. package/src/providers/twitter/actions/get-mentions.action.ts +233 -0
  440. package/src/providers/twitter/actions/get-timeline.action.ts +248 -0
  441. package/src/providers/twitter/actions/index.ts +14 -0
  442. package/src/providers/twitter/actions/schedule-tweet.action.ts +259 -0
  443. package/src/providers/twitter/actions/search-tweets.action.ts +588 -0
  444. package/src/providers/twitter/index.ts +8 -0
  445. package/src/providers/twitter/twitter-base.action.ts +629 -0
  446. package/src/providers/youtube/actions/create-playlist.action.ts +256 -0
  447. package/src/providers/youtube/actions/get-channel-analytics.action.ts +502 -0
  448. package/src/providers/youtube/actions/get-channel-videos.action.ts +286 -0
  449. package/src/providers/youtube/actions/get-comments.action.ts +411 -0
  450. package/src/providers/youtube/actions/get-video-analytics.action.ts +298 -0
  451. package/src/providers/youtube/actions/index.ts +9 -0
  452. package/src/providers/youtube/actions/schedule-video.action.ts +246 -0
  453. package/src/providers/youtube/actions/search-videos.action.ts +530 -0
  454. package/src/providers/youtube/actions/update-video-metadata.action.ts +321 -0
  455. package/src/providers/youtube/actions/upload-video.action.ts +288 -0
  456. package/src/providers/youtube/index.ts +2 -0
  457. package/src/providers/youtube/youtube-base.action.ts +373 -0
  458. package/tsconfig.json +18 -0
@@ -0,0 +1,281 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { InstagramBaseAction } from '../instagram-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+ import { LogError } from '@memberjunction/core';
5
+ import { SocialPost } from '../../../base/base-social.action';
6
+
7
+ /**
8
+ * Retrieves posts from an Instagram Business account.
9
+ * Returns feed posts, carousels, reels, and IGTV videos with basic metrics.
10
+ */
11
+ @RegisterClass(InstagramBaseAction, 'Instagram - Get Business Posts')
12
+ export class InstagramGetBusinessPostsAction extends InstagramBaseAction {
13
+
14
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
15
+ try {
16
+ const companyIntegrationId = this.getParamValue(params.Params, 'CompanyIntegrationID');
17
+ const limit = this.getParamValue(params.Params, 'Limit') || 25;
18
+ const mediaType = this.getParamValue(params.Params, 'MediaType');
19
+ const includeMetrics = this.getParamValue(params.Params, 'IncludeMetrics') !== false;
20
+ const afterCursor = this.getParamValue(params.Params, 'AfterCursor');
21
+ const startDate = this.getParamValue(params.Params, 'StartDate');
22
+ const endDate = this.getParamValue(params.Params, 'EndDate');
23
+
24
+ // Initialize OAuth
25
+ if (!await this.initializeOAuth(companyIntegrationId)) {
26
+ return {
27
+ Success: false,
28
+ Message: 'Failed to initialize Instagram authentication',
29
+ ResultCode: 'AUTH_FAILED'
30
+ };
31
+ }
32
+
33
+ // Build fields parameter
34
+ let fields = 'id,caption,media_type,media_url,thumbnail_url,permalink,timestamp';
35
+ if (includeMetrics) {
36
+ fields += ',like_count,comments_count,impressions,reach,saved,video_views';
37
+ }
38
+
39
+ // Build query parameters
40
+ const queryParams: any = {
41
+ fields,
42
+ access_token: this.getAccessToken(),
43
+ limit: Math.min(limit, 100) // Instagram max is 100 per request
44
+ };
45
+
46
+ if (afterCursor) {
47
+ queryParams.after = afterCursor;
48
+ }
49
+
50
+ // Add date filtering if provided
51
+ if (startDate) {
52
+ queryParams.since = Math.floor(new Date(startDate).getTime() / 1000);
53
+ }
54
+ if (endDate) {
55
+ queryParams.until = Math.floor(new Date(endDate).getTime() / 1000);
56
+ }
57
+
58
+ // Fetch posts
59
+ const response = await this.makeInstagramRequest<{
60
+ data: any[];
61
+ paging?: {
62
+ cursors: {
63
+ before: string;
64
+ after: string;
65
+ };
66
+ next?: string;
67
+ previous?: string;
68
+ };
69
+ }>(
70
+ `${this.instagramBusinessAccountId}/media`,
71
+ 'GET',
72
+ null,
73
+ queryParams
74
+ );
75
+
76
+ // Filter by media type if specified
77
+ let posts = response.data || [];
78
+ if (mediaType) {
79
+ posts = posts.filter(post => post.media_type === mediaType);
80
+ }
81
+
82
+ // Transform to common format
83
+ const normalizedPosts: SocialPost[] = posts.map(post => this.normalizePost(post));
84
+
85
+ // Get additional insights if requested and available
86
+ if (includeMetrics && posts.length > 0) {
87
+ await this.enrichPostsWithInsights(normalizedPosts);
88
+ }
89
+
90
+ // Store result in output params
91
+ const outputParams = [...params.Params];
92
+ outputParams.push({
93
+ Name: 'ResultData',
94
+ Type: 'Output',
95
+ Value: JSON.stringify({
96
+ posts: normalizedPosts,
97
+ paging: {
98
+ hasNext: !!response.paging?.next,
99
+ hasPrevious: !!response.paging?.previous,
100
+ afterCursor: response.paging?.cursors?.after,
101
+ beforeCursor: response.paging?.cursors?.before
102
+ },
103
+ summary: {
104
+ totalPosts: normalizedPosts.length,
105
+ mediaTypes: this.summarizeMediaTypes(posts),
106
+ dateRange: this.getDateRange(normalizedPosts)
107
+ }
108
+ })
109
+ });
110
+
111
+ return {
112
+ Success: true,
113
+ Message: `Retrieved ${normalizedPosts.length} Instagram posts`,
114
+ ResultCode: 'SUCCESS',
115
+ Params: outputParams
116
+ };
117
+
118
+ } catch (error: any) {
119
+ LogError('Failed to retrieve Instagram business posts', error);
120
+
121
+ if (error.code === 'RATE_LIMIT') {
122
+ return {
123
+ Success: false,
124
+ Message: 'Instagram API rate limit exceeded. Please try again later.',
125
+ ResultCode: 'RATE_LIMIT'
126
+ };
127
+ }
128
+
129
+ if (error.code === 'INSUFFICIENT_PERMISSIONS') {
130
+ return {
131
+ Success: false,
132
+ Message: 'Insufficient permissions to access Instagram business posts',
133
+ ResultCode: 'INSUFFICIENT_PERMISSIONS'
134
+ };
135
+ }
136
+
137
+ return {
138
+ Success: false,
139
+ Message: `Failed to retrieve Instagram posts: ${error.message}`,
140
+ ResultCode: 'ERROR'
141
+ };
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Enrich posts with additional insights data
147
+ */
148
+ private async enrichPostsWithInsights(posts: SocialPost[]): Promise<void> {
149
+ // Instagram allows batch insights requests
150
+ const postIds = posts.map(p => p.id);
151
+ const batchSize = 50; // Instagram's batch limit
152
+
153
+ for (let i = 0; i < postIds.length; i += batchSize) {
154
+ const batch = postIds.slice(i, i + batchSize);
155
+
156
+ try {
157
+ // Get insights for this batch
158
+ const metrics = ['impressions', 'reach', 'engagement', 'saved', 'video_views'];
159
+ const insightsPromises = batch.map(postId =>
160
+ this.getInsights(postId, metrics, 'lifetime')
161
+ );
162
+
163
+ const insightsResults = await Promise.allSettled(insightsPromises);
164
+
165
+ // Map insights back to posts
166
+ insightsResults.forEach((result, index) => {
167
+ if (result.status === 'fulfilled' && result.value) {
168
+ const postIndex = i + index;
169
+ const post = posts[postIndex];
170
+
171
+ // Parse insights data
172
+ result.value.forEach((metric: any) => {
173
+ const value = metric.values?.[0]?.value || 0;
174
+
175
+ switch (metric.name) {
176
+ case 'impressions':
177
+ post.analytics!.impressions = value;
178
+ break;
179
+ case 'reach':
180
+ post.analytics!.reach = value;
181
+ break;
182
+ case 'engagement':
183
+ post.analytics!.engagements = value;
184
+ break;
185
+ case 'saved':
186
+ post.analytics!.saves = value;
187
+ break;
188
+ case 'video_views':
189
+ post.analytics!.videoViews = value;
190
+ break;
191
+ }
192
+ });
193
+ }
194
+ });
195
+ } catch (error) {
196
+ // Log but don't fail the whole operation
197
+ LogError(`Failed to get insights for batch starting at ${i}`, error);
198
+ }
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Summarize media types in the response
204
+ */
205
+ private summarizeMediaTypes(posts: any[]): Record<string, number> {
206
+ const summary: Record<string, number> = {
207
+ IMAGE: 0,
208
+ VIDEO: 0,
209
+ CAROUSEL_ALBUM: 0
210
+ };
211
+
212
+ posts.forEach(post => {
213
+ if (summary[post.media_type] !== undefined) {
214
+ summary[post.media_type]++;
215
+ }
216
+ });
217
+
218
+ return summary;
219
+ }
220
+
221
+ /**
222
+ * Get date range of posts
223
+ */
224
+ private getDateRange(posts: SocialPost[]): { earliest: Date | null; latest: Date | null } {
225
+ if (posts.length === 0) {
226
+ return { earliest: null, latest: null };
227
+ }
228
+
229
+ const dates = posts.map(p => p.publishedAt.getTime());
230
+ return {
231
+ earliest: new Date(Math.min(...dates)),
232
+ latest: new Date(Math.max(...dates))
233
+ };
234
+ }
235
+
236
+ /**
237
+ * Define the parameters for this action
238
+ */
239
+ public get Params(): ActionParam[] {
240
+ return [
241
+ ...this.commonSocialParams,
242
+ {
243
+ Name: 'Limit',
244
+ Type: 'Input',
245
+ Value: 25
246
+ },
247
+ {
248
+ Name: 'MediaType',
249
+ Type: 'Input',
250
+ Value: null
251
+ },
252
+ {
253
+ Name: 'IncludeMetrics',
254
+ Type: 'Input',
255
+ Value: true
256
+ },
257
+ {
258
+ Name: 'AfterCursor',
259
+ Type: 'Input',
260
+ Value: null
261
+ },
262
+ {
263
+ Name: 'StartDate',
264
+ Type: 'Input',
265
+ Value: null
266
+ },
267
+ {
268
+ Name: 'EndDate',
269
+ Type: 'Input',
270
+ Value: null
271
+ }
272
+ ];
273
+ }
274
+
275
+ /**
276
+ * Get the description for this action
277
+ */
278
+ public get Description(): string {
279
+ return 'Retrieves posts from an Instagram Business account with optional metrics and filtering.';
280
+ }
281
+ }
@@ -0,0 +1,395 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { InstagramBaseAction } from '../instagram-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+ import { LogError } from '@memberjunction/core';
5
+
6
+ /**
7
+ * Retrieves comments for an Instagram post, including nested replies.
8
+ * Supports filtering, pagination, and sentiment analysis.
9
+ */
10
+ @RegisterClass(InstagramBaseAction, 'Instagram - Get Comments')
11
+ export class InstagramGetCommentsAction extends InstagramBaseAction {
12
+
13
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
14
+ try {
15
+ const companyIntegrationId = this.getParamValue(params.Params, 'CompanyIntegrationID');
16
+ const postId = this.getParamValue(params.Params, 'PostID');
17
+ const includeReplies = this.getParamValue(params.Params, 'IncludeReplies') !== false;
18
+ const includeHidden = this.getParamValue(params.Params, 'IncludeHidden') || false;
19
+ const limit = this.getParamValue(params.Params, 'Limit') || 50;
20
+ const afterCursor = this.getParamValue(params.Params, 'AfterCursor');
21
+
22
+ // Initialize OAuth
23
+ if (!await this.initializeOAuth(companyIntegrationId)) {
24
+ return {
25
+ Success: false,
26
+ Message: 'Failed to initialize Instagram authentication',
27
+ ResultCode: 'AUTH_FAILED'
28
+ };
29
+ }
30
+
31
+ // Validate inputs
32
+ if (!postId) {
33
+ return {
34
+ Success: false,
35
+ Message: 'PostID is required',
36
+ ResultCode: 'MISSING_PARAMS'
37
+ };
38
+ }
39
+
40
+ // Build fields for comment data
41
+ const fields = 'id,text,username,timestamp,like_count,replies{id,text,username,timestamp,like_count}';
42
+
43
+ // Build query parameters
44
+ const queryParams: any = {
45
+ fields,
46
+ access_token: this.getAccessToken(),
47
+ limit: Math.min(limit, 100)
48
+ };
49
+
50
+ if (afterCursor) {
51
+ queryParams.after = afterCursor;
52
+ }
53
+
54
+ // Get comments
55
+ const response = await this.makeInstagramRequest<{
56
+ data: any[];
57
+ paging?: {
58
+ cursors: {
59
+ before: string;
60
+ after: string;
61
+ };
62
+ next?: string;
63
+ };
64
+ }>(
65
+ `${postId}/comments`,
66
+ 'GET',
67
+ null,
68
+ queryParams
69
+ );
70
+
71
+ const comments = response.data || [];
72
+
73
+ // Process comments
74
+ const processedComments = await this.processComments(comments, includeReplies);
75
+
76
+ // Get hidden comments if requested
77
+ let hiddenComments: any[] = [];
78
+ if (includeHidden) {
79
+ hiddenComments = await this.getHiddenComments(postId);
80
+ }
81
+
82
+ // Calculate engagement metrics
83
+ const metrics = this.calculateCommentMetrics(processedComments);
84
+
85
+ // Analyze sentiment patterns
86
+ const sentimentAnalysis = this.analyzeSentiment(processedComments);
87
+
88
+ // Store result in output params
89
+ const outputParams = [...params.Params];
90
+ outputParams.push({
91
+ Name: 'ResultData',
92
+ Type: 'Output',
93
+ Value: JSON.stringify({
94
+ postId,
95
+ comments: processedComments,
96
+ hiddenComments,
97
+ metrics,
98
+ sentimentAnalysis,
99
+ paging: {
100
+ hasNext: !!response.paging?.next,
101
+ afterCursor: response.paging?.cursors?.after
102
+ }
103
+ })
104
+ });
105
+
106
+ return {
107
+ Success: true,
108
+ Message: `Retrieved ${processedComments.length} comments`,
109
+ ResultCode: 'SUCCESS',
110
+ Params: outputParams
111
+ };
112
+
113
+ } catch (error: any) {
114
+ LogError('Failed to retrieve Instagram comments', error);
115
+
116
+ if (error.code === 'RATE_LIMIT') {
117
+ return {
118
+ Success: false,
119
+ Message: 'Instagram API rate limit exceeded. Please try again later.',
120
+ ResultCode: 'RATE_LIMIT'
121
+ };
122
+ }
123
+
124
+ if (error.code === 'POST_NOT_FOUND') {
125
+ return {
126
+ Success: false,
127
+ Message: 'Instagram post not found or access denied',
128
+ ResultCode: 'POST_NOT_FOUND'
129
+ };
130
+ }
131
+
132
+ return {
133
+ Success: false,
134
+ Message: `Failed to retrieve comments: ${error.message}`,
135
+ ResultCode: 'ERROR'
136
+ };
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Process comments and fetch replies if needed
142
+ */
143
+ private async processComments(comments: any[], includeReplies: boolean): Promise<any[]> {
144
+ const processed: any[] = [];
145
+
146
+ for (const comment of comments) {
147
+ const processedComment: any = {
148
+ id: comment.id,
149
+ text: comment.text,
150
+ username: comment.username,
151
+ timestamp: comment.timestamp,
152
+ likeCount: comment.like_count || 0,
153
+ replies: [],
154
+ metrics: {
155
+ wordCount: this.countWords(comment.text),
156
+ hasEmojis: this.containsEmojis(comment.text),
157
+ hasMentions: this.containsMentions(comment.text),
158
+ hasHashtags: this.containsHashtags(comment.text)
159
+ }
160
+ };
161
+
162
+ // Process replies if they exist and are requested
163
+ if (includeReplies && comment.replies?.data) {
164
+ processedComment.replies = comment.replies.data.map((reply: any) => ({
165
+ id: reply.id,
166
+ text: reply.text,
167
+ username: reply.username,
168
+ timestamp: reply.timestamp,
169
+ likeCount: reply.like_count || 0,
170
+ metrics: {
171
+ wordCount: this.countWords(reply.text),
172
+ hasEmojis: this.containsEmojis(reply.text),
173
+ hasMentions: this.containsMentions(reply.text),
174
+ hasHashtags: this.containsHashtags(reply.text)
175
+ }
176
+ }));
177
+ }
178
+
179
+ processed.push(processedComment);
180
+ }
181
+
182
+ return processed;
183
+ }
184
+
185
+ /**
186
+ * Get hidden comments (comments hidden by the account)
187
+ */
188
+ private async getHiddenComments(postId: string): Promise<any[]> {
189
+ try {
190
+ const response = await this.makeInstagramRequest<{ data: any[] }>(
191
+ `${postId}/comments`,
192
+ 'GET',
193
+ null,
194
+ {
195
+ fields: 'id,text,username,timestamp,hidden',
196
+ access_token: this.getAccessToken(),
197
+ filter: 'hidden'
198
+ }
199
+ );
200
+
201
+ return response.data || [];
202
+ } catch (error) {
203
+ LogError('Failed to get hidden comments', error);
204
+ return [];
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Calculate comment metrics
210
+ */
211
+ private calculateCommentMetrics(comments: any[]): any {
212
+ const metrics = {
213
+ totalComments: comments.length,
214
+ totalReplies: 0,
215
+ avgCommentLength: 0,
216
+ avgLikesPerComment: 0,
217
+ topCommenters: [] as any[],
218
+ engagementRate: 0,
219
+ responseRate: 0
220
+ };
221
+
222
+ if (comments.length === 0) return metrics;
223
+
224
+ let totalLength = 0;
225
+ let totalLikes = 0;
226
+ const commenterCounts: Record<string, number> = {};
227
+
228
+ comments.forEach(comment => {
229
+ totalLength += comment.metrics.wordCount;
230
+ totalLikes += comment.likeCount;
231
+
232
+ // Count commenters
233
+ commenterCounts[comment.username] = (commenterCounts[comment.username] || 0) + 1;
234
+
235
+ // Count replies
236
+ metrics.totalReplies += comment.replies.length;
237
+
238
+ // Add reply stats
239
+ comment.replies.forEach((reply: any) => {
240
+ totalLength += reply.metrics.wordCount;
241
+ totalLikes += reply.likeCount;
242
+ commenterCounts[reply.username] = (commenterCounts[reply.username] || 0) + 1;
243
+ });
244
+ });
245
+
246
+ const totalInteractions = comments.length + metrics.totalReplies;
247
+ metrics.avgCommentLength = Math.round(totalLength / totalInteractions);
248
+ metrics.avgLikesPerComment = Math.round(totalLikes / totalInteractions);
249
+
250
+ // Get top commenters
251
+ metrics.topCommenters = Object.entries(commenterCounts)
252
+ .sort(([, a], [, b]) => b - a)
253
+ .slice(0, 10)
254
+ .map(([username, count]) => ({ username, count }));
255
+
256
+ // Calculate response rate (comments with replies)
257
+ const commentsWithReplies = comments.filter(c => c.replies.length > 0).length;
258
+ metrics.responseRate = (commentsWithReplies / comments.length) * 100;
259
+
260
+ return metrics;
261
+ }
262
+
263
+ /**
264
+ * Analyze sentiment patterns in comments
265
+ */
266
+ private analyzeSentiment(comments: any[]): any {
267
+ const analysis = {
268
+ positive: 0,
269
+ negative: 0,
270
+ neutral: 0,
271
+ questions: 0,
272
+ keywords: [] as any[],
273
+ emojis: [] as any[]
274
+ };
275
+
276
+ const keywordCounts: Record<string, number> = {};
277
+ const emojiCounts: Record<string, number> = {};
278
+
279
+ // Simple sentiment analysis based on keywords and patterns
280
+ const positiveWords = ['love', 'amazing', 'beautiful', 'great', 'awesome', 'perfect', 'excellent', 'wonderful', '❤️', '😍', '🔥', '💯'];
281
+ const negativeWords = ['hate', 'awful', 'terrible', 'bad', 'worst', 'ugly', 'disgusting', '😠', '😡', '👎'];
282
+ const questionWords = ['?', 'what', 'where', 'when', 'how', 'why', 'who'];
283
+
284
+ comments.forEach(comment => {
285
+ const text = comment.text.toLowerCase();
286
+
287
+ // Check sentiment
288
+ const hasPositive = positiveWords.some(word => text.includes(word));
289
+ const hasNegative = negativeWords.some(word => text.includes(word));
290
+ const hasQuestion = questionWords.some(word => text.includes(word));
291
+
292
+ if (hasQuestion) {
293
+ analysis.questions++;
294
+ }
295
+
296
+ if (hasPositive && !hasNegative) {
297
+ analysis.positive++;
298
+ } else if (hasNegative && !hasPositive) {
299
+ analysis.negative++;
300
+ } else {
301
+ analysis.neutral++;
302
+ }
303
+
304
+ // Extract keywords (simple word frequency)
305
+ const words = text.split(/\s+/).filter(word => word.length > 3);
306
+ words.forEach(word => {
307
+ keywordCounts[word] = (keywordCounts[word] || 0) + 1;
308
+ });
309
+
310
+ // Extract emojis
311
+ const emojis = text.match(/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]/gu) || [];
312
+ emojis.forEach(emoji => {
313
+ emojiCounts[emoji] = (emojiCounts[emoji] || 0) + 1;
314
+ });
315
+
316
+ // Analyze replies too
317
+ comment.replies.forEach((reply: any) => {
318
+ // Similar analysis for replies...
319
+ });
320
+ });
321
+
322
+ // Get top keywords and emojis
323
+ analysis.keywords = Object.entries(keywordCounts)
324
+ .sort(([, a], [, b]) => b - a)
325
+ .slice(0, 20)
326
+ .map(([keyword, count]) => ({ keyword, count }));
327
+
328
+ analysis.emojis = Object.entries(emojiCounts)
329
+ .sort(([, a], [, b]) => b - a)
330
+ .slice(0, 10)
331
+ .map(([emoji, count]) => ({ emoji, count }));
332
+
333
+ return analysis;
334
+ }
335
+
336
+ /**
337
+ * Helper methods for text analysis
338
+ */
339
+ private countWords(text: string): number {
340
+ return text.trim().split(/\s+/).length;
341
+ }
342
+
343
+ private containsEmojis(text: string): boolean {
344
+ return /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]/u.test(text);
345
+ }
346
+
347
+ private containsMentions(text: string): boolean {
348
+ return /@\w+/.test(text);
349
+ }
350
+
351
+ private containsHashtags(text: string): boolean {
352
+ return /#\w+/.test(text);
353
+ }
354
+
355
+ /**
356
+ * Define the parameters for this action
357
+ */
358
+ public get Params(): ActionParam[] {
359
+ return [
360
+ ...this.commonSocialParams,
361
+ {
362
+ Name: 'PostID',
363
+ Type: 'Input',
364
+ Value: null
365
+ },
366
+ {
367
+ Name: 'IncludeReplies',
368
+ Type: 'Input',
369
+ Value: true
370
+ },
371
+ {
372
+ Name: 'IncludeHidden',
373
+ Type: 'Input',
374
+ Value: false
375
+ },
376
+ {
377
+ Name: 'Limit',
378
+ Type: 'Input',
379
+ Value: 50
380
+ },
381
+ {
382
+ Name: 'AfterCursor',
383
+ Type: 'Input',
384
+ Value: null
385
+ }
386
+ ];
387
+ }
388
+
389
+ /**
390
+ * Get the description for this action
391
+ */
392
+ public get Description(): string {
393
+ return 'Retrieves comments for an Instagram post including replies, metrics, and sentiment analysis.';
394
+ }
395
+ }