@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,372 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { FacebookBaseAction, FacebookComment } from '../facebook-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+ import { SocialMediaErrorCode } from '../../../base/base-social.action';
5
+ import { LogStatus, LogError } from '@memberjunction/core';
6
+ import axios from 'axios';
7
+
8
+ /**
9
+ * Responds to comments on Facebook posts or other comments.
10
+ * Supports replying to top-level comments and nested replies.
11
+ */
12
+ @RegisterClass(FacebookBaseAction, 'FacebookRespondToCommentsAction')
13
+ export class FacebookRespondToCommentsAction extends FacebookBaseAction {
14
+ /**
15
+ * Get action description
16
+ */
17
+ public get Description(): string {
18
+ return 'Responds to comments on Facebook posts, pages, or other comments with text replies or reactions';
19
+ }
20
+
21
+ /**
22
+ * Define the parameters for this action
23
+ */
24
+ public get Params(): ActionParam[] {
25
+ return [
26
+ ...this.commonSocialParams,
27
+ {
28
+ Name: 'CommentID',
29
+ Type: 'Input',
30
+ Value: null,
31
+ },
32
+ {
33
+ Name: 'ResponseText',
34
+ Type: 'Input',
35
+ Value: null,
36
+ },
37
+ {
38
+ Name: 'AttachmentURL',
39
+ Type: 'Input',
40
+ Value: null,
41
+ },
42
+ {
43
+ Name: 'LikeComment',
44
+ Type: 'Input',
45
+ Value: false,
46
+ },
47
+ {
48
+ Name: 'HideComment',
49
+ Type: 'Input',
50
+ Value: false,
51
+ },
52
+ {
53
+ Name: 'DeleteComment',
54
+ Type: 'Input',
55
+ Value: false,
56
+ },
57
+ {
58
+ Name: 'PrivateReply',
59
+ Type: 'Input',
60
+ Value: false,
61
+ },
62
+ {
63
+ Name: 'PageID',
64
+ Type: 'Input',
65
+ Value: null,
66
+ }
67
+ ];
68
+ }
69
+
70
+ /**
71
+ * Execute the action
72
+ */
73
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
74
+ const { Params, ContextUser } = params;
75
+
76
+ try {
77
+ // Validate required parameters
78
+ const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
79
+ const commentId = this.getParamValue(Params, 'CommentID');
80
+
81
+ if (!companyIntegrationId) {
82
+ return {
83
+ Success: false,
84
+ Message: 'CompanyIntegrationID is required',
85
+ ResultCode: 'INVALID_TOKEN'
86
+ };
87
+ }
88
+
89
+ if (!commentId) {
90
+ return {
91
+ Success: false,
92
+ Message: 'CommentID is required',
93
+ ResultCode: 'MISSING_REQUIRED_PARAM'
94
+ };
95
+ }
96
+
97
+ // Initialize OAuth
98
+ if (!await this.initializeOAuth(companyIntegrationId)) {
99
+ return {
100
+ Success: false,
101
+ Message: 'Failed to initialize Facebook OAuth connection',
102
+ ResultCode: 'INVALID_TOKEN'
103
+ };
104
+ }
105
+
106
+ // Get parameters
107
+ const responseText = this.getParamValue(Params, 'ResponseText') as string;
108
+ const attachmentUrl = this.getParamValue(Params, 'AttachmentURL') as string;
109
+ const likeComment = this.getParamValue(Params, 'LikeComment') as boolean;
110
+ const hideComment = this.getParamValue(Params, 'HideComment') as boolean;
111
+ const deleteComment = this.getParamValue(Params, 'DeleteComment') as boolean;
112
+ const privateReply = this.getParamValue(Params, 'PrivateReply') as boolean;
113
+ const pageId = this.getParamValue(Params, 'PageID') as string;
114
+
115
+ // Validate that at least one action is specified
116
+ if (!responseText && !attachmentUrl && !likeComment && !hideComment && !deleteComment) {
117
+ return {
118
+ Success: false,
119
+ Message: 'At least one action (ResponseText, AttachmentURL, LikeComment, HideComment, or DeleteComment) is required',
120
+ ResultCode: 'MISSING_ACTION'
121
+ };
122
+ }
123
+
124
+ // Get appropriate access token
125
+ let accessToken = this.getAccessToken();
126
+ if (pageId) {
127
+ // Use page access token for page actions
128
+ accessToken = await this.getPageAccessToken(pageId);
129
+ }
130
+
131
+ LogStatus(`Processing comment ${commentId}...`);
132
+
133
+ // Get comment details first
134
+ const commentDetails = await this.getCommentDetails(commentId, accessToken!);
135
+ if (!commentDetails) {
136
+ return {
137
+ Success: false,
138
+ Message: 'Comment not found or access denied',
139
+ ResultCode: 'NOT_FOUND'
140
+ };
141
+ }
142
+
143
+ const results: any = {
144
+ commentId,
145
+ originalComment: {
146
+ message: commentDetails.message,
147
+ from: commentDetails.from,
148
+ createdTime: commentDetails.created_time
149
+ },
150
+ actions: []
151
+ };
152
+
153
+ // Handle delete action first (if specified)
154
+ if (deleteComment) {
155
+ try {
156
+ await this.deleteCommentAction(commentId, accessToken!);
157
+ results.actions.push({ action: 'delete', success: true });
158
+ LogStatus(`Deleted comment ${commentId}`);
159
+
160
+ // If deleted, no other actions can be performed
161
+ return {
162
+ Success: true,
163
+ Message: 'Comment deleted successfully',
164
+ ResultCode: 'SUCCESS',
165
+ Params
166
+ };
167
+ } catch (error) {
168
+ LogError(`Failed to delete comment: ${error}`);
169
+ results.actions.push({
170
+ action: 'delete',
171
+ success: false,
172
+ error: error instanceof Error ? error.message : 'Unknown error'
173
+ });
174
+ }
175
+ }
176
+
177
+ // Handle hide action
178
+ if (hideComment) {
179
+ try {
180
+ await this.hideCommentAction(commentId, accessToken!, true);
181
+ results.actions.push({ action: 'hide', success: true });
182
+ LogStatus(`Hidden comment ${commentId}`);
183
+ } catch (error) {
184
+ LogError(`Failed to hide comment: ${error}`);
185
+ results.actions.push({
186
+ action: 'hide',
187
+ success: false,
188
+ error: error instanceof Error ? error.message : 'Unknown error'
189
+ });
190
+ }
191
+ }
192
+
193
+ // Handle like action
194
+ if (likeComment) {
195
+ try {
196
+ await this.likeCommentAction(commentId, accessToken!);
197
+ results.actions.push({ action: 'like', success: true });
198
+ LogStatus(`Liked comment ${commentId}`);
199
+ } catch (error) {
200
+ LogError(`Failed to like comment: ${error}`);
201
+ results.actions.push({
202
+ action: 'like',
203
+ success: false,
204
+ error: error instanceof Error ? error.message : 'Unknown error'
205
+ });
206
+ }
207
+ }
208
+
209
+ // Handle reply action
210
+ if (responseText || attachmentUrl) {
211
+ try {
212
+ const replyResult = await this.replyToComment(
213
+ commentId,
214
+ responseText,
215
+ attachmentUrl,
216
+ privateReply,
217
+ accessToken!
218
+ );
219
+
220
+ results.actions.push({
221
+ action: privateReply ? 'private_reply' : 'reply',
222
+ success: true,
223
+ replyId: replyResult.id,
224
+ message: responseText
225
+ });
226
+
227
+ LogStatus(`Replied to comment ${commentId}`);
228
+ } catch (error) {
229
+ LogError(`Failed to reply to comment: ${error}`);
230
+ results.actions.push({
231
+ action: privateReply ? 'private_reply' : 'reply',
232
+ success: false,
233
+ error: error instanceof Error ? error.message : 'Unknown error'
234
+ });
235
+ }
236
+ }
237
+
238
+ // Check if any actions succeeded
239
+ const successfulActions = results.actions.filter((a: any) => a.success);
240
+ if (successfulActions.length === 0) {
241
+ return {
242
+ Success: false,
243
+ Message: 'All requested actions failed',
244
+ ResultCode: 'ERROR'
245
+ };
246
+ }
247
+
248
+ return {
249
+ Success: true,
250
+ Message: `Successfully completed ${successfulActions.length} of ${results.actions.length} actions`,
251
+ ResultCode: 'SUCCESS',
252
+ Params
253
+ };
254
+
255
+ } catch (error) {
256
+ LogError(`Failed to respond to Facebook comment: ${error instanceof Error ? error.message : 'Unknown error'}`);
257
+
258
+ if (this.isAuthError(error)) {
259
+ return this.handleOAuthError(error);
260
+ }
261
+
262
+ return {
263
+ Success: false,
264
+ Message: error instanceof Error ? error.message : 'Unknown error occurred',
265
+ ResultCode: 'ERROR'
266
+ };
267
+ }
268
+ }
269
+
270
+ /**
271
+ * Get comment details
272
+ */
273
+ private async getCommentDetails(commentId: string, accessToken: string): Promise<FacebookComment | null> {
274
+ try {
275
+ const response = await axios.get(
276
+ `${this.apiBaseUrl}/${commentId}`,
277
+ {
278
+ params: {
279
+ access_token: accessToken,
280
+ fields: 'id,message,created_time,from,like_count,comment_count,parent'
281
+ }
282
+ }
283
+ );
284
+
285
+ return response.data;
286
+ } catch (error) {
287
+ LogError(`Failed to get comment details: ${error}`);
288
+ return null;
289
+ }
290
+ }
291
+
292
+ /**
293
+ * Reply to a comment
294
+ */
295
+ private async replyToComment(
296
+ commentId: string,
297
+ message: string | null,
298
+ attachmentUrl: string | null,
299
+ privateReply: boolean,
300
+ accessToken: string
301
+ ): Promise<any> {
302
+ const endpoint = privateReply
303
+ ? `${this.apiBaseUrl}/${commentId}/private_replies`
304
+ : `${this.apiBaseUrl}/${commentId}/comments`;
305
+
306
+ const data: any = {};
307
+
308
+ if (message) {
309
+ data.message = message;
310
+ }
311
+
312
+ if (attachmentUrl) {
313
+ data.attachment_url = attachmentUrl;
314
+ }
315
+
316
+ const response = await axios.post(endpoint, data, {
317
+ params: {
318
+ access_token: accessToken
319
+ }
320
+ });
321
+
322
+ return response.data;
323
+ }
324
+
325
+ /**
326
+ * Like a comment
327
+ */
328
+ private async likeCommentAction(commentId: string, accessToken: string): Promise<void> {
329
+ await axios.post(
330
+ `${this.apiBaseUrl}/${commentId}/likes`,
331
+ {},
332
+ {
333
+ params: {
334
+ access_token: accessToken
335
+ }
336
+ }
337
+ );
338
+ }
339
+
340
+ /**
341
+ * Hide or unhide a comment
342
+ */
343
+ private async hideCommentAction(commentId: string, accessToken: string, hide: boolean): Promise<void> {
344
+ await axios.post(
345
+ `${this.apiBaseUrl}/${commentId}`,
346
+ {
347
+ is_hidden: hide
348
+ },
349
+ {
350
+ params: {
351
+ access_token: accessToken
352
+ }
353
+ }
354
+ );
355
+ }
356
+
357
+ /**
358
+ * Delete a comment
359
+ */
360
+ private async deleteCommentAction(commentId: string, accessToken: string): Promise<void> {
361
+ await axios.delete(
362
+ `${this.apiBaseUrl}/${commentId}`,
363
+ {
364
+ params: {
365
+ access_token: accessToken
366
+ }
367
+ }
368
+ );
369
+ }
370
+
371
+
372
+ }
@@ -0,0 +1,310 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { FacebookBaseAction, CreatePostData } from '../facebook-base.action';
3
+ import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
4
+ import { MediaFile, SocialMediaErrorCode } from '../../../base/base-social.action';
5
+ import { LogStatus, LogError } from '@memberjunction/core';
6
+ import axios from 'axios';
7
+
8
+ /**
9
+ * Schedules a post to be published on a Facebook page at a future time.
10
+ * Posts can be scheduled from 10 minutes to 6 months in the future.
11
+ */
12
+ @RegisterClass(FacebookBaseAction, 'FacebookSchedulePostAction')
13
+ export class FacebookSchedulePostAction extends FacebookBaseAction {
14
+ /**
15
+ * Get action description
16
+ */
17
+ public get Description(): string {
18
+ return 'Schedules a post to be published on a Facebook page at a specified future time (10 minutes to 6 months in advance)';
19
+ }
20
+
21
+ /**
22
+ * Define the parameters for this action
23
+ */
24
+ public get Params(): ActionParam[] {
25
+ return [
26
+ ...this.commonSocialParams,
27
+ {
28
+ Name: 'PageID',
29
+ Type: 'Input',
30
+ Value: null,
31
+ },
32
+ {
33
+ Name: 'Content',
34
+ Type: 'Input',
35
+ Value: null,
36
+ },
37
+ {
38
+ Name: 'ScheduledTime',
39
+ Type: 'Input',
40
+ Value: null,
41
+ },
42
+ {
43
+ Name: 'Link',
44
+ Type: 'Input',
45
+ Value: null,
46
+ },
47
+ {
48
+ Name: 'MediaFiles',
49
+ Type: 'Input',
50
+ Value: null,
51
+ },
52
+ {
53
+ Name: 'Tags',
54
+ Type: 'Input',
55
+ Value: null,
56
+ },
57
+ {
58
+ Name: 'PlaceID',
59
+ Type: 'Input',
60
+ Value: null,
61
+ },
62
+ {
63
+ Name: 'TargetingRestrictions',
64
+ Type: 'Input',
65
+ Value: null,
66
+ },
67
+ {
68
+ Name: 'AllowReschedule',
69
+ Type: 'Input',
70
+ Value: false,
71
+ }
72
+ ];
73
+ }
74
+
75
+ /**
76
+ * Execute the action
77
+ */
78
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
79
+ const { Params, ContextUser } = params;
80
+
81
+ try {
82
+ // Validate required parameters
83
+ const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
84
+ const pageId = this.getParamValue(Params, 'PageID');
85
+ const scheduledTime = this.getParamValue(Params, 'ScheduledTime');
86
+
87
+ if (!companyIntegrationId) {
88
+ return {
89
+ Success: false,
90
+ Message: 'CompanyIntegrationID is required',
91
+ ResultCode: 'INVALID_TOKEN'
92
+ };
93
+ }
94
+
95
+ if (!pageId) {
96
+ return {
97
+ Success: false,
98
+ Message: 'PageID is required',
99
+ ResultCode: 'MISSING_REQUIRED_PARAM'
100
+ };
101
+ }
102
+
103
+ if (!scheduledTime) {
104
+ return {
105
+ Success: false,
106
+ Message: 'ScheduledTime is required',
107
+ ResultCode: 'MISSING_REQUIRED_PARAM'
108
+ };
109
+ }
110
+
111
+ // Initialize OAuth
112
+ if (!await this.initializeOAuth(companyIntegrationId)) {
113
+ return {
114
+ Success: false,
115
+ Message: 'Failed to initialize Facebook OAuth connection',
116
+ ResultCode: 'INVALID_TOKEN'
117
+ };
118
+ }
119
+
120
+ // Validate scheduled time
121
+ const scheduledDate = new Date(scheduledTime);
122
+ const now = new Date();
123
+ const minScheduleTime = new Date(now.getTime() + 10 * 60 * 1000); // 10 minutes from now
124
+ const maxScheduleTime = new Date(now.getTime() + 180 * 24 * 60 * 60 * 1000); // 6 months from now
125
+
126
+ if (isNaN(scheduledDate.getTime())) {
127
+ return {
128
+ Success: false,
129
+ Message: 'Invalid scheduled time format. Use ISO 8601 format.',
130
+ ResultCode: 'INVALID_SCHEDULE_TIME'
131
+ };
132
+ }
133
+
134
+ if (scheduledDate < minScheduleTime) {
135
+ return {
136
+ Success: false,
137
+ Message: 'Scheduled time must be at least 10 minutes in the future',
138
+ ResultCode: 'INVALID_SCHEDULE_TIME'
139
+ };
140
+ }
141
+
142
+ if (scheduledDate > maxScheduleTime) {
143
+ return {
144
+ Success: false,
145
+ Message: 'Scheduled time cannot be more than 6 months in the future',
146
+ ResultCode: 'INVALID_SCHEDULE_TIME'
147
+ };
148
+ }
149
+
150
+ // Get parameters
151
+ const content = this.getParamValue(Params, 'Content') as string;
152
+ const link = this.getParamValue(Params, 'Link') as string;
153
+ const mediaFiles = this.getParamValue(Params, 'MediaFiles') as MediaFile[];
154
+ const tags = this.getParamValue(Params, 'Tags') as string[];
155
+ const placeId = this.getParamValue(Params, 'PlaceID') as string;
156
+ const targetingRestrictions = this.getParamValue(Params, 'TargetingRestrictions') as any;
157
+ const allowReschedule = this.getParamValue(Params, 'AllowReschedule') as boolean;
158
+
159
+ // Validate that we have some content
160
+ if (!content && !link && (!mediaFiles || mediaFiles.length === 0)) {
161
+ return {
162
+ Success: false,
163
+ Message: 'At least one of Content, Link, or MediaFiles is required',
164
+ ResultCode: 'MISSING_CONTENT'
165
+ };
166
+ }
167
+
168
+ // Check for scheduling conflicts if requested
169
+ if (!allowReschedule) {
170
+ const hasConflict = await this.checkSchedulingConflict(pageId, scheduledDate);
171
+ if (hasConflict) {
172
+ return {
173
+ Success: false,
174
+ Message: 'Another post is already scheduled within 5 minutes of this time',
175
+ ResultCode: 'SCHEDULE_CONFLICT'
176
+ };
177
+ }
178
+ }
179
+
180
+ // Build post data
181
+ const postData: CreatePostData = {
182
+ scheduled_publish_time: Math.floor(scheduledDate.getTime() / 1000),
183
+ published: false // Must be false for scheduled posts
184
+ };
185
+
186
+ if (content) {
187
+ postData.message = content;
188
+ }
189
+
190
+ if (link) {
191
+ postData.link = link;
192
+ }
193
+
194
+ if (placeId) {
195
+ postData.place = placeId;
196
+ }
197
+
198
+ if (tags && tags.length > 0) {
199
+ postData.tags = tags;
200
+ }
201
+
202
+ if (targetingRestrictions) {
203
+ (postData as any).targeting = targetingRestrictions;
204
+ }
205
+
206
+ // Handle media uploads
207
+ if (mediaFiles && mediaFiles.length > 0) {
208
+ LogStatus(`Uploading ${mediaFiles.length} media files for scheduled post...`);
209
+
210
+ const mediaIds: string[] = [];
211
+ for (const file of mediaFiles) {
212
+ try {
213
+ const mediaId = await this.uploadMediaToPage(pageId, file);
214
+ mediaIds.push(mediaId);
215
+ LogStatus(`Uploaded media: ${file.filename}`);
216
+ } catch (error) {
217
+ LogError(`Failed to upload media ${file.filename}: ${error}`);
218
+ return {
219
+ Success: false,
220
+ Message: `Failed to upload media: ${error instanceof Error ? error.message : 'Unknown error'}`,
221
+ ResultCode: 'INVALID_MEDIA'
222
+ };
223
+ }
224
+ }
225
+
226
+ // Attach media to post
227
+ postData.attached_media = mediaIds.map(id => ({ media_fbid: id }));
228
+ }
229
+
230
+ // Create the scheduled post
231
+ LogStatus(`Scheduling Facebook post for ${scheduledDate.toISOString()}...`);
232
+ const post = await this.createPost(pageId, postData);
233
+
234
+ // Get the scheduled post details
235
+ const scheduledPost = await this.getScheduledPost(pageId, post.id);
236
+
237
+ LogStatus(`Facebook post scheduled successfully: ${post.id}`);
238
+
239
+ return {
240
+ Success: true,
241
+ Message: `Post scheduled for ${scheduledDate.toISOString()}`,
242
+ ResultCode: 'SUCCESS',
243
+ Params
244
+ };
245
+
246
+ } catch (error) {
247
+ LogError(`Failed to schedule Facebook post: ${error instanceof Error ? error.message : 'Unknown error'}`);
248
+
249
+ if (this.isAuthError(error)) {
250
+ return this.handleOAuthError(error);
251
+ }
252
+
253
+ return {
254
+ Success: false,
255
+ Message: error instanceof Error ? error.message : 'Unknown error occurred',
256
+ ResultCode: 'ERROR'
257
+ };
258
+ }
259
+ }
260
+
261
+ /**
262
+ * Check if there's a scheduling conflict within 5 minutes
263
+ */
264
+ private async checkSchedulingConflict(pageId: string, scheduledTime: Date): Promise<boolean> {
265
+ try {
266
+ const pageToken = await this.getPageAccessToken(pageId);
267
+ const fiveMinutesBefore = new Date(scheduledTime.getTime() - 5 * 60 * 1000);
268
+ const fiveMinutesAfter = new Date(scheduledTime.getTime() + 5 * 60 * 1000);
269
+
270
+ // Get scheduled posts in the time window
271
+ const response = await axios.get(`${this.apiBaseUrl}/${pageId}/scheduled_posts`, {
272
+ params: {
273
+ access_token: pageToken,
274
+ since: Math.floor(fiveMinutesBefore.getTime() / 1000),
275
+ until: Math.floor(fiveMinutesAfter.getTime() / 1000),
276
+ limit: 10
277
+ }
278
+ });
279
+
280
+ const scheduledPosts = response.data.data || [];
281
+ return scheduledPosts.length > 0;
282
+ } catch (error) {
283
+ LogError(`Failed to check scheduling conflicts: ${error}`);
284
+ return false; // Don't block on error
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Get details of a scheduled post
290
+ */
291
+ private async getScheduledPost(pageId: string, postId: string): Promise<any> {
292
+ try {
293
+ const pageToken = await this.getPageAccessToken(pageId);
294
+
295
+ const response = await axios.get(`${this.apiBaseUrl}/${postId}`, {
296
+ params: {
297
+ access_token: pageToken,
298
+ fields: 'id,message,scheduled_publish_time,is_published'
299
+ }
300
+ });
301
+
302
+ return response.data;
303
+ } catch (error) {
304
+ LogError(`Failed to get scheduled post details: ${error}`);
305
+ return null;
306
+ }
307
+ }
308
+
309
+
310
+ }