@woopsocial/typescript-sdk 0.0.9 → 0.1.1

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 (335) hide show
  1. package/FUNCTIONS.md +9 -3
  2. package/README.md +71 -22
  3. package/esm/funcs/posts-create-post.d.ts +23 -0
  4. package/esm/funcs/posts-create-post.d.ts.map +1 -0
  5. package/esm/funcs/posts-create-post.js +88 -0
  6. package/esm/funcs/posts-create-post.js.map +1 -0
  7. package/esm/funcs/posts-delete-post.d.ts +21 -0
  8. package/esm/funcs/posts-delete-post.d.ts.map +1 -0
  9. package/esm/funcs/posts-delete-post.js +91 -0
  10. package/esm/funcs/posts-delete-post.js.map +1 -0
  11. package/esm/funcs/posts-get-post.d.ts +19 -0
  12. package/esm/funcs/posts-get-post.d.ts.map +1 -0
  13. package/esm/funcs/posts-get-post.js +89 -0
  14. package/esm/funcs/posts-get-post.js.map +1 -0
  15. package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts +2 -1
  16. package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts.map +1 -1
  17. package/esm/funcs/social-accounts-get-social-account-platform-inputs.js +2 -1
  18. package/esm/funcs/social-accounts-get-social-account-platform-inputs.js.map +1 -1
  19. package/esm/lib/config.d.ts +2 -2
  20. package/esm/lib/config.js +2 -2
  21. package/esm/models/create-post-error-code.d.ts +16 -0
  22. package/esm/models/create-post-error-code.d.ts.map +1 -0
  23. package/esm/models/create-post-error-code.js +17 -0
  24. package/esm/models/create-post-error-code.js.map +1 -0
  25. package/esm/models/create-post-request.d.ts +35 -0
  26. package/esm/models/create-post-request.d.ts.map +1 -0
  27. package/esm/models/create-post-request.js +17 -0
  28. package/esm/models/create-post-request.js.map +1 -0
  29. package/esm/models/delete-post-error-code.d.ts +11 -0
  30. package/esm/models/delete-post-error-code.d.ts.map +1 -0
  31. package/esm/models/delete-post-error-code.js +12 -0
  32. package/esm/models/delete-post-error-code.js.map +1 -0
  33. package/esm/models/delivery-status.d.ts +0 -2
  34. package/esm/models/delivery-status.d.ts.map +1 -1
  35. package/esm/models/delivery-status.js +0 -2
  36. package/esm/models/delivery-status.js.map +1 -1
  37. package/esm/models/draft-post-schedule.d.ts +17 -0
  38. package/esm/models/draft-post-schedule.d.ts.map +1 -0
  39. package/esm/models/draft-post-schedule.js +21 -0
  40. package/esm/models/draft-post-schedule.js.map +1 -0
  41. package/esm/models/errors/create-post-error-response.d.ts +46 -0
  42. package/esm/models/errors/create-post-error-response.d.ts.map +1 -0
  43. package/esm/models/errors/create-post-error-response.js +55 -0
  44. package/esm/models/errors/create-post-error-response.js.map +1 -0
  45. package/esm/models/errors/delete-post-error-response.d.ts +20 -0
  46. package/esm/models/errors/delete-post-error-response.d.ts.map +1 -0
  47. package/esm/models/errors/delete-post-error-response.js +34 -0
  48. package/esm/models/errors/delete-post-error-response.js.map +1 -0
  49. package/esm/models/errors/get-post-error-response.d.ts +20 -0
  50. package/esm/models/errors/get-post-error-response.d.ts.map +1 -0
  51. package/esm/models/errors/get-post-error-response.js +34 -0
  52. package/esm/models/errors/get-post-error-response.js.map +1 -0
  53. package/esm/models/errors/index.d.ts +3 -0
  54. package/esm/models/errors/index.d.ts.map +1 -1
  55. package/esm/models/errors/index.js +3 -0
  56. package/esm/models/errors/index.js.map +1 -1
  57. package/esm/models/facebook-input.d.ts +33 -0
  58. package/esm/models/facebook-input.d.ts.map +1 -0
  59. package/esm/models/facebook-input.js +18 -0
  60. package/esm/models/facebook-input.js.map +1 -0
  61. package/esm/models/facebook-post.d.ts +43 -0
  62. package/esm/models/facebook-post.d.ts.map +1 -0
  63. package/esm/models/facebook-post.js +26 -0
  64. package/esm/models/facebook-post.js.map +1 -0
  65. package/esm/models/get-post-error-code.d.ts +10 -0
  66. package/esm/models/get-post-error-code.d.ts.map +1 -0
  67. package/esm/models/get-post-error-code.js +11 -0
  68. package/esm/models/get-post-error-code.js.map +1 -0
  69. package/esm/models/health-response.d.ts +2 -2
  70. package/esm/models/health-response.d.ts.map +1 -1
  71. package/esm/models/health-response.js +1 -1
  72. package/esm/models/health-response.js.map +1 -1
  73. package/esm/models/index.d.ts +37 -34
  74. package/esm/models/index.d.ts.map +1 -1
  75. package/esm/models/index.js +37 -34
  76. package/esm/models/index.js.map +1 -1
  77. package/esm/models/instagram-input.d.ts +31 -0
  78. package/esm/models/instagram-input.d.ts.map +1 -0
  79. package/esm/models/instagram-input.js +17 -0
  80. package/esm/models/instagram-input.js.map +1 -0
  81. package/esm/models/instagram-post.d.ts +42 -0
  82. package/esm/models/instagram-post.d.ts.map +1 -0
  83. package/esm/models/instagram-post.js +25 -0
  84. package/esm/models/instagram-post.js.map +1 -0
  85. package/esm/models/linked-in-input.d.ts +28 -0
  86. package/esm/models/linked-in-input.d.ts.map +1 -0
  87. package/esm/models/linked-in-input.js +15 -0
  88. package/esm/models/linked-in-input.js.map +1 -0
  89. package/esm/models/linked-in-pages-input.d.ts +28 -0
  90. package/esm/models/linked-in-pages-input.d.ts.map +1 -0
  91. package/esm/models/linked-in-pages-input.js +15 -0
  92. package/esm/models/linked-in-pages-input.js.map +1 -0
  93. package/esm/models/linked-in-pages-post.d.ts +40 -0
  94. package/esm/models/linked-in-pages-post.d.ts.map +1 -0
  95. package/esm/models/linked-in-pages-post.js +23 -0
  96. package/esm/models/linked-in-pages-post.js.map +1 -0
  97. package/esm/models/linked-in-post.d.ts +40 -0
  98. package/esm/models/linked-in-post.d.ts.map +1 -0
  99. package/esm/models/linked-in-post.js +23 -0
  100. package/esm/models/linked-in-post.js.map +1 -0
  101. package/esm/models/media-library-post-content-media-input.d.ts +17 -0
  102. package/esm/models/media-library-post-content-media-input.d.ts.map +1 -0
  103. package/esm/models/media-library-post-content-media-input.js +13 -0
  104. package/esm/models/media-library-post-content-media-input.js.map +1 -0
  105. package/esm/models/media-library-post-content-media.d.ts +31 -0
  106. package/esm/models/media-library-post-content-media.d.ts.map +1 -0
  107. package/esm/models/media-library-post-content-media.js +25 -0
  108. package/esm/models/media-library-post-content-media.js.map +1 -0
  109. package/esm/models/operations/delete-post.d.ts +15 -0
  110. package/esm/models/operations/delete-post.d.ts.map +1 -0
  111. package/esm/models/operations/delete-post.js +12 -0
  112. package/esm/models/operations/delete-post.js.map +1 -0
  113. package/esm/models/operations/get-post.d.ts +15 -0
  114. package/esm/models/operations/get-post.d.ts.map +1 -0
  115. package/esm/models/operations/get-post.js +12 -0
  116. package/esm/models/operations/get-post.js.map +1 -0
  117. package/esm/models/operations/index.d.ts +2 -0
  118. package/esm/models/operations/index.d.ts.map +1 -1
  119. package/esm/models/operations/index.js +2 -0
  120. package/esm/models/operations/index.js.map +1 -1
  121. package/esm/models/pinterest-input.d.ts +30 -0
  122. package/esm/models/pinterest-input.d.ts.map +1 -0
  123. package/esm/models/pinterest-input.js +16 -0
  124. package/esm/models/pinterest-input.js.map +1 -0
  125. package/esm/models/pinterest-post.d.ts +41 -0
  126. package/esm/models/pinterest-post.d.ts.map +1 -0
  127. package/esm/models/pinterest-post.js +24 -0
  128. package/esm/models/pinterest-post.js.map +1 -0
  129. package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts +10 -2
  130. package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts.map +1 -1
  131. package/esm/models/pinterest-social-account-platform-specific-inputs.js +2 -2
  132. package/esm/models/pinterest-social-account-platform-specific-inputs.js.map +1 -1
  133. package/esm/models/post-content-item-input.d.ts +18 -0
  134. package/esm/models/post-content-item-input.d.ts.map +1 -0
  135. package/esm/models/post-content-item-input.js +14 -0
  136. package/esm/models/post-content-item-input.js.map +1 -0
  137. package/esm/models/post-content-item.d.ts +15 -0
  138. package/esm/models/post-content-item.d.ts.map +1 -0
  139. package/esm/models/post-content-item.js +16 -0
  140. package/esm/models/post-content-item.js.map +1 -0
  141. package/esm/models/post-content-media-input.d.ts +14 -0
  142. package/esm/models/post-content-media-input.d.ts.map +1 -0
  143. package/esm/models/post-content-media-input.js +10 -0
  144. package/esm/models/post-content-media-input.js.map +1 -0
  145. package/esm/models/post-content-media.d.ts +14 -0
  146. package/esm/models/post-content-media.d.ts.map +1 -0
  147. package/esm/models/post-content-media.js +11 -0
  148. package/esm/models/post-content-media.js.map +1 -0
  149. package/esm/models/post-schedule.d.ts +17 -0
  150. package/esm/models/post-schedule.d.ts.map +1 -0
  151. package/esm/models/post-schedule.js +28 -0
  152. package/esm/models/post-schedule.js.map +1 -0
  153. package/esm/models/post.d.ts +14 -44
  154. package/esm/models/post.d.ts.map +1 -1
  155. package/esm/models/post.js +8 -18
  156. package/esm/models/post.js.map +1 -1
  157. package/esm/models/publish-now-post-schedule.d.ts +17 -0
  158. package/esm/models/publish-now-post-schedule.d.ts.map +1 -0
  159. package/esm/models/publish-now-post-schedule.js +21 -0
  160. package/esm/models/publish-now-post-schedule.js.map +1 -0
  161. package/esm/models/schedule-for-later-post-schedule.d.ts +22 -0
  162. package/esm/models/schedule-for-later-post-schedule.d.ts.map +1 -0
  163. package/esm/models/schedule-for-later-post-schedule.js +23 -0
  164. package/esm/models/schedule-for-later-post-schedule.js.map +1 -0
  165. package/esm/models/social-account-platform-inputs.d.ts +0 -5
  166. package/esm/models/social-account-platform-inputs.d.ts.map +1 -1
  167. package/esm/models/social-account-platform-inputs.js +0 -2
  168. package/esm/models/social-account-platform-inputs.js.map +1 -1
  169. package/esm/models/social-account-post.d.ts +17 -0
  170. package/esm/models/social-account-post.d.ts.map +1 -0
  171. package/esm/models/social-account-post.js +28 -0
  172. package/esm/models/social-account-post.js.map +1 -0
  173. package/esm/models/social-account-target-input.d.ts +16 -0
  174. package/esm/models/social-account-target-input.d.ts.map +1 -0
  175. package/esm/models/social-account-target-input.js +27 -0
  176. package/esm/models/social-account-target-input.js.map +1 -0
  177. package/esm/models/tik-tok-input.d.ts +90 -0
  178. package/esm/models/tik-tok-input.d.ts.map +1 -0
  179. package/esm/models/tik-tok-input.js +26 -0
  180. package/esm/models/tik-tok-input.js.map +1 -0
  181. package/esm/models/tik-tok-post.d.ts +93 -0
  182. package/esm/models/tik-tok-post.d.ts.map +1 -0
  183. package/esm/models/tik-tok-post.js +35 -0
  184. package/esm/models/tik-tok-post.js.map +1 -0
  185. package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts +26 -2
  186. package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts.map +1 -1
  187. package/esm/models/tik-tok-social-account-platform-specific-inputs.js +6 -2
  188. package/esm/models/tik-tok-social-account-platform-specific-inputs.js.map +1 -1
  189. package/esm/models/upload-session-aborted-status.d.ts +14 -0
  190. package/esm/models/upload-session-aborted-status.d.ts.map +1 -0
  191. package/esm/models/upload-session-aborted-status.js +15 -0
  192. package/esm/models/upload-session-aborted-status.js.map +1 -0
  193. package/esm/models/upload-session-failed-status.d.ts +22 -0
  194. package/esm/models/upload-session-failed-status.d.ts.map +1 -0
  195. package/esm/models/upload-session-failed-status.js +17 -0
  196. package/esm/models/upload-session-failed-status.js.map +1 -0
  197. package/esm/models/upload-session-initiated-status.d.ts +14 -0
  198. package/esm/models/upload-session-initiated-status.d.ts.map +1 -0
  199. package/esm/models/upload-session-initiated-status.js +15 -0
  200. package/esm/models/upload-session-initiated-status.js.map +1 -0
  201. package/esm/models/upload-session-ready-status.d.ts +18 -0
  202. package/esm/models/upload-session-ready-status.d.ts.map +1 -0
  203. package/esm/models/upload-session-ready-status.js +16 -0
  204. package/esm/models/upload-session-ready-status.js.map +1 -0
  205. package/esm/models/upload-session-status.d.ts +7 -11
  206. package/esm/models/upload-session-status.d.ts.map +1 -1
  207. package/esm/models/upload-session-status.js +12 -9
  208. package/esm/models/upload-session-status.js.map +1 -1
  209. package/esm/models/upload-session-uploaded-status.d.ts +14 -0
  210. package/esm/models/upload-session-uploaded-status.d.ts.map +1 -0
  211. package/esm/models/upload-session-uploaded-status.js +15 -0
  212. package/esm/models/upload-session-uploaded-status.js.map +1 -0
  213. package/esm/models/validation-error.d.ts +4 -2
  214. package/esm/models/validation-error.d.ts.map +1 -1
  215. package/esm/models/validation-error.js +1 -2
  216. package/esm/models/validation-error.js.map +1 -1
  217. package/esm/models/x-input.d.ts +28 -0
  218. package/esm/models/x-input.d.ts.map +1 -0
  219. package/esm/models/x-input.js +16 -0
  220. package/esm/models/x-input.js.map +1 -0
  221. package/esm/models/x-post.d.ts +40 -0
  222. package/esm/models/x-post.d.ts.map +1 -0
  223. package/esm/models/x-post.js +23 -0
  224. package/esm/models/x-post.js.map +1 -0
  225. package/esm/models/you-tube-input.d.ts +37 -0
  226. package/esm/models/you-tube-input.d.ts.map +1 -0
  227. package/esm/models/you-tube-input.js +20 -0
  228. package/esm/models/you-tube-input.js.map +1 -0
  229. package/esm/models/you-tube-post.d.ts +45 -0
  230. package/esm/models/you-tube-post.d.ts.map +1 -0
  231. package/esm/models/you-tube-post.js +29 -0
  232. package/esm/models/you-tube-post.js.map +1 -0
  233. package/esm/sdk/posts.d.ts +15 -27
  234. package/esm/sdk/posts.d.ts.map +1 -1
  235. package/esm/sdk/posts.js +20 -36
  236. package/esm/sdk/posts.js.map +1 -1
  237. package/esm/sdk/social-accounts.d.ts +2 -1
  238. package/esm/sdk/social-accounts.d.ts.map +1 -1
  239. package/esm/sdk/social-accounts.js +2 -1
  240. package/esm/sdk/social-accounts.js.map +1 -1
  241. package/jsr.json +1 -1
  242. package/package.json +3 -3
  243. package/src/funcs/{posts-delete-posts.ts → posts-create-post.ts} +27 -16
  244. package/src/funcs/{posts-create-posts.ts → posts-delete-post.ts} +36 -24
  245. package/src/funcs/{posts-list-posts.ts → posts-get-post.ts} +34 -21
  246. package/src/funcs/social-accounts-get-social-account-platform-inputs.ts +2 -1
  247. package/src/lib/config.ts +2 -2
  248. package/src/models/{create-post-failure-code.ts → create-post-error-code.ts} +8 -7
  249. package/src/models/create-post-request.ts +67 -0
  250. package/src/models/{delete-post-failure-code.ts → delete-post-error-code.ts} +5 -5
  251. package/src/models/delivery-status.ts +0 -5
  252. package/src/models/draft-post-schedule.ts +50 -0
  253. package/src/models/errors/create-post-error-response.ts +89 -0
  254. package/src/models/errors/delete-post-error-response.ts +53 -0
  255. package/src/models/errors/get-post-error-response.ts +53 -0
  256. package/src/models/errors/index.ts +3 -0
  257. package/src/models/facebook-input.ts +58 -0
  258. package/src/models/facebook-post.ts +80 -0
  259. package/src/models/get-post-error-code.ts +19 -0
  260. package/src/models/health-response.ts +3 -3
  261. package/src/models/index.ts +37 -34
  262. package/src/models/instagram-input.ts +55 -0
  263. package/src/models/instagram-post.ts +80 -0
  264. package/src/models/linked-in-input.ts +48 -0
  265. package/src/models/linked-in-pages-input.ts +52 -0
  266. package/src/models/linked-in-pages-post.ts +74 -0
  267. package/src/models/linked-in-post.ts +72 -0
  268. package/src/models/media-library-post-content-media-input.ts +38 -0
  269. package/src/models/media-library-post-content-media.ts +60 -0
  270. package/src/models/operations/delete-post.ts +33 -0
  271. package/src/models/operations/get-post.ts +29 -0
  272. package/src/models/operations/index.ts +2 -0
  273. package/src/models/pinterest-input.ts +51 -0
  274. package/src/models/pinterest-post.ts +76 -0
  275. package/src/models/pinterest-social-account-platform-specific-inputs.ts +13 -5
  276. package/src/models/post-content-item-input.ts +41 -0
  277. package/src/models/post-content-item.ts +40 -0
  278. package/src/models/post-content-media-input.ts +35 -0
  279. package/src/models/post-content-media.ts +35 -0
  280. package/src/models/post-schedule.ts +70 -0
  281. package/src/models/post.ts +23 -65
  282. package/src/models/publish-now-post-schedule.ts +50 -0
  283. package/src/models/schedule-for-later-post-schedule.ts +59 -0
  284. package/src/models/social-account-platform-inputs.ts +0 -9
  285. package/src/models/social-account-post.ts +63 -0
  286. package/src/models/social-account-target-input.ts +85 -0
  287. package/src/models/tik-tok-input.ts +125 -0
  288. package/src/models/tik-tok-post.ts +140 -0
  289. package/src/models/tik-tok-social-account-platform-specific-inputs.ts +33 -5
  290. package/src/models/upload-session-aborted-status.ts +36 -0
  291. package/src/models/upload-session-failed-status.ts +46 -0
  292. package/src/models/upload-session-initiated-status.ts +36 -0
  293. package/src/models/upload-session-ready-status.ts +41 -0
  294. package/src/models/upload-session-status.ts +34 -20
  295. package/src/models/upload-session-uploaded-status.ts +36 -0
  296. package/src/models/validation-error.ts +5 -6
  297. package/src/models/x-input.ts +46 -0
  298. package/src/models/x-post.ts +71 -0
  299. package/src/models/you-tube-input.ts +64 -0
  300. package/src/models/you-tube-post.ts +84 -0
  301. package/src/sdk/posts.ts +27 -50
  302. package/src/sdk/social-accounts.ts +2 -1
  303. package/src/funcs/posts-update-posts.ts +0 -165
  304. package/src/models/create-post-failure-result.ts +0 -68
  305. package/src/models/create-post-item.ts +0 -73
  306. package/src/models/create-post-result.ts +0 -42
  307. package/src/models/create-post-success-result.ts +0 -50
  308. package/src/models/create-posts-response.ts +0 -37
  309. package/src/models/delete-post-failure-result.ts +0 -44
  310. package/src/models/delete-post-result.ts +0 -42
  311. package/src/models/delete-post-success-result.ts +0 -36
  312. package/src/models/delete-posts-response.ts +0 -37
  313. package/src/models/facebook-specifics.ts +0 -63
  314. package/src/models/instagram-specifics.ts +0 -59
  315. package/src/models/linked-in-pages-specifics.ts +0 -50
  316. package/src/models/linked-in-specifics.ts +0 -50
  317. package/src/models/list-posts-request.ts +0 -68
  318. package/src/models/list-posts-response.ts +0 -37
  319. package/src/models/pinterest-account-platform-inputs.ts +0 -42
  320. package/src/models/pinterest-specifics.ts +0 -54
  321. package/src/models/platform-specifics.ts +0 -129
  322. package/src/models/post-media.ts +0 -56
  323. package/src/models/tik-tok-account-platform-inputs.ts +0 -63
  324. package/src/models/tik-tok-specifics.ts +0 -94
  325. package/src/models/update-post-failure-code.ts +0 -23
  326. package/src/models/update-post-failure-result.ts +0 -68
  327. package/src/models/update-post-item.ts +0 -61
  328. package/src/models/update-post-result.ts +0 -42
  329. package/src/models/update-post-success-result.ts +0 -45
  330. package/src/models/update-posts-response.ts +0 -37
  331. package/src/models/upload-session-status-value.ts +0 -24
  332. package/src/models/validation-field.ts +0 -29
  333. package/src/models/validation-warning.ts +0 -37
  334. package/src/models/x-specifics.ts +0 -44
  335. package/src/models/you-tube-specifics.ts +0 -71
package/src/sdk/posts.ts CHANGED
@@ -2,47 +2,31 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { postsCreatePosts } from "../funcs/posts-create-posts.js";
6
- import { postsDeletePosts } from "../funcs/posts-delete-posts.js";
7
- import { postsListPosts } from "../funcs/posts-list-posts.js";
8
- import { postsUpdatePosts } from "../funcs/posts-update-posts.js";
5
+ import { postsCreatePost } from "../funcs/posts-create-post.js";
6
+ import { postsDeletePost } from "../funcs/posts-delete-post.js";
7
+ import { postsGetPost } from "../funcs/posts-get-post.js";
9
8
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
10
9
  import * as models from "../models/index.js";
10
+ import * as operations from "../models/operations/index.js";
11
11
  import { unwrapAsync } from "../types/fp.js";
12
12
 
13
13
  export class Posts extends ClientSDK {
14
14
  /**
15
- * List posts
15
+ * Create post
16
16
  *
17
17
  * @remarks
18
- * Returns outbound posts that were scheduled within various projects.
19
- */
20
- async listPosts(
21
- request?: models.ListPostsRequest | undefined,
22
- options?: RequestOptions,
23
- ): Promise<models.ListPostsResponse> {
24
- return unwrapAsync(postsListPosts(
25
- this,
26
- request,
27
- options,
28
- ));
29
- }
30
-
31
- /**
32
- * Delete posts
33
- *
34
- * @remarks
35
- * Deletes one or more scheduled posts by post ID.
18
+ * Creates one post resource with one or more social-account targets.
36
19
  *
37
- * Only posts with `deliveryStatus` `NOT_STARTED` can be deleted.
20
+ * All referenced social accounts must belong to the same project.
38
21
  *
39
- * Results are returned in the same order as the provided `ids`.
22
+ * The request is validated atomically. If any social-account target fails
23
+ * validation, the post is not created.
40
24
  */
41
- async deletePosts(
42
- request: Array<string>,
25
+ async createPost(
26
+ request: models.CreatePostRequest,
43
27
  options?: RequestOptions,
44
- ): Promise<models.DeletePostsResponse> {
45
- return unwrapAsync(postsDeletePosts(
28
+ ): Promise<models.Post> {
29
+ return unwrapAsync(postsCreatePost(
46
30
  this,
47
31
  request,
48
32
  options,
@@ -50,22 +34,16 @@ export class Posts extends ClientSDK {
50
34
  }
51
35
 
52
36
  /**
53
- * Create posts
37
+ * Get post
54
38
  *
55
39
  * @remarks
56
- * Creates one or more scheduled posts.
57
- *
58
- * Each item in the request body creates one scheduled post for a single connected social account. Each item must target a specific project.
59
- *
60
- * Each item must provide an `idempotencyKey`. Reusing the same `idempotencyKey` for the same API key replays the original result for that item. This is to help you prevent accidentally publishing the same post multiple times, in case you need to retry due to network failures.
61
- *
62
- * Results are returned in the same order as the input array.
40
+ * Returns one post with its social-account children inline.
63
41
  */
64
- async createPosts(
65
- request: Array<models.CreatePostItem>,
42
+ async getPost(
43
+ request: operations.GetPostRequest,
66
44
  options?: RequestOptions,
67
- ): Promise<models.CreatePostsResponse> {
68
- return unwrapAsync(postsCreatePosts(
45
+ ): Promise<models.Post> {
46
+ return unwrapAsync(postsGetPost(
69
47
  this,
70
48
  request,
71
49
  options,
@@ -73,20 +51,19 @@ export class Posts extends ClientSDK {
73
51
  }
74
52
 
75
53
  /**
76
- * Update posts
54
+ * Delete post
77
55
  *
78
56
  * @remarks
79
- * Updates one or more scheduled posts by post ID.
80
- *
81
- * Only posts with `deliveryStatus` `NOT_STARTED` can be updated. It performs a full replacement of the specified posts, so omitted properties are cleared.
57
+ * Deletes one scheduled post by post ID.
82
58
  *
83
- * Results are returned in the same order as the input array.
59
+ * A post can only be deleted when all of its social-account deliveries are
60
+ * still `NOT_STARTED`.
84
61
  */
85
- async updatePosts(
86
- request: Array<models.UpdatePostItem>,
62
+ async deletePost(
63
+ request: operations.DeletePostRequest,
87
64
  options?: RequestOptions,
88
- ): Promise<models.UpdatePostsResponse> {
89
- return unwrapAsync(postsUpdatePosts(
65
+ ): Promise<void> {
66
+ return unwrapAsync(postsDeletePost(
90
67
  this,
91
68
  request,
92
69
  options,
@@ -53,7 +53,8 @@ export class SocialAccounts extends ClientSDK {
53
53
  * @remarks
54
54
  * Returns platform-specific input options for a connected social account.
55
55
  *
56
- * Use this endpoint to discover valid values for fields inside `platformSpecifics` when creating posts for Pinterest and TikTok.
56
+ * Use this endpoint to discover valid values for flattened post-target
57
+ * fields such as `pinterestBoardId` and `privacyLevel`.
57
58
  */
58
59
  async getSocialAccountPlatformInputs(
59
60
  request: operations.GetSocialAccountPlatformInputsRequest,
@@ -1,165 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { WoopSocialCore } from "../core.js";
7
- import { encodeJSON } from "../lib/encodings.js";
8
- import * as M from "../lib/matchers.js";
9
- import { compactMap } from "../lib/primitives.js";
10
- import { safeParse } from "../lib/schemas.js";
11
- import { RequestOptions } from "../lib/sdks.js";
12
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
- import { pathToFunc } from "../lib/url.js";
14
- import {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/http-client-errors.js";
21
- import { ResponseValidationError } from "../models/errors/response-validation-error.js";
22
- import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
23
- import { WoopSocialError } from "../models/errors/woop-social-error.js";
24
- import * as models from "../models/index.js";
25
- import { APICall, APIPromise } from "../types/async.js";
26
- import { Result } from "../types/fp.js";
27
-
28
- /**
29
- * Update posts
30
- *
31
- * @remarks
32
- * Updates one or more scheduled posts by post ID.
33
- *
34
- * Only posts with `deliveryStatus` `NOT_STARTED` can be updated. It performs a full replacement of the specified posts, so omitted properties are cleared.
35
- *
36
- * Results are returned in the same order as the input array.
37
- */
38
- export function postsUpdatePosts(
39
- client: WoopSocialCore,
40
- request: Array<models.UpdatePostItem>,
41
- options?: RequestOptions,
42
- ): APIPromise<
43
- Result<
44
- models.UpdatePostsResponse,
45
- | WoopSocialError
46
- | ResponseValidationError
47
- | ConnectionError
48
- | RequestAbortedError
49
- | RequestTimeoutError
50
- | InvalidRequestError
51
- | UnexpectedClientError
52
- | SDKValidationError
53
- >
54
- > {
55
- return new APIPromise($do(
56
- client,
57
- request,
58
- options,
59
- ));
60
- }
61
-
62
- async function $do(
63
- client: WoopSocialCore,
64
- request: Array<models.UpdatePostItem>,
65
- options?: RequestOptions,
66
- ): Promise<
67
- [
68
- Result<
69
- models.UpdatePostsResponse,
70
- | WoopSocialError
71
- | ResponseValidationError
72
- | ConnectionError
73
- | RequestAbortedError
74
- | RequestTimeoutError
75
- | InvalidRequestError
76
- | UnexpectedClientError
77
- | SDKValidationError
78
- >,
79
- APICall,
80
- ]
81
- > {
82
- const parsed = safeParse(
83
- request,
84
- (value) => z.parse(z.array(models.UpdatePostItem$outboundSchema), value),
85
- "Input validation failed",
86
- );
87
- if (!parsed.ok) {
88
- return [parsed, { status: "invalid" }];
89
- }
90
- const payload = parsed.value;
91
- const body = encodeJSON("body", payload, { explode: true });
92
-
93
- const path = pathToFunc("/posts/update")();
94
-
95
- const headers = new Headers(compactMap({
96
- "Content-Type": "application/json",
97
- Accept: "application/json",
98
- }));
99
-
100
- const secConfig = await extractSecurity(client._options.bearerAuth);
101
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
102
- const requestSecurity = resolveGlobalSecurity(securityInput);
103
-
104
- const context = {
105
- options: client._options,
106
- baseURL: options?.serverURL ?? client._baseURL ?? "",
107
- operationID: "updatePosts",
108
- oAuth2Scopes: null,
109
-
110
- resolvedSecurity: requestSecurity,
111
-
112
- securitySource: client._options.bearerAuth,
113
- retryConfig: options?.retries
114
- || client._options.retryConfig
115
- || { strategy: "none" },
116
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
117
- };
118
-
119
- const requestRes = client._createRequest(context, {
120
- security: requestSecurity,
121
- method: "POST",
122
- baseURL: options?.serverURL,
123
- path: path,
124
- headers: headers,
125
- body: body,
126
- userAgent: client._options.userAgent,
127
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
128
- }, options);
129
- if (!requestRes.ok) {
130
- return [requestRes, { status: "invalid" }];
131
- }
132
- const req = requestRes.value;
133
-
134
- const doResult = await client._do(req, {
135
- context,
136
- errorCodes: ["4XX", "5XX"],
137
- retryConfig: context.retryConfig,
138
- retryCodes: context.retryCodes,
139
- });
140
- if (!doResult.ok) {
141
- return [doResult, { status: "request-error", request: req }];
142
- }
143
- const response = doResult.value;
144
-
145
- const [result] = await M.match<
146
- models.UpdatePostsResponse,
147
- | WoopSocialError
148
- | ResponseValidationError
149
- | ConnectionError
150
- | RequestAbortedError
151
- | RequestTimeoutError
152
- | InvalidRequestError
153
- | UnexpectedClientError
154
- | SDKValidationError
155
- >(
156
- M.json(200, models.UpdatePostsResponse$inboundSchema),
157
- M.fail("4XX"),
158
- M.fail("5XX"),
159
- )(response, req);
160
- if (!result.ok) {
161
- return [result, { status: "complete", request: req, response }];
162
- }
163
-
164
- return [result, { status: "complete", request: req, response }];
165
- }
@@ -1,68 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../types/fp.js";
8
- import * as types from "../types/primitives.js";
9
- import {
10
- CreatePostFailureCode,
11
- CreatePostFailureCode$inboundSchema,
12
- } from "./create-post-failure-code.js";
13
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
14
- import {
15
- ValidationError,
16
- ValidationError$inboundSchema,
17
- } from "./validation-error.js";
18
- import {
19
- ValidationWarning,
20
- ValidationWarning$inboundSchema,
21
- } from "./validation-warning.js";
22
-
23
- export type CreatePostFailureResult = {
24
- status: "FAILURE";
25
- /**
26
- * Item idempotency key echoed from the request.
27
- */
28
- idempotencyKey: string;
29
- code: CreatePostFailureCode;
30
- /**
31
- * Human-readable summary of the failure.
32
- *
33
- * @remarks
34
- * When `code` is `VALIDATION_FAILED`, inspect `validationErrors` for the specific field-level errors.
35
- */
36
- message: string;
37
- /**
38
- * Structured validation errors for this item. Empty when there are no validation errors.
39
- */
40
- validationErrors: Array<ValidationError>;
41
- /**
42
- * Structured validation warnings for this item. Empty when there are no warnings.
43
- */
44
- validationWarnings: Array<ValidationWarning>;
45
- };
46
-
47
- /** @internal */
48
- export const CreatePostFailureResult$inboundSchema: z.ZodMiniType<
49
- CreatePostFailureResult,
50
- unknown
51
- > = z.object({
52
- status: types.literal("FAILURE"),
53
- idempotencyKey: types.string(),
54
- code: CreatePostFailureCode$inboundSchema,
55
- message: types.string(),
56
- validationErrors: z.array(ValidationError$inboundSchema),
57
- validationWarnings: z.array(ValidationWarning$inboundSchema),
58
- });
59
-
60
- export function createPostFailureResultFromJSON(
61
- jsonString: string,
62
- ): SafeParseResult<CreatePostFailureResult, SDKValidationError> {
63
- return safeParse(
64
- jsonString,
65
- (x) => CreatePostFailureResult$inboundSchema.parse(JSON.parse(x)),
66
- `Failed to parse 'CreatePostFailureResult' from JSON`,
67
- );
68
- }
@@ -1,73 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import {
7
- PlatformSpecifics,
8
- PlatformSpecifics$Outbound,
9
- PlatformSpecifics$outboundSchema,
10
- } from "./platform-specifics.js";
11
-
12
- export type CreatePostItem = {
13
- /**
14
- * Client-provided item idempotency key.
15
- */
16
- idempotencyKey: string;
17
- /**
18
- * Project identifier.
19
- */
20
- projectId: string;
21
- /**
22
- * Connected social account identifier.
23
- */
24
- socialAccountId: string;
25
- /**
26
- * UTC time when this post should be published.
27
- */
28
- scheduledForUTC: Date;
29
- title?: string | undefined;
30
- description?: string | undefined;
31
- firstComment?: string | undefined;
32
- /**
33
- * Media identifiers previously created via the external media upload flow.
34
- */
35
- mediaIds?: Array<string> | undefined;
36
- /**
37
- * Platform-specific publishing options. The `platform` value must match the publishing account's platform.
38
- */
39
- platformSpecifics: PlatformSpecifics;
40
- };
41
-
42
- /** @internal */
43
- export type CreatePostItem$Outbound = {
44
- idempotencyKey: string;
45
- projectId: string;
46
- socialAccountId: string;
47
- scheduledForUTC: string;
48
- title?: string | undefined;
49
- description?: string | undefined;
50
- firstComment?: string | undefined;
51
- mediaIds?: Array<string> | undefined;
52
- platformSpecifics: PlatformSpecifics$Outbound;
53
- };
54
-
55
- /** @internal */
56
- export const CreatePostItem$outboundSchema: z.ZodMiniType<
57
- CreatePostItem$Outbound,
58
- CreatePostItem
59
- > = z.object({
60
- idempotencyKey: z.string(),
61
- projectId: z.string(),
62
- socialAccountId: z.string(),
63
- scheduledForUTC: z.pipe(z.date(), z.transform(v => v.toISOString())),
64
- title: z.optional(z.string()),
65
- description: z.optional(z.string()),
66
- firstComment: z.optional(z.string()),
67
- mediaIds: z.optional(z.array(z.string())),
68
- platformSpecifics: PlatformSpecifics$outboundSchema,
69
- });
70
-
71
- export function createPostItemToJSON(createPostItem: CreatePostItem): string {
72
- return JSON.stringify(CreatePostItem$outboundSchema.parse(createPostItem));
73
- }
@@ -1,42 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import * as discriminatedUnionTypes from "../types/discriminated-union.js";
8
- import { discriminatedUnion } from "../types/discriminated-union.js";
9
- import { Result as SafeParseResult } from "../types/fp.js";
10
- import {
11
- CreatePostFailureResult,
12
- CreatePostFailureResult$inboundSchema,
13
- } from "./create-post-failure-result.js";
14
- import {
15
- CreatePostSuccessResult,
16
- CreatePostSuccessResult$inboundSchema,
17
- } from "./create-post-success-result.js";
18
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
19
-
20
- export type CreatePostResult =
21
- | CreatePostSuccessResult
22
- | CreatePostFailureResult
23
- | discriminatedUnionTypes.Unknown<"status">;
24
-
25
- /** @internal */
26
- export const CreatePostResult$inboundSchema: z.ZodMiniType<
27
- CreatePostResult,
28
- unknown
29
- > = discriminatedUnion("status", {
30
- SUCCESS: CreatePostSuccessResult$inboundSchema,
31
- FAILURE: CreatePostFailureResult$inboundSchema,
32
- });
33
-
34
- export function createPostResultFromJSON(
35
- jsonString: string,
36
- ): SafeParseResult<CreatePostResult, SDKValidationError> {
37
- return safeParse(
38
- jsonString,
39
- (x) => CreatePostResult$inboundSchema.parse(JSON.parse(x)),
40
- `Failed to parse 'CreatePostResult' from JSON`,
41
- );
42
- }
@@ -1,50 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../types/fp.js";
8
- import * as types from "../types/primitives.js";
9
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
10
- import {
11
- ValidationWarning,
12
- ValidationWarning$inboundSchema,
13
- } from "./validation-warning.js";
14
-
15
- export type CreatePostSuccessResult = {
16
- status: "SUCCESS";
17
- /**
18
- * Item idempotency key echoed from the request.
19
- */
20
- idempotencyKey: string;
21
- /**
22
- * Created post identifier.
23
- */
24
- id: string;
25
- /**
26
- * Structured validation warnings for this item. Empty when there are no warnings.
27
- */
28
- validationWarnings: Array<ValidationWarning>;
29
- };
30
-
31
- /** @internal */
32
- export const CreatePostSuccessResult$inboundSchema: z.ZodMiniType<
33
- CreatePostSuccessResult,
34
- unknown
35
- > = z.object({
36
- status: types.literal("SUCCESS"),
37
- idempotencyKey: types.string(),
38
- id: types.string(),
39
- validationWarnings: z.array(ValidationWarning$inboundSchema),
40
- });
41
-
42
- export function createPostSuccessResultFromJSON(
43
- jsonString: string,
44
- ): SafeParseResult<CreatePostSuccessResult, SDKValidationError> {
45
- return safeParse(
46
- jsonString,
47
- (x) => CreatePostSuccessResult$inboundSchema.parse(JSON.parse(x)),
48
- `Failed to parse 'CreatePostSuccessResult' from JSON`,
49
- );
50
- }
@@ -1,37 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../types/fp.js";
8
- import {
9
- CreatePostResult,
10
- CreatePostResult$inboundSchema,
11
- } from "./create-post-result.js";
12
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
13
-
14
- export type CreatePostsResponse = {
15
- /**
16
- * Results in the same order as the request items.
17
- */
18
- results: Array<CreatePostResult>;
19
- };
20
-
21
- /** @internal */
22
- export const CreatePostsResponse$inboundSchema: z.ZodMiniType<
23
- CreatePostsResponse,
24
- unknown
25
- > = z.object({
26
- results: z.array(CreatePostResult$inboundSchema),
27
- });
28
-
29
- export function createPostsResponseFromJSON(
30
- jsonString: string,
31
- ): SafeParseResult<CreatePostsResponse, SDKValidationError> {
32
- return safeParse(
33
- jsonString,
34
- (x) => CreatePostsResponse$inboundSchema.parse(JSON.parse(x)),
35
- `Failed to parse 'CreatePostsResponse' from JSON`,
36
- );
37
- }
@@ -1,44 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../types/fp.js";
8
- import * as types from "../types/primitives.js";
9
- import {
10
- DeletePostFailureCode,
11
- DeletePostFailureCode$inboundSchema,
12
- } from "./delete-post-failure-code.js";
13
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
14
-
15
- export type DeletePostFailureResult = {
16
- status: "FAILURE";
17
- /**
18
- * Post id echoed from the request.
19
- */
20
- id: string;
21
- code: DeletePostFailureCode;
22
- message: string;
23
- };
24
-
25
- /** @internal */
26
- export const DeletePostFailureResult$inboundSchema: z.ZodMiniType<
27
- DeletePostFailureResult,
28
- unknown
29
- > = z.object({
30
- status: types.literal("FAILURE"),
31
- id: types.string(),
32
- code: DeletePostFailureCode$inboundSchema,
33
- message: types.string(),
34
- });
35
-
36
- export function deletePostFailureResultFromJSON(
37
- jsonString: string,
38
- ): SafeParseResult<DeletePostFailureResult, SDKValidationError> {
39
- return safeParse(
40
- jsonString,
41
- (x) => DeletePostFailureResult$inboundSchema.parse(JSON.parse(x)),
42
- `Failed to parse 'DeletePostFailureResult' from JSON`,
43
- );
44
- }
@@ -1,42 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import * as discriminatedUnionTypes from "../types/discriminated-union.js";
8
- import { discriminatedUnion } from "../types/discriminated-union.js";
9
- import { Result as SafeParseResult } from "../types/fp.js";
10
- import {
11
- DeletePostFailureResult,
12
- DeletePostFailureResult$inboundSchema,
13
- } from "./delete-post-failure-result.js";
14
- import {
15
- DeletePostSuccessResult,
16
- DeletePostSuccessResult$inboundSchema,
17
- } from "./delete-post-success-result.js";
18
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
19
-
20
- export type DeletePostResult =
21
- | DeletePostSuccessResult
22
- | DeletePostFailureResult
23
- | discriminatedUnionTypes.Unknown<"status">;
24
-
25
- /** @internal */
26
- export const DeletePostResult$inboundSchema: z.ZodMiniType<
27
- DeletePostResult,
28
- unknown
29
- > = discriminatedUnion("status", {
30
- SUCCESS: DeletePostSuccessResult$inboundSchema,
31
- FAILURE: DeletePostFailureResult$inboundSchema,
32
- });
33
-
34
- export function deletePostResultFromJSON(
35
- jsonString: string,
36
- ): SafeParseResult<DeletePostResult, SDKValidationError> {
37
- return safeParse(
38
- jsonString,
39
- (x) => DeletePostResult$inboundSchema.parse(JSON.parse(x)),
40
- `Failed to parse 'DeletePostResult' from JSON`,
41
- );
42
- }
@@ -1,36 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../types/fp.js";
8
- import * as types from "../types/primitives.js";
9
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
10
-
11
- export type DeletePostSuccessResult = {
12
- status: "SUCCESS";
13
- /**
14
- * Post id echoed from the request.
15
- */
16
- id: string;
17
- };
18
-
19
- /** @internal */
20
- export const DeletePostSuccessResult$inboundSchema: z.ZodMiniType<
21
- DeletePostSuccessResult,
22
- unknown
23
- > = z.object({
24
- status: types.literal("SUCCESS"),
25
- id: types.string(),
26
- });
27
-
28
- export function deletePostSuccessResultFromJSON(
29
- jsonString: string,
30
- ): SafeParseResult<DeletePostSuccessResult, SDKValidationError> {
31
- return safeParse(
32
- jsonString,
33
- (x) => DeletePostSuccessResult$inboundSchema.parse(JSON.parse(x)),
34
- `Failed to parse 'DeletePostSuccessResult' from JSON`,
35
- );
36
- }