@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,427 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { FacebookBaseAction, FacebookInsight } 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
+ * Retrieves comprehensive analytics and insights for a Facebook page.
10
+ * Provides metrics like page views, likes, engagement, demographics, and more.
11
+ */
12
+ @RegisterClass(FacebookBaseAction, 'FacebookGetPageInsightsAction')
13
+ export class FacebookGetPageInsightsAction extends FacebookBaseAction {
14
+ /**
15
+ * Get action description
16
+ */
17
+ public get Description(): string {
18
+ return 'Retrieves comprehensive analytics for a Facebook page including views, engagement, demographics, and performance metrics';
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: 'MetricTypes',
34
+ Type: 'Input',
35
+ Value: null,
36
+ },
37
+ {
38
+ Name: 'Period',
39
+ Type: 'Input',
40
+ Value: 'day',
41
+ },
42
+ {
43
+ Name: 'StartDate',
44
+ Type: 'Input',
45
+ Value: null,
46
+ },
47
+ {
48
+ Name: 'EndDate',
49
+ Type: 'Input',
50
+ Value: null,
51
+ },
52
+ {
53
+ Name: 'IncludeDemographics',
54
+ Type: 'Input',
55
+ Value: true,
56
+ },
57
+ {
58
+ Name: 'IncludeVideoMetrics',
59
+ Type: 'Input',
60
+ Value: true,
61
+ },
62
+ {
63
+ Name: 'CompareWithPrevious',
64
+ Type: 'Input',
65
+ Value: false,
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 pageId = this.getParamValue(Params, 'PageID');
80
+
81
+ if (!companyIntegrationId) {
82
+ return {
83
+ Success: false,
84
+ Message: 'CompanyIntegrationID is required',
85
+ ResultCode: 'INVALID_TOKEN'
86
+ };
87
+ }
88
+
89
+ if (!pageId) {
90
+ return {
91
+ Success: false,
92
+ Message: 'PageID 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 metricTypes = this.getParamValue(Params, 'MetricTypes') as string[];
108
+ const period = this.getParamValue(Params, 'Period') as string || 'day';
109
+ const startDate = this.getParamValue(Params, 'StartDate') as string;
110
+ const endDate = this.getParamValue(Params, 'EndDate') as string;
111
+ const includeDemographics = this.getParamValue(Params, 'IncludeDemographics') !== false;
112
+ const includeVideoMetrics = this.getParamValue(Params, 'IncludeVideoMetrics') !== false;
113
+ const compareWithPrevious = this.getParamValue(Params, 'CompareWithPrevious') as boolean;
114
+
115
+ LogStatus(`Retrieving insights for Facebook page ${pageId}...`);
116
+
117
+ // Get page access token
118
+ const pageToken = await this.getPageAccessToken(pageId);
119
+
120
+ // Build metrics list
121
+ const metrics = metricTypes && metricTypes.length > 0
122
+ ? metricTypes
123
+ : this.getDefaultPageMetrics(includeDemographics, includeVideoMetrics);
124
+
125
+ // Build date range parameters
126
+ const dateParams: any = {};
127
+ if (startDate && endDate) {
128
+ dateParams.since = new Date(startDate).toISOString();
129
+ dateParams.until = new Date(endDate).toISOString();
130
+ } else if (period !== 'lifetime') {
131
+ // Default to last 30 days if no date range specified
132
+ const end = new Date();
133
+ const start = new Date();
134
+ start.setDate(start.getDate() - 30);
135
+ dateParams.since = start.toISOString();
136
+ dateParams.until = end.toISOString();
137
+ }
138
+
139
+ // Get page insights
140
+ const insightsResponse = await axios.get(
141
+ `${this.apiBaseUrl}/${pageId}/insights`,
142
+ {
143
+ params: {
144
+ access_token: pageToken,
145
+ metric: metrics.join(','),
146
+ period: period,
147
+ ...dateParams
148
+ }
149
+ }
150
+ );
151
+
152
+ const insights: FacebookInsight[] = insightsResponse.data.data || [];
153
+
154
+ // Get page info for context
155
+ const pageInfoResponse = await axios.get(
156
+ `${this.apiBaseUrl}/${pageId}`,
157
+ {
158
+ params: {
159
+ access_token: pageToken,
160
+ fields: 'id,name,category,fan_count,followers_count,about,cover,picture'
161
+ }
162
+ }
163
+ );
164
+
165
+ const pageInfo = pageInfoResponse.data;
166
+
167
+ // Process insights into categories
168
+ const processedInsights = this.categorizeInsights(insights);
169
+
170
+ // Get comparison data if requested
171
+ let comparison = null;
172
+ if (compareWithPrevious && startDate && endDate) {
173
+ comparison = await this.getComparisonData(
174
+ pageId,
175
+ pageToken,
176
+ metrics,
177
+ period,
178
+ new Date(startDate),
179
+ new Date(endDate)
180
+ );
181
+ }
182
+
183
+ // Calculate summary metrics
184
+ const summary = this.calculateSummaryMetrics(processedInsights, pageInfo);
185
+
186
+ LogStatus(`Successfully retrieved insights for page ${pageId}`);
187
+
188
+ return {
189
+ Success: true,
190
+ Message: 'Page insights retrieved successfully',
191
+ ResultCode: 'SUCCESS',
192
+ Params
193
+ };
194
+
195
+ } catch (error) {
196
+ LogError(`Failed to get Facebook page insights: ${error instanceof Error ? error.message : 'Unknown error'}`);
197
+
198
+ if (this.isAuthError(error)) {
199
+ return this.handleOAuthError(error);
200
+ }
201
+
202
+ return {
203
+ Success: false,
204
+ Message: error instanceof Error ? error.message : 'Unknown error occurred',
205
+ ResultCode: 'ERROR'
206
+ };
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Get default page metrics based on options
212
+ */
213
+ private getDefaultPageMetrics(includeDemographics: boolean, includeVideo: boolean): string[] {
214
+ const metrics = [
215
+ // Page Views
216
+ 'page_views_total',
217
+ 'page_views_logged_in_unique',
218
+ 'page_views_by_site_logged_in_unique',
219
+
220
+ // Page Likes
221
+ 'page_fan_adds',
222
+ 'page_fan_removes',
223
+ 'page_fan_adds_unique',
224
+ 'page_fans',
225
+
226
+ // Engagement
227
+ 'page_engaged_users',
228
+ 'page_post_engagements',
229
+ 'page_consumptions',
230
+ 'page_consumptions_unique',
231
+ 'page_places_checkin_total',
232
+
233
+ // Impressions
234
+ 'page_impressions',
235
+ 'page_impressions_unique',
236
+ 'page_impressions_paid',
237
+ 'page_impressions_paid_unique',
238
+ 'page_impressions_organic',
239
+ 'page_impressions_organic_unique',
240
+
241
+ // Posts
242
+ 'page_posts_impressions',
243
+ 'page_posts_impressions_unique',
244
+
245
+ // Actions
246
+ 'page_actions_post_reactions_total',
247
+ 'page_actions_post_reactions_like_total',
248
+ 'page_actions_post_reactions_love_total',
249
+ 'page_actions_post_reactions_wow_total',
250
+ 'page_actions_post_reactions_haha_total',
251
+ 'page_actions_post_reactions_sorry_total',
252
+ 'page_actions_post_reactions_anger_total',
253
+
254
+ // CTA Clicks
255
+ 'page_total_actions',
256
+ 'page_cta_clicks_logged_in_total',
257
+
258
+ // Messages
259
+ 'page_messages_total_messaging_connections',
260
+ 'page_messages_new_conversations',
261
+
262
+ // Negative Feedback
263
+ 'page_negative_feedback',
264
+ 'page_negative_feedback_unique'
265
+ ];
266
+
267
+ if (includeDemographics) {
268
+ metrics.push(
269
+ 'page_fans_gender_age',
270
+ 'page_fans_country',
271
+ 'page_fans_city',
272
+ 'page_fans_locale',
273
+ 'page_impressions_by_age_gender_unique',
274
+ 'page_engaged_users_by_age_gender'
275
+ );
276
+ }
277
+
278
+ if (includeVideo) {
279
+ metrics.push(
280
+ 'page_video_views',
281
+ 'page_video_views_paid',
282
+ 'page_video_views_organic',
283
+ 'page_video_views_autoplayed',
284
+ 'page_video_views_click_to_play',
285
+ 'page_video_views_unique',
286
+ 'page_video_repeat_views',
287
+ 'page_video_complete_views_30s',
288
+ 'page_video_complete_views_30s_paid',
289
+ 'page_video_complete_views_30s_organic',
290
+ 'page_video_views_10s',
291
+ 'page_video_views_10s_paid',
292
+ 'page_video_views_10s_organic'
293
+ );
294
+ }
295
+
296
+ return metrics;
297
+ }
298
+
299
+ /**
300
+ * Categorize insights by type for better organization
301
+ */
302
+ private categorizeInsights(insights: FacebookInsight[]): Record<string, any> {
303
+ const categories: Record<string, any> = {
304
+ pageViews: {},
305
+ engagement: {},
306
+ likes: {},
307
+ impressions: {},
308
+ posts: {},
309
+ reactions: {},
310
+ demographics: {},
311
+ video: {},
312
+ messages: {},
313
+ negativeFeedback: {}
314
+ };
315
+
316
+ for (const insight of insights) {
317
+ const name = insight.name;
318
+ const value = insight.values?.[0]?.value;
319
+
320
+ if (name.includes('page_views')) {
321
+ categories.pageViews[name] = value;
322
+ } else if (name.includes('engaged') || name.includes('engagement')) {
323
+ categories.engagement[name] = value;
324
+ } else if (name.includes('fan') || name === 'page_fans') {
325
+ categories.likes[name] = value;
326
+ } else if (name.includes('impressions')) {
327
+ categories.impressions[name] = value;
328
+ } else if (name.includes('posts')) {
329
+ categories.posts[name] = value;
330
+ } else if (name.includes('reactions')) {
331
+ categories.reactions[name] = value;
332
+ } else if (name.includes('gender') || name.includes('country') || name.includes('city') || name.includes('locale')) {
333
+ categories.demographics[name] = value;
334
+ } else if (name.includes('video')) {
335
+ categories.video[name] = value;
336
+ } else if (name.includes('messages')) {
337
+ categories.messages[name] = value;
338
+ } else if (name.includes('negative')) {
339
+ categories.negativeFeedback[name] = value;
340
+ }
341
+ }
342
+
343
+ return categories;
344
+ }
345
+
346
+ /**
347
+ * Calculate summary metrics
348
+ */
349
+ private calculateSummaryMetrics(insights: Record<string, any>, pageInfo: any): any {
350
+ const summary: any = {
351
+ totalFans: pageInfo.fan_count || 0,
352
+ totalFollowers: pageInfo.followers_count || 0,
353
+ totalPageViews: insights.pageViews.page_views_total || 0,
354
+ totalEngagements: insights.engagement.page_engaged_users || 0,
355
+ totalImpressions: insights.impressions.page_impressions || 0,
356
+ netNewFans: (insights.likes.page_fan_adds || 0) - (insights.likes.page_fan_removes || 0)
357
+ };
358
+
359
+ // Calculate engagement rate if we have the data
360
+ if (summary.totalImpressions > 0) {
361
+ summary.engagementRate = (summary.totalEngagements / summary.totalImpressions) * 100;
362
+ }
363
+
364
+ // Add reaction breakdown
365
+ const reactions = insights.reactions;
366
+ if (reactions) {
367
+ summary.reactionBreakdown = {
368
+ total: reactions.page_actions_post_reactions_total || 0,
369
+ like: reactions.page_actions_post_reactions_like_total || 0,
370
+ love: reactions.page_actions_post_reactions_love_total || 0,
371
+ wow: reactions.page_actions_post_reactions_wow_total || 0,
372
+ haha: reactions.page_actions_post_reactions_haha_total || 0,
373
+ sorry: reactions.page_actions_post_reactions_sorry_total || 0,
374
+ anger: reactions.page_actions_post_reactions_anger_total || 0
375
+ };
376
+ }
377
+
378
+ return summary;
379
+ }
380
+
381
+ /**
382
+ * Get comparison data for previous period
383
+ */
384
+ private async getComparisonData(
385
+ pageId: string,
386
+ pageToken: string,
387
+ metrics: string[],
388
+ period: string,
389
+ startDate: Date,
390
+ endDate: Date
391
+ ): Promise<any> {
392
+ try {
393
+ const duration = endDate.getTime() - startDate.getTime();
394
+ const previousStart = new Date(startDate.getTime() - duration);
395
+ const previousEnd = new Date(startDate.getTime());
396
+
397
+ const response = await axios.get(
398
+ `${this.apiBaseUrl}/${pageId}/insights`,
399
+ {
400
+ params: {
401
+ access_token: pageToken,
402
+ metric: metrics.join(','),
403
+ period: period,
404
+ since: previousStart.toISOString(),
405
+ until: previousEnd.toISOString()
406
+ }
407
+ }
408
+ );
409
+
410
+ const previousInsights = response.data.data || [];
411
+ const processedPrevious = this.categorizeInsights(previousInsights);
412
+
413
+ return {
414
+ period: {
415
+ start: previousStart.toISOString(),
416
+ end: previousEnd.toISOString()
417
+ },
418
+ insights: processedPrevious
419
+ };
420
+ } catch (error) {
421
+ LogError(`Failed to get comparison data: ${error}`);
422
+ return null;
423
+ }
424
+ }
425
+
426
+
427
+ }
@@ -0,0 +1,241 @@
1
+ import { RegisterClass } from '@memberjunction/global';
2
+ import { FacebookBaseAction, GetPagePostsParams } 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
+
7
+ /**
8
+ * Retrieves posts from a Facebook page with optional date filtering.
9
+ * Includes post content, media, and basic engagement metrics.
10
+ */
11
+ @RegisterClass(FacebookBaseAction, 'FacebookGetPagePostsAction')
12
+ export class FacebookGetPagePostsAction extends FacebookBaseAction {
13
+ /**
14
+ * Get action description
15
+ */
16
+ public get Description(): string {
17
+ return 'Retrieves posts from a Facebook page with optional date range filtering and pagination';
18
+ }
19
+
20
+ /**
21
+ * Define the parameters for this action
22
+ */
23
+ public get Params(): ActionParam[] {
24
+ return [
25
+ ...this.commonSocialParams,
26
+ {
27
+ Name: 'PageID',
28
+ Type: 'Input',
29
+ Value: null,
30
+ },
31
+ {
32
+ Name: 'StartDate',
33
+ Type: 'Input',
34
+ Value: null,
35
+ },
36
+ {
37
+ Name: 'EndDate',
38
+ Type: 'Input',
39
+ Value: null,
40
+ },
41
+ {
42
+ Name: 'Limit',
43
+ Type: 'Input',
44
+ Value: 100,
45
+ },
46
+ {
47
+ Name: 'MaxResults',
48
+ Type: 'Input',
49
+ Value: null,
50
+ },
51
+ {
52
+ Name: 'IncludeUnpublished',
53
+ Type: 'Input',
54
+ Value: false,
55
+ },
56
+ {
57
+ Name: 'IncludeInsights',
58
+ Type: 'Input',
59
+ Value: true,
60
+ }
61
+ ];
62
+ }
63
+
64
+ /**
65
+ * Execute the action
66
+ */
67
+ protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
68
+ const { Params, ContextUser } = params;
69
+
70
+ try {
71
+ // Validate required parameters
72
+ const companyIntegrationId = this.getParamValue(Params, 'CompanyIntegrationID');
73
+ const pageId = this.getParamValue(Params, 'PageID');
74
+
75
+ if (!companyIntegrationId) {
76
+ return {
77
+ Success: false,
78
+ Message: 'CompanyIntegrationID is required',
79
+ ResultCode: 'INVALID_TOKEN'
80
+ };
81
+ }
82
+
83
+ if (!pageId) {
84
+ return {
85
+ Success: false,
86
+ Message: 'PageID is required',
87
+ ResultCode: 'MISSING_REQUIRED_PARAM'
88
+ };
89
+ }
90
+
91
+ // Initialize OAuth
92
+ if (!await this.initializeOAuth(companyIntegrationId)) {
93
+ return {
94
+ Success: false,
95
+ Message: 'Failed to initialize Facebook OAuth connection',
96
+ ResultCode: 'INVALID_TOKEN'
97
+ };
98
+ }
99
+
100
+ // Get parameters
101
+ const startDate = this.getParamValue(Params, 'StartDate') as string;
102
+ const endDate = this.getParamValue(Params, 'EndDate') as string;
103
+ const limit = this.getParamValue(Params, 'Limit') as number || 100;
104
+ const maxResults = this.getParamValue(Params, 'MaxResults') as number;
105
+ const includeUnpublished = this.getParamValue(Params, 'IncludeUnpublished') as boolean;
106
+ const includeInsights = this.getParamValue(Params, 'IncludeInsights') as boolean;
107
+
108
+ // Build query parameters
109
+ const queryParams: GetPagePostsParams = {
110
+ limit: Math.min(limit, 100), // Facebook max is 100 per request
111
+ published: includeUnpublished ? undefined : true
112
+ };
113
+
114
+ if (startDate) {
115
+ queryParams.since = new Date(startDate);
116
+ }
117
+
118
+ if (endDate) {
119
+ queryParams.until = new Date(endDate);
120
+ }
121
+
122
+ LogStatus(`Retrieving posts from Facebook page ${pageId}...`);
123
+
124
+ // Get posts with pagination support
125
+ let allPosts = await this.getPagePosts(pageId, queryParams);
126
+
127
+ // If we need more posts and have a maxResults, use pagination
128
+ if (maxResults && allPosts.length < maxResults && allPosts.length === queryParams.limit) {
129
+ LogStatus(`Fetching additional pages of posts...`);
130
+
131
+ const pageToken = await this.getPageAccessToken(pageId);
132
+ const fields = includeInsights ? this.getPostFields() : this.getPostFieldsWithoutInsights();
133
+
134
+ allPosts = await this.getPaginatedResults(
135
+ `${this.apiBaseUrl}/${pageId}/posts`,
136
+ {
137
+ access_token: pageToken,
138
+ fields,
139
+ ...queryParams,
140
+ since: queryParams.since ? Math.floor(queryParams.since.getTime() / 1000) : undefined,
141
+ until: queryParams.until ? Math.floor(queryParams.until.getTime() / 1000) : undefined
142
+ },
143
+ maxResults
144
+ );
145
+ }
146
+
147
+ // Limit results if maxResults specified
148
+ if (maxResults && allPosts.length > maxResults) {
149
+ allPosts = allPosts.slice(0, maxResults);
150
+ }
151
+
152
+ LogStatus(`Retrieved ${allPosts.length} posts from Facebook page`);
153
+
154
+ // Normalize posts to common format
155
+ const normalizedPosts = allPosts.map(post => this.normalizePost(post));
156
+
157
+ // Calculate summary statistics
158
+ const summary = {
159
+ totalPosts: normalizedPosts.length,
160
+ dateRange: {
161
+ earliest: normalizedPosts.length > 0
162
+ ? normalizedPosts[normalizedPosts.length - 1].publishedAt
163
+ : null,
164
+ latest: normalizedPosts.length > 0
165
+ ? normalizedPosts[0].publishedAt
166
+ : null
167
+ },
168
+ postTypes: this.categorizePostTypes(allPosts),
169
+ totalEngagements: normalizedPosts.reduce((sum, post) =>
170
+ sum + (post.analytics?.engagements || 0), 0
171
+ ),
172
+ totalImpressions: normalizedPosts.reduce((sum, post) =>
173
+ sum + (post.analytics?.impressions || 0), 0
174
+ )
175
+ };
176
+
177
+ // Update output parameters
178
+ const outputParams = [...Params];
179
+ // TODO: Set output parameters based on result
180
+
181
+ return {
182
+ Success: true,
183
+ Message: `Successfully retrieved ${normalizedPosts.length} posts`,
184
+ ResultCode: 'SUCCESS',
185
+ Params: outputParams
186
+ };
187
+
188
+ } catch (error) {
189
+ LogError(`Failed to get Facebook page posts: ${error instanceof Error ? error.message : 'Unknown error'}`);
190
+
191
+ if (this.isAuthError(error)) {
192
+ return this.handleOAuthError(error);
193
+ }
194
+
195
+ return {
196
+ Success: false,
197
+ Message: error instanceof Error ? error.message : 'Unknown error occurred',
198
+ ResultCode: 'ERROR'
199
+ };
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Get post fields without insights (for faster queries or when insights not available)
205
+ */
206
+ private getPostFieldsWithoutInsights(): string {
207
+ return 'id,message,created_time,updated_time,from,story,permalink_url,attachments,shares,reactions.summary(true),comments.summary(true)';
208
+ }
209
+
210
+ /**
211
+ * Categorize posts by type based on attachments
212
+ */
213
+ private categorizePostTypes(posts: any[]): Record<string, number> {
214
+ const types: Record<string, number> = {
215
+ status: 0,
216
+ photo: 0,
217
+ video: 0,
218
+ link: 0,
219
+ event: 0,
220
+ offer: 0,
221
+ album: 0
222
+ };
223
+
224
+ for (const post of posts) {
225
+ if (post.attachments?.data?.[0]?.type) {
226
+ const type = post.attachments.data[0].type.toLowerCase();
227
+ if (type in types) {
228
+ types[type]++;
229
+ } else {
230
+ types.status++;
231
+ }
232
+ } else {
233
+ types.status++;
234
+ }
235
+ }
236
+
237
+ return types;
238
+ }
239
+
240
+
241
+ }