@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,332 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { TikTokBaseAction } from '../tiktok-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+
5
+ /**
6
+ * Comment data structure
7
+ */
8
+ interface TikTokComment {
9
+ comment_id: string;
10
+ text: string;
11
+ create_time: number;
12
+ user: {
13
+ open_id: string;
14
+ display_name: string;
15
+ avatar_url: string;
16
+ };
17
+ like_count: number;
18
+ reply_count: number;
19
+ parent_comment_id?: string;
20
+ }
21
+
22
+ /**
23
+ * Action to get comments from TikTok videos
24
+ */
25
+ @RegisterClass(TikTokBaseAction, 'GetCommentsAction')
26
+ export class GetCommentsAction extends TikTokBaseAction {
27
+
28
+ /**
29
+ * Get comments from TikTok videos
30
+ */
31
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
32
+ const { Params } = params;
33
+
34
+ try {
35
+ // Initialize OAuth
36
+ const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
37
+ if (!companyIntegrationId) {
38
+ throw new Error('CompanyIntegrationID is required');
39
+ }
40
+
41
+ await this.initializeOAuth(companyIntegrationId);
42
+
43
+ // Extract parameters
44
+ const videoId = this.getParamValue(Params, 'VideoID');
45
+ const maxComments = this.getParamValue(Params, 'MaxComments') || 100;
46
+ const includeReplies = this.getParamValue(Params, 'IncludeReplies') !== false;
47
+ const sortBy = this.getParamValue(Params, 'SortBy') || 'time'; // time or likes
48
+
49
+ if (!videoId) {
50
+ throw new Error('VideoID is required');
51
+ }
52
+
53
+ // Get comments from TikTok API
54
+ const response = await this.makeTikTokRequest<any>(
55
+ `/v2/video/comment/list/`,
56
+ 'GET',
57
+ undefined,
58
+ {
59
+ video_id: videoId,
60
+ max_count: Math.min(maxComments, 100), // API limit
61
+ sort_by: sortBy
62
+ }
63
+ );
64
+
65
+ const comments: TikTokComment[] = response.data?.comments || [];
66
+
67
+ // Process comments
68
+ const processedComments = comments.map(comment => ({
69
+ id: comment.comment_id,
70
+ text: comment.text,
71
+ author: {
72
+ id: comment.user.open_id,
73
+ username: comment.user.display_name,
74
+ avatarUrl: comment.user.avatar_url
75
+ },
76
+ createdAt: new Date(comment.create_time * 1000),
77
+ likes: comment.like_count,
78
+ replies: comment.reply_count,
79
+ isReply: !!comment.parent_comment_id,
80
+ parentCommentId: comment.parent_comment_id,
81
+ sentiment: this.analyzeSentiment(comment.text),
82
+ containsQuestion: this.containsQuestion(comment.text),
83
+ length: comment.text.length
84
+ }));
85
+
86
+ // Separate top-level comments and replies
87
+ const topLevelComments = processedComments.filter(c => !c.isReply);
88
+ const replies = processedComments.filter(c => c.isReply);
89
+
90
+ // Calculate engagement metrics
91
+ const engagementMetrics = {
92
+ totalComments: comments.length,
93
+ topLevelComments: topLevelComments.length,
94
+ totalReplies: replies.length,
95
+ averageLikes: comments.length > 0
96
+ ? Math.round(comments.reduce((sum, c) => sum + c.like_count, 0) / comments.length)
97
+ : 0,
98
+ mostLikedComment: processedComments.length > 0
99
+ ? processedComments.reduce((max, c) => c.likes > max.likes ? c : max)
100
+ : null,
101
+ sentimentBreakdown: this.calculateSentimentBreakdown(processedComments),
102
+ questionsCount: processedComments.filter(c => c.containsQuestion).length,
103
+ averageCommentLength: processedComments.length > 0
104
+ ? Math.round(processedComments.reduce((sum, c) => sum + c.length, 0) / processedComments.length)
105
+ : 0
106
+ };
107
+
108
+ // Identify notable comments (high engagement, questions, etc.)
109
+ const notableComments = this.identifyNotableComments(processedComments);
110
+
111
+ // Create summary
112
+ const summary = {
113
+ videoId,
114
+ totalCommentsRetrieved: processedComments.length,
115
+ hasMoreComments: response.data?.has_more || false,
116
+ engagementMetrics,
117
+ notableComments,
118
+ topCommenters: this.getTopCommenters(processedComments),
119
+ timeDistribution: this.analyzeTimeDistribution(processedComments)
120
+ };
121
+
122
+ // Update output parameters
123
+ const outputParams = [...Params];
124
+ const commentsParam = outputParams.find(p => p.Name === 'Comments');
125
+ if (commentsParam) commentsParam.Value = includeReplies ? processedComments : topLevelComments;
126
+ const summaryParam = outputParams.find(p => p.Name === 'Summary');
127
+ if (summaryParam) summaryParam.Value = summary;
128
+ const rawDataParam = outputParams.find(p => p.Name === 'RawData');
129
+ if (rawDataParam) rawDataParam.Value = comments;
130
+
131
+ return {
132
+ Success: true,
133
+ ResultCode: 'SUCCESS',
134
+ Message: `Retrieved ${processedComments.length} comments from TikTok video`,
135
+ Params: outputParams
136
+ };
137
+
138
+ } catch (error) {
139
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
140
+
141
+ return {
142
+ Success: false,
143
+ ResultCode: this.isAuthError(error) ? 'INVALID_TOKEN' : 'ERROR',
144
+ Message: `Failed to get TikTok comments: ${errorMessage}`,
145
+ Params
146
+ };
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Simple sentiment analysis
152
+ */
153
+ private analyzeSentiment(text: string): 'positive' | 'negative' | 'neutral' {
154
+ const lowerText = text.toLowerCase();
155
+
156
+ // Positive indicators
157
+ const positiveWords = ['love', 'amazing', 'great', 'awesome', 'fantastic', 'excellent', 'good', '❤️', '😍', '🔥', '👏', '💯'];
158
+ const negativeWords = ['hate', 'terrible', 'awful', 'bad', 'worst', 'disappointing', 'trash', '👎', '😠', '😡'];
159
+
160
+ const positiveScore = positiveWords.filter(word => lowerText.includes(word)).length;
161
+ const negativeScore = negativeWords.filter(word => lowerText.includes(word)).length;
162
+
163
+ if (positiveScore > negativeScore) return 'positive';
164
+ if (negativeScore > positiveScore) return 'negative';
165
+ return 'neutral';
166
+ }
167
+
168
+ /**
169
+ * Check if comment contains a question
170
+ */
171
+ private containsQuestion(text: string): boolean {
172
+ return text.includes('?') ||
173
+ /\b(what|when|where|who|why|how|is|are|can|could|would|should)\b/i.test(text);
174
+ }
175
+
176
+ /**
177
+ * Calculate sentiment breakdown
178
+ */
179
+ private calculateSentimentBreakdown(comments: any[]): Record<string, number> {
180
+ const breakdown = {
181
+ positive: 0,
182
+ negative: 0,
183
+ neutral: 0
184
+ };
185
+
186
+ comments.forEach(comment => {
187
+ breakdown[comment.sentiment]++;
188
+ });
189
+
190
+ return breakdown;
191
+ }
192
+
193
+ /**
194
+ * Identify notable comments
195
+ */
196
+ private identifyNotableComments(comments: any[]): any[] {
197
+ const notable: any[] = [];
198
+
199
+ // High engagement comments
200
+ const avgLikes = comments.length > 0
201
+ ? comments.reduce((sum, c) => sum + c.likes, 0) / comments.length
202
+ : 0;
203
+
204
+ comments.forEach(comment => {
205
+ const reasons: string[] = [];
206
+
207
+ if (comment.likes > avgLikes * 2) {
208
+ reasons.push('high_engagement');
209
+ }
210
+ if (comment.containsQuestion) {
211
+ reasons.push('contains_question');
212
+ }
213
+ if (comment.replies > 5) {
214
+ reasons.push('many_replies');
215
+ }
216
+ if (comment.text.length > 200) {
217
+ reasons.push('detailed_feedback');
218
+ }
219
+
220
+ if (reasons.length > 0) {
221
+ notable.push({
222
+ ...comment,
223
+ notableReasons: reasons
224
+ });
225
+ }
226
+ });
227
+
228
+ // Return top 10 notable comments
229
+ return notable.sort((a, b) => b.likes - a.likes).slice(0, 10);
230
+ }
231
+
232
+ /**
233
+ * Get top commenters
234
+ */
235
+ private getTopCommenters(comments: any[]): any[] {
236
+ const commenterMap = new Map<string, any>();
237
+
238
+ comments.forEach(comment => {
239
+ const key = comment.author.id;
240
+ if (!commenterMap.has(key)) {
241
+ commenterMap.set(key, {
242
+ ...comment.author,
243
+ commentCount: 0,
244
+ totalLikes: 0
245
+ });
246
+ }
247
+
248
+ const commenter = commenterMap.get(key)!;
249
+ commenter.commentCount++;
250
+ commenter.totalLikes += comment.likes;
251
+ });
252
+
253
+ return Array.from(commenterMap.values())
254
+ .sort((a, b) => b.commentCount - a.commentCount)
255
+ .slice(0, 5);
256
+ }
257
+
258
+ /**
259
+ * Analyze time distribution of comments
260
+ */
261
+ private analyzeTimeDistribution(comments: any[]): any {
262
+ if (comments.length === 0) return null;
263
+
264
+ const now = new Date();
265
+ const hourBuckets: Record<string, number> = {};
266
+
267
+ comments.forEach(comment => {
268
+ const hoursSincePost = Math.floor((now.getTime() - comment.createdAt.getTime()) / (1000 * 60 * 60));
269
+
270
+ let bucket: string;
271
+ if (hoursSincePost < 1) bucket = '< 1 hour';
272
+ else if (hoursSincePost < 24) bucket = '1-24 hours';
273
+ else if (hoursSincePost < 168) bucket = '1-7 days';
274
+ else bucket = '> 7 days';
275
+
276
+ hourBuckets[bucket] = (hourBuckets[bucket] || 0) + 1;
277
+ });
278
+
279
+ return hourBuckets;
280
+ }
281
+
282
+ /**
283
+ * Define the parameters this action expects
284
+ */
285
+ public get Params(): ActionParam[] {
286
+ return [
287
+ ...this.commonSocialParams,
288
+ {
289
+ Name: 'VideoID',
290
+ Type: 'Input',
291
+ Value: null
292
+ },
293
+ {
294
+ Name: 'MaxComments',
295
+ Type: 'Input',
296
+ Value: 100
297
+ },
298
+ {
299
+ Name: 'IncludeReplies',
300
+ Type: 'Input',
301
+ Value: true
302
+ },
303
+ {
304
+ Name: 'SortBy',
305
+ Type: 'Input',
306
+ Value: 'time'
307
+ },
308
+ {
309
+ Name: 'Comments',
310
+ Type: 'Output',
311
+ Value: null
312
+ },
313
+ {
314
+ Name: 'Summary',
315
+ Type: 'Output',
316
+ Value: null
317
+ },
318
+ {
319
+ Name: 'RawData',
320
+ Type: 'Output',
321
+ Value: null
322
+ }
323
+ ];
324
+ }
325
+
326
+ /**
327
+ * Metadata about this action
328
+ */
329
+ public get Description(): string {
330
+ return 'Retrieves and analyzes comments from TikTok videos including sentiment, engagement metrics, and notable comments';
331
+ }
332
+ }
@@ -0,0 +1,341 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { TikTokBaseAction } from '../tiktok-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+
5
+ /**
6
+ * Action to get trending hashtags on TikTok
7
+ */
8
+ @RegisterClass(TikTokBaseAction, 'GetTrendingHashtagsAction')
9
+ export class GetTrendingHashtagsAction extends TikTokBaseAction {
10
+
11
+ /**
12
+ * Get trending hashtags from TikTok
13
+ */
14
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
15
+ const { Params } = params;
16
+
17
+ try {
18
+ // Initialize OAuth
19
+ const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
20
+ if (!companyIntegrationId) {
21
+ throw new Error('CompanyIntegrationID is required');
22
+ }
23
+
24
+ await this.initializeOAuth(companyIntegrationId);
25
+
26
+ // Extract parameters
27
+ const country = this.getParamValue(Params, 'Country') || 'US';
28
+ const category = this.getParamValue(Params, 'Category');
29
+ const limit = this.getParamValue(Params, 'Limit') || 20;
30
+ const includeStats = this.getParamValue(Params, 'IncludeStats') !== false;
31
+
32
+ // Note: TikTok's public API has limited access to trending data
33
+ // This implementation uses available endpoints and user's own content for insights
34
+
35
+ // Get user's recent videos to analyze hashtag performance
36
+ const userVideos = await this.getUserVideos();
37
+
38
+ // Extract and analyze hashtags from user's content
39
+ const hashtagAnalysis = this.analyzeHashtagsFromVideos(userVideos);
40
+
41
+ // Since TikTok doesn't provide a direct trending hashtags API,
42
+ // we'll provide insights based on the user's content and general trends
43
+ const trendingInsights = {
44
+ disclaimer: 'TikTok API does not provide direct access to trending hashtags. These insights are based on your content analysis.',
45
+ userHashtagPerformance: hashtagAnalysis.topPerforming.slice(0, limit),
46
+ recommendedHashtags: this.generateHashtagRecommendations(category, country),
47
+ generalTrends: this.getGeneralTrendingTopics(category, country),
48
+ hashtagStrategy: this.generateHashtagStrategy(hashtagAnalysis)
49
+ };
50
+
51
+ // Create formatted output
52
+ const formattedHashtags = trendingInsights.userHashtagPerformance.map((tag, index) => ({
53
+ rank: index + 1,
54
+ hashtag: tag.hashtag,
55
+ usageCount: tag.count,
56
+ averageViews: tag.avgViews,
57
+ averageEngagement: tag.avgEngagement,
58
+ performanceScore: tag.score,
59
+ trend: tag.trend
60
+ }));
61
+
62
+ // Create summary
63
+ const summary = {
64
+ topHashtag: formattedHashtags[0] || null,
65
+ totalHashtagsAnalyzed: hashtagAnalysis.allHashtags.length,
66
+ averageHashtagsPerVideo: hashtagAnalysis.avgHashtagsPerVideo,
67
+ bestPerformingCategory: this.identifyBestCategory(hashtagAnalysis),
68
+ recommendations: trendingInsights.recommendedHashtags.slice(0, 5),
69
+ strategy: trendingInsights.hashtagStrategy
70
+ };
71
+
72
+ // Update output parameters
73
+ const outputParams = [...Params];
74
+ const hashtagsParam = outputParams.find(p => p.Name === 'TrendingHashtags');
75
+ if (hashtagsParam) hashtagsParam.Value = formattedHashtags;
76
+ const insightsParam = outputParams.find(p => p.Name === 'Insights');
77
+ if (insightsParam) insightsParam.Value = trendingInsights;
78
+ const summaryParam = outputParams.find(p => p.Name === 'Summary');
79
+ if (summaryParam) summaryParam.Value = summary;
80
+
81
+ return {
82
+ Success: true,
83
+ ResultCode: 'SUCCESS',
84
+ Message: `Analyzed hashtag performance from ${userVideos.length} videos. Note: Direct trending data not available via TikTok API.`,
85
+ Params: outputParams
86
+ };
87
+
88
+ } catch (error) {
89
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
90
+
91
+ return {
92
+ Success: false,
93
+ ResultCode: this.isAuthError(error) ? 'INVALID_TOKEN' : 'ERROR',
94
+ Message: `Failed to get TikTok trending hashtags: ${errorMessage}`,
95
+ Params
96
+ };
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Analyze hashtags from user's videos
102
+ */
103
+ private analyzeHashtagsFromVideos(videos: any[]): any {
104
+ const hashtagMap = new Map<string, any>();
105
+
106
+ videos.forEach(video => {
107
+ const hashtags = this.extractHashtags(video.description);
108
+
109
+ hashtags.forEach(tag => {
110
+ if (!hashtagMap.has(tag)) {
111
+ hashtagMap.set(tag, {
112
+ hashtag: `#${tag}`,
113
+ count: 0,
114
+ totalViews: 0,
115
+ totalEngagement: 0,
116
+ videos: []
117
+ });
118
+ }
119
+
120
+ const tagData = hashtagMap.get(tag)!;
121
+ tagData.count++;
122
+ tagData.totalViews += video.view_count;
123
+ tagData.totalEngagement += video.like_count + video.comment_count + video.share_count;
124
+ tagData.videos.push({
125
+ id: video.id,
126
+ views: video.view_count,
127
+ engagement: video.like_count + video.comment_count + video.share_count
128
+ });
129
+ });
130
+ });
131
+
132
+ // Calculate averages and scores
133
+ const allHashtags = Array.from(hashtagMap.values()).map(tag => ({
134
+ ...tag,
135
+ avgViews: Math.round(tag.totalViews / tag.count),
136
+ avgEngagement: Math.round(tag.totalEngagement / tag.count),
137
+ score: this.calculateHashtagScore(tag),
138
+ trend: this.calculateTrend(tag.videos)
139
+ }));
140
+
141
+ // Sort by performance score
142
+ const topPerforming = allHashtags.sort((a, b) => b.score - a.score);
143
+
144
+ return {
145
+ allHashtags,
146
+ topPerforming,
147
+ avgHashtagsPerVideo: videos.length > 0
148
+ ? allHashtags.reduce((sum, tag) => sum + tag.count, 0) / videos.length
149
+ : 0
150
+ };
151
+ }
152
+
153
+ /**
154
+ * Calculate hashtag performance score
155
+ */
156
+ private calculateHashtagScore(tagData: any): number {
157
+ const viewWeight = 1;
158
+ const engagementWeight = 10;
159
+ const frequencyWeight = 5;
160
+
161
+ return (
162
+ (tagData.avgViews * viewWeight) +
163
+ (tagData.avgEngagement * engagementWeight) +
164
+ (tagData.count * frequencyWeight)
165
+ );
166
+ }
167
+
168
+ /**
169
+ * Calculate trend direction
170
+ */
171
+ private calculateTrend(videos: any[]): 'rising' | 'stable' | 'declining' {
172
+ if (videos.length < 2) return 'stable';
173
+
174
+ // Simple trend calculation based on recent vs older performance
175
+ const midpoint = Math.floor(videos.length / 2);
176
+ const recentAvg = videos.slice(0, midpoint).reduce((sum, v) => sum + v.views, 0) / midpoint;
177
+ const olderAvg = videos.slice(midpoint).reduce((sum, v) => sum + v.views, 0) / (videos.length - midpoint);
178
+
179
+ const changePercent = ((recentAvg - olderAvg) / olderAvg) * 100;
180
+
181
+ if (changePercent > 20) return 'rising';
182
+ if (changePercent < -20) return 'declining';
183
+ return 'stable';
184
+ }
185
+
186
+ /**
187
+ * Generate hashtag recommendations based on category and country
188
+ */
189
+ private generateHashtagRecommendations(category?: string, country?: string): string[] {
190
+ // These are example recommendations - in a real implementation,
191
+ // these would be based on actual trending data
192
+ const recommendations: Record<string, string[]> = {
193
+ entertainment: ['#fyp', '#foryou', '#viral', '#trending', '#comedy', '#funny', '#entertainment'],
194
+ music: ['#music', '#newmusic', '#musician', '#singer', '#song', '#cover', '#originalmusic'],
195
+ dance: ['#dance', '#dancer', '#dancechallenge', '#choreography', '#dancing', '#dancetrend'],
196
+ food: ['#foodtok', '#cooking', '#recipe', '#foodie', '#homecooking', '#easyrecipe', '#foodlover'],
197
+ fitness: ['#fitness', '#workout', '#gym', '#fitnessmotivation', '#healthylifestyle', '#exercise'],
198
+ beauty: ['#beauty', '#makeup', '#skincare', '#beautytips', '#makeuptutorial', '#glowup'],
199
+ fashion: ['#fashion', '#ootd', '#style', '#outfitideas', '#fashiontrends', '#streetstyle'],
200
+ tech: ['#tech', '#technology', '#techtok', '#gadgets', '#innovation', '#ai', '#coding'],
201
+ education: ['#education', '#learning', '#edutok', '#learnontiktok', '#knowledge', '#facts'],
202
+ general: ['#fyp', '#foryoupage', '#viral', '#trending', '#tiktok', '#explore', '#viralvideo']
203
+ };
204
+
205
+ const categoryTags = recommendations[category?.toLowerCase() || 'general'] || recommendations.general;
206
+
207
+ // Add country-specific tags if applicable
208
+ const countryTags: Record<string, string[]> = {
209
+ US: ['#usa', '#american', '#unitedstates'],
210
+ UK: ['#uk', '#british', '#unitedkingdom'],
211
+ CA: ['#canada', '#canadian'],
212
+ AU: ['#australia', '#aussie'],
213
+ IN: ['#india', '#indian']
214
+ };
215
+
216
+ const locationTags = countryTags[country || 'US'] || [];
217
+
218
+ return [...categoryTags, ...locationTags];
219
+ }
220
+
221
+ /**
222
+ * Get general trending topics
223
+ */
224
+ private getGeneralTrendingTopics(category?: string, country?: string): any {
225
+ // Placeholder for general trends
226
+ return {
227
+ currentEvents: ['Major sporting events', 'Seasonal celebrations', 'Viral challenges'],
228
+ contentTypes: ['Short tutorials', 'Behind-the-scenes', 'Day in the life', 'Transformations'],
229
+ musicTrends: ['Trending sounds', 'Popular audio clips', 'Remix challenges'],
230
+ formatTrends: ['Vertical video', 'Quick cuts', 'Text overlays', 'Transitions']
231
+ };
232
+ }
233
+
234
+ /**
235
+ * Generate hashtag strategy
236
+ */
237
+ private generateHashtagStrategy(analysis: any): string[] {
238
+ const strategies: string[] = [];
239
+
240
+ // Mix of hashtag sizes
241
+ strategies.push('Use a mix of popular (1M+ posts), medium (100K-1M), and niche (<100K) hashtags');
242
+
243
+ // Optimal number
244
+ strategies.push('Include 3-5 highly relevant hashtags per video for best reach');
245
+
246
+ // Based on performance
247
+ if (analysis.topPerforming.length > 0) {
248
+ const bestTag = analysis.topPerforming[0];
249
+ strategies.push(`Your best performing hashtag is ${bestTag.hashtag} - use it consistently`);
250
+ }
251
+
252
+ // Timing
253
+ strategies.push('Add trending hashtags within the first hour of a trend for maximum visibility');
254
+
255
+ // Branded hashtags
256
+ strategies.push('Create a unique branded hashtag to build community around your content');
257
+
258
+ return strategies;
259
+ }
260
+
261
+ /**
262
+ * Identify best performing category
263
+ */
264
+ private identifyBestCategory(analysis: any): string {
265
+ // Simplified category identification based on hashtag patterns
266
+ const categories: Record<string, string[]> = {
267
+ entertainment: ['funny', 'comedy', 'lol', 'humor', 'entertainment'],
268
+ music: ['music', 'song', 'singer', 'musician', 'cover'],
269
+ dance: ['dance', 'dancer', 'choreography', 'dancing'],
270
+ lifestyle: ['lifestyle', 'life', 'daily', 'routine', 'vlog']
271
+ };
272
+
273
+ const categoryCounts: Record<string, number> = {};
274
+
275
+ analysis.allHashtags.forEach((tag: any) => {
276
+ const tagLower = tag.hashtag.toLowerCase();
277
+
278
+ Object.entries(categories).forEach(([category, keywords]) => {
279
+ if (keywords.some(keyword => tagLower.includes(keyword))) {
280
+ categoryCounts[category] = (categoryCounts[category] || 0) + tag.score;
281
+ }
282
+ });
283
+ });
284
+
285
+ const bestCategory = Object.entries(categoryCounts)
286
+ .sort(([, a], [, b]) => b - a)[0];
287
+
288
+ return bestCategory ? bestCategory[0] : 'general';
289
+ }
290
+
291
+ /**
292
+ * Define the parameters this action expects
293
+ */
294
+ public get Params(): ActionParam[] {
295
+ return [
296
+ ...this.commonSocialParams,
297
+ {
298
+ Name: 'Country',
299
+ Type: 'Input',
300
+ Value: 'US'
301
+ },
302
+ {
303
+ Name: 'Category',
304
+ Type: 'Input',
305
+ Value: null
306
+ },
307
+ {
308
+ Name: 'Limit',
309
+ Type: 'Input',
310
+ Value: 20
311
+ },
312
+ {
313
+ Name: 'IncludeStats',
314
+ Type: 'Input',
315
+ Value: true
316
+ },
317
+ {
318
+ Name: 'TrendingHashtags',
319
+ Type: 'Output',
320
+ Value: null
321
+ },
322
+ {
323
+ Name: 'Insights',
324
+ Type: 'Output',
325
+ Value: null
326
+ },
327
+ {
328
+ Name: 'Summary',
329
+ Type: 'Output',
330
+ Value: null
331
+ }
332
+ ];
333
+ }
334
+
335
+ /**
336
+ * Metadata about this action
337
+ */
338
+ public get Description(): string {
339
+ return 'Analyzes hashtag performance from your TikTok content and provides trending insights (Note: Direct trending API not available)';
340
+ }
341
+ }