@postpeer/node 0.3.2

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 (462) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +201 -0
  3. package/README.md +363 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +190 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +190 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +474 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +470 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +75 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +75 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +86 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +80 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/package.json +143 -0
  279. package/resource.d.mts +2 -0
  280. package/resource.d.mts.map +1 -0
  281. package/resource.d.ts +2 -0
  282. package/resource.d.ts.map +1 -0
  283. package/resource.js +6 -0
  284. package/resource.js.map +1 -0
  285. package/resource.mjs +2 -0
  286. package/resource.mjs.map +1 -0
  287. package/resources/connect/connect.d.mts +26 -0
  288. package/resources/connect/connect.d.mts.map +1 -0
  289. package/resources/connect/connect.d.ts +26 -0
  290. package/resources/connect/connect.d.ts.map +1 -0
  291. package/resources/connect/connect.js +24 -0
  292. package/resources/connect/connect.js.map +1 -0
  293. package/resources/connect/connect.mjs +19 -0
  294. package/resources/connect/connect.mjs.map +1 -0
  295. package/resources/connect/index.d.mts +3 -0
  296. package/resources/connect/index.d.mts.map +1 -0
  297. package/resources/connect/index.d.ts +3 -0
  298. package/resources/connect/index.d.ts.map +1 -0
  299. package/resources/connect/index.js +9 -0
  300. package/resources/connect/index.js.map +1 -0
  301. package/resources/connect/index.mjs +4 -0
  302. package/resources/connect/index.mjs.map +1 -0
  303. package/resources/connect/integrations.d.mts +47 -0
  304. package/resources/connect/integrations.d.mts.map +1 -0
  305. package/resources/connect/integrations.d.ts +47 -0
  306. package/resources/connect/integrations.d.ts.map +1 -0
  307. package/resources/connect/integrations.js +22 -0
  308. package/resources/connect/integrations.js.map +1 -0
  309. package/resources/connect/integrations.mjs +18 -0
  310. package/resources/connect/integrations.mjs.map +1 -0
  311. package/resources/connect.d.mts +2 -0
  312. package/resources/connect.d.mts.map +1 -0
  313. package/resources/connect.d.ts +2 -0
  314. package/resources/connect.d.ts.map +1 -0
  315. package/resources/connect.js +6 -0
  316. package/resources/connect.js.map +1 -0
  317. package/resources/connect.mjs +3 -0
  318. package/resources/connect.mjs.map +1 -0
  319. package/resources/health.d.mts +23 -0
  320. package/resources/health.d.mts.map +1 -0
  321. package/resources/health.d.ts +23 -0
  322. package/resources/health.d.ts.map +1 -0
  323. package/resources/health.js +21 -0
  324. package/resources/health.js.map +1 -0
  325. package/resources/health.mjs +17 -0
  326. package/resources/health.mjs.map +1 -0
  327. package/resources/index.d.mts +6 -0
  328. package/resources/index.d.mts.map +1 -0
  329. package/resources/index.d.ts +6 -0
  330. package/resources/index.d.ts.map +1 -0
  331. package/resources/index.js +15 -0
  332. package/resources/index.js.map +1 -0
  333. package/resources/index.mjs +7 -0
  334. package/resources/index.mjs.map +1 -0
  335. package/resources/media.d.mts +27 -0
  336. package/resources/media.d.mts.map +1 -0
  337. package/resources/media.d.ts +27 -0
  338. package/resources/media.d.ts.map +1 -0
  339. package/resources/media.js +15 -0
  340. package/resources/media.js.map +1 -0
  341. package/resources/media.mjs +11 -0
  342. package/resources/media.mjs.map +1 -0
  343. package/resources/platforms.d.mts +22 -0
  344. package/resources/platforms.d.mts.map +1 -0
  345. package/resources/platforms.d.ts +22 -0
  346. package/resources/platforms.d.ts.map +1 -0
  347. package/resources/platforms.js +15 -0
  348. package/resources/platforms.js.map +1 -0
  349. package/resources/platforms.mjs +11 -0
  350. package/resources/platforms.mjs.map +1 -0
  351. package/resources/posts/index.d.mts +3 -0
  352. package/resources/posts/index.d.mts.map +1 -0
  353. package/resources/posts/index.d.ts +3 -0
  354. package/resources/posts/index.d.ts.map +1 -0
  355. package/resources/posts/index.js +9 -0
  356. package/resources/posts/index.js.map +1 -0
  357. package/resources/posts/index.mjs +4 -0
  358. package/resources/posts/index.mjs.map +1 -0
  359. package/resources/posts/posts.d.mts +437 -0
  360. package/resources/posts/posts.d.mts.map +1 -0
  361. package/resources/posts/posts.d.ts +437 -0
  362. package/resources/posts/posts.d.ts.map +1 -0
  363. package/resources/posts/posts.js +69 -0
  364. package/resources/posts/posts.js.map +1 -0
  365. package/resources/posts/posts.mjs +64 -0
  366. package/resources/posts/posts.mjs.map +1 -0
  367. package/resources/posts/scheduled.d.mts +111 -0
  368. package/resources/posts/scheduled.d.mts.map +1 -0
  369. package/resources/posts/scheduled.d.ts +111 -0
  370. package/resources/posts/scheduled.d.ts.map +1 -0
  371. package/resources/posts/scheduled.js +48 -0
  372. package/resources/posts/scheduled.js.map +1 -0
  373. package/resources/posts/scheduled.mjs +44 -0
  374. package/resources/posts/scheduled.mjs.map +1 -0
  375. package/resources/posts.d.mts +2 -0
  376. package/resources/posts.d.mts.map +1 -0
  377. package/resources/posts.d.ts +2 -0
  378. package/resources/posts.d.ts.map +1 -0
  379. package/resources/posts.js +6 -0
  380. package/resources/posts.js.map +1 -0
  381. package/resources/posts.mjs +3 -0
  382. package/resources/posts.mjs.map +1 -0
  383. package/resources.d.mts +2 -0
  384. package/resources.d.mts.map +1 -0
  385. package/resources.d.ts +2 -0
  386. package/resources.d.ts.map +1 -0
  387. package/resources.js +5 -0
  388. package/resources.js.map +1 -0
  389. package/resources.mjs +2 -0
  390. package/resources.mjs.map +1 -0
  391. package/src/api-promise.ts +2 -0
  392. package/src/client.ts +779 -0
  393. package/src/core/README.md +3 -0
  394. package/src/core/api-promise.ts +92 -0
  395. package/src/core/error.ts +130 -0
  396. package/src/core/resource.ts +11 -0
  397. package/src/core/uploads.ts +2 -0
  398. package/src/error.ts +2 -0
  399. package/src/index.ts +22 -0
  400. package/src/internal/README.md +3 -0
  401. package/src/internal/builtin-types.ts +93 -0
  402. package/src/internal/detect-platform.ts +196 -0
  403. package/src/internal/errors.ts +33 -0
  404. package/src/internal/headers.ts +97 -0
  405. package/src/internal/parse.ts +56 -0
  406. package/src/internal/qs/LICENSE.md +13 -0
  407. package/src/internal/qs/README.md +3 -0
  408. package/src/internal/qs/formats.ts +10 -0
  409. package/src/internal/qs/index.ts +13 -0
  410. package/src/internal/qs/stringify.ts +385 -0
  411. package/src/internal/qs/types.ts +71 -0
  412. package/src/internal/qs/utils.ts +265 -0
  413. package/src/internal/request-options.ts +91 -0
  414. package/src/internal/shim-types.ts +26 -0
  415. package/src/internal/shims.ts +107 -0
  416. package/src/internal/to-file.ts +154 -0
  417. package/src/internal/types.ts +95 -0
  418. package/src/internal/uploads.ts +187 -0
  419. package/src/internal/utils/base64.ts +40 -0
  420. package/src/internal/utils/bytes.ts +32 -0
  421. package/src/internal/utils/env.ts +18 -0
  422. package/src/internal/utils/log.ts +127 -0
  423. package/src/internal/utils/path.ts +88 -0
  424. package/src/internal/utils/query.ts +7 -0
  425. package/src/internal/utils/sleep.ts +3 -0
  426. package/src/internal/utils/uuid.ts +17 -0
  427. package/src/internal/utils/values.ts +105 -0
  428. package/src/internal/utils.ts +9 -0
  429. package/src/lib/.keep +4 -0
  430. package/src/resource.ts +2 -0
  431. package/src/resources/connect/connect.ts +49 -0
  432. package/src/resources/connect/index.ts +8 -0
  433. package/src/resources/connect/integrations.ts +69 -0
  434. package/src/resources/connect.ts +3 -0
  435. package/src/resources/health.ts +36 -0
  436. package/src/resources/index.ts +17 -0
  437. package/src/resources/media.ts +38 -0
  438. package/src/resources/platforms.ts +30 -0
  439. package/src/resources/posts/index.ts +20 -0
  440. package/src/resources/posts/posts.ts +582 -0
  441. package/src/resources/posts/scheduled.ts +153 -0
  442. package/src/resources/posts.ts +3 -0
  443. package/src/resources.ts +1 -0
  444. package/src/tsconfig.json +11 -0
  445. package/src/uploads.ts +2 -0
  446. package/src/version.ts +1 -0
  447. package/uploads.d.mts +2 -0
  448. package/uploads.d.mts.map +1 -0
  449. package/uploads.d.ts +2 -0
  450. package/uploads.d.ts.map +1 -0
  451. package/uploads.js +6 -0
  452. package/uploads.js.map +1 -0
  453. package/uploads.mjs +2 -0
  454. package/uploads.mjs.map +1 -0
  455. package/version.d.mts +2 -0
  456. package/version.d.mts.map +1 -0
  457. package/version.d.ts +2 -0
  458. package/version.d.ts.map +1 -0
  459. package/version.js +5 -0
  460. package/version.js.map +1 -0
  461. package/version.mjs +2 -0
  462. package/version.mjs.map +1 -0
@@ -0,0 +1,582 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as PostsAPI from './posts';
5
+ import * as ScheduledAPI from './scheduled';
6
+ import {
7
+ Scheduled,
8
+ ScheduledCancelResponse,
9
+ ScheduledListResponse,
10
+ ScheduledRescheduleParams,
11
+ ScheduledRescheduleResponse,
12
+ } from './scheduled';
13
+ import { APIPromise } from '../../core/api-promise';
14
+ import { RequestOptions } from '../../internal/request-options';
15
+ import { path } from '../../internal/utils/path';
16
+
17
+ export class Posts extends APIResource {
18
+ scheduled: ScheduledAPI.Scheduled = new ScheduledAPI.Scheduled(this._client);
19
+
20
+ /**
21
+ * Publish a post to one or more social media platforms
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const post = await client.posts.create({
26
+ * content: 'Hello world!',
27
+ * platforms: [
28
+ * { platform: 'twitter', accountId: '<your-account-id>' },
29
+ * ],
30
+ * publishNow: true,
31
+ * });
32
+ * ```
33
+ */
34
+ create(body: PostCreateParams, options?: RequestOptions): APIPromise<PostCreateResponse> {
35
+ return this._client.post('/v1/posts/', { body, ...options });
36
+ }
37
+
38
+ /**
39
+ * Get a single post by ID
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const post = await client.posts.retrieve('postId');
44
+ * ```
45
+ */
46
+ retrieve(postID: string, options?: RequestOptions): APIPromise<PostRetrieveResponse> {
47
+ return this._client.get(path`/v1/posts/${postID}`, options);
48
+ }
49
+
50
+ /**
51
+ * Returns a paginated list of posts. Filter by status, platform (OR logic), and
52
+ * date ranges. Published posts include platformPostUrl per platform.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const posts = await client.posts.list();
57
+ * ```
58
+ */
59
+ list(
60
+ query: PostListParams | null | undefined = {},
61
+ options?: RequestOptions,
62
+ ): APIPromise<PostListResponse> {
63
+ return this._client.get('/v1/posts/', { query, ...options });
64
+ }
65
+
66
+ /**
67
+ * Delete a post by ID
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const post = await client.posts.delete('postId');
72
+ * ```
73
+ */
74
+ delete(postID: string, options?: RequestOptions): APIPromise<PostDeleteResponse> {
75
+ return this._client.delete(path`/v1/posts/${postID}`, options);
76
+ }
77
+ }
78
+
79
+ export interface PostSummary {
80
+ content: string;
81
+
82
+ createdAt: string;
83
+
84
+ crosspostingEnabled: boolean;
85
+
86
+ mediaItems: Array<PostSummary.MediaItem>;
87
+
88
+ platforms: Array<PostSummary.Platform>;
89
+
90
+ /**
91
+ * MongoDB ObjectId of the Post document
92
+ */
93
+ postId: string;
94
+
95
+ rawRequestBody: { [key: string]: unknown };
96
+
97
+ /**
98
+ * ISO 8601 scheduled datetime
99
+ */
100
+ scheduledFor: string | null;
101
+
102
+ status: Status;
103
+
104
+ timezone: string;
105
+
106
+ updatedAt: string;
107
+ }
108
+
109
+ export namespace PostSummary {
110
+ export interface MediaItem {
111
+ filename: string;
112
+
113
+ mimeType: string;
114
+
115
+ size: number;
116
+
117
+ type: 'image' | 'video' | 'gif';
118
+
119
+ url: string;
120
+ }
121
+
122
+ export interface Platform {
123
+ errorMessage: string | null;
124
+
125
+ platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin';
126
+
127
+ platformPostId: string | null;
128
+
129
+ /**
130
+ * Direct URL to the published post
131
+ */
132
+ platformPostUrl: string | null;
133
+
134
+ publishedAt: string | null;
135
+
136
+ status: PostsAPI.Status;
137
+ }
138
+ }
139
+
140
+ export type Status = 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
141
+
142
+ export interface PostCreateResponse {
143
+ platforms: Array<PostCreateResponse.Platform>;
144
+
145
+ /**
146
+ * id of the saved Post document
147
+ */
148
+ postId: string;
149
+
150
+ status: Status;
151
+
152
+ /**
153
+ * false only when every platform failed
154
+ */
155
+ success: boolean;
156
+
157
+ /**
158
+ * ISO 8601 datetime the post is scheduled for (only present for scheduled posts)
159
+ */
160
+ scheduledFor?: string;
161
+ }
162
+
163
+ export namespace PostCreateResponse {
164
+ export interface Platform {
165
+ platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin';
166
+
167
+ success: boolean;
168
+
169
+ /**
170
+ * Error message when success is false
171
+ */
172
+ error?: string;
173
+
174
+ /**
175
+ * Direct URL to the published post
176
+ */
177
+ platformPostUrl?: string;
178
+ }
179
+ }
180
+
181
+ export interface PostRetrieveResponse {
182
+ post: PostSummary;
183
+
184
+ success: boolean;
185
+ }
186
+
187
+ export interface PostListResponse {
188
+ posts: Array<PostSummary>;
189
+
190
+ success: boolean;
191
+
192
+ /**
193
+ * Total matched posts across all pages
194
+ */
195
+ total: number;
196
+ }
197
+
198
+ export interface PostDeleteResponse {
199
+ success: boolean;
200
+ }
201
+
202
+ export interface PostCreateParams {
203
+ /**
204
+ * Post text body
205
+ */
206
+ content: string;
207
+
208
+ /**
209
+ * Target platform accounts to publish to
210
+ */
211
+ platforms: Array<PostCreateParams.Platform>;
212
+
213
+ /**
214
+ * Media attachments (images, videos, GIFs)
215
+ */
216
+ mediaItems?: Array<PostCreateParams.MediaItem>;
217
+
218
+ /**
219
+ * Publish immediately. Required when scheduledFor is omitted.
220
+ */
221
+ publishNow?: boolean;
222
+
223
+ /**
224
+ * ISO 8601 datetime to schedule the post for future publishing
225
+ */
226
+ scheduledFor?: string;
227
+
228
+ /**
229
+ * IANA timezone for the scheduled time (e.g. America/New_York). Defaults to UTC.
230
+ */
231
+ timezone?: string;
232
+ }
233
+
234
+ export namespace PostCreateParams {
235
+ export interface Platform {
236
+ /**
237
+ * Integration.\_id — find yours via GET /connect/integrations
238
+ */
239
+ accountId: string;
240
+
241
+ platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin';
242
+
243
+ /**
244
+ * Platform-specific options. See TwitterConfigurations, YouTubeConfigurations,
245
+ * TikTokConfigurations, PinterestConfigurations, or LinkedInConfigurations
246
+ * depending on the target platform.
247
+ */
248
+ platformSpecificData?:
249
+ | Platform.TwitterConfigurations
250
+ | Platform.YouTubeConfigurations
251
+ | Platform.TikTokConfigurations
252
+ | Platform.PinterestConfigurations
253
+ | Platform.LinkedInConfigurations;
254
+ }
255
+
256
+ export namespace Platform {
257
+ /**
258
+ * Pass this object in platformSpecificData when posting to Twitter/X, including
259
+ * Community post options.
260
+ */
261
+ export interface TwitterConfigurations {
262
+ /**
263
+ * Community ID to publish this post into.
264
+ */
265
+ communityId?: string;
266
+
267
+ /**
268
+ * Cannot be combined with media or threadItems.
269
+ */
270
+ poll?: TwitterConfigurations.Poll;
271
+
272
+ /**
273
+ * Who can reply to this tweet.
274
+ */
275
+ replySettings?: 'following' | 'mentionedUsers' | 'subscribers' | 'verified';
276
+
277
+ /**
278
+ * Tweet ID to reply to.
279
+ */
280
+ replyToTweetId?: string;
281
+
282
+ /**
283
+ * When posting to a Community, also share the post with followers.
284
+ */
285
+ shareWithFollowers?: boolean;
286
+
287
+ /**
288
+ * Additional tweets to chain as a thread. The root tweet uses post.content.
289
+ */
290
+ threadItems?: Array<TwitterConfigurations.ThreadItem>;
291
+ }
292
+
293
+ export namespace TwitterConfigurations {
294
+ /**
295
+ * Cannot be combined with media or threadItems.
296
+ */
297
+ export interface Poll {
298
+ /**
299
+ * Poll duration in minutes (5 min – 7 days).
300
+ */
301
+ duration_minutes: number;
302
+
303
+ /**
304
+ * 2–4 poll options.
305
+ */
306
+ options: Array<string>;
307
+ }
308
+
309
+ export interface ThreadItem {
310
+ /**
311
+ * Text of this thread tweet (max 280 chars)
312
+ */
313
+ content: string;
314
+
315
+ mediaItems?: Array<ThreadItem.MediaItem>;
316
+ }
317
+
318
+ export namespace ThreadItem {
319
+ export interface MediaItem {
320
+ type: 'image' | 'video' | 'gif';
321
+
322
+ url: string;
323
+ }
324
+ }
325
+ }
326
+
327
+ /**
328
+ * Pass this object in platformSpecificData when posting to YouTube.
329
+ */
330
+ export interface YouTubeConfigurations {
331
+ /**
332
+ * YouTube category ID. Defaults to "22" (People & Blogs). Common values: "1" Film
333
+ * & Animation, "10" Music, "20" Gaming, "22" People & Blogs, "27" Education, "28"
334
+ * Science & Technology.
335
+ */
336
+ categoryId?: string;
337
+
338
+ /**
339
+ * AI-generated content disclosure. YouTube is increasingly enforcing this
340
+ * requirement. Defaults to false.
341
+ */
342
+ containsSyntheticMedia?: boolean;
343
+
344
+ /**
345
+ * Auto-posted comment after the video goes live. Max 10,000 characters. For
346
+ * publishNow posts: posted immediately after upload. For scheduled posts: posted
347
+ * when the video becomes public.
348
+ */
349
+ firstComment?: string;
350
+
351
+ /**
352
+ * COPPA compliance flag. Setting to true permanently disables comments,
353
+ * notification bell, personalized ads, end screens, and cards on the video.
354
+ * Defaults to false.
355
+ */
356
+ madeForKids?: boolean;
357
+
358
+ /**
359
+ * Video tags. Total characters across all tags must be ≤500.
360
+ */
361
+ tags?: Array<string>;
362
+
363
+ /**
364
+ * Video title (max 100 chars, no < or >). Defaults to first 100 chars of content,
365
+ * or "Untitled Video".
366
+ */
367
+ title?: string;
368
+
369
+ /**
370
+ * Who can see the video. Defaults to "public". Scheduled posts upload as private
371
+ * and flip to this value at publish time.
372
+ */
373
+ visibility?: 'public' | 'private' | 'unlisted';
374
+ }
375
+
376
+ /**
377
+ * Pass this object in platformSpecificData when posting to TikTok.
378
+ */
379
+ export interface TikTokConfigurations {
380
+ /**
381
+ * Automatically add background music to photo carousels. Photo posts only.
382
+ * Defaults to true.
383
+ */
384
+ auto_add_music?: boolean;
385
+
386
+ /**
387
+ * Mark as branded content (paid partnership). Defaults to false.
388
+ */
389
+ brand_content_toggle?: boolean;
390
+
391
+ /**
392
+ * Mark as organic brand promotion. Defaults to false.
393
+ */
394
+ brand_organic_toggle?: boolean;
395
+
396
+ /**
397
+ * Disable comments on this post. Defaults to false.
398
+ */
399
+ disable_comment?: boolean;
400
+
401
+ /**
402
+ * Disable duet for this video. Videos only. Defaults to false.
403
+ */
404
+ disable_duet?: boolean;
405
+
406
+ /**
407
+ * Disable stitch for this video. Videos only. Defaults to false.
408
+ */
409
+ disable_stitch?: boolean;
410
+
411
+ /**
412
+ * When true (default), sends content to the creator's TikTok inbox as a draft. Set
413
+ * to false to publish immediately (requires an audited app).
414
+ */
415
+ draft?: boolean;
416
+
417
+ /**
418
+ * AI-generated content disclosure. Defaults to false.
419
+ */
420
+ is_aigc?: boolean;
421
+
422
+ /**
423
+ * 0-indexed position of the cover image in a photo carousel. Photo posts only.
424
+ * Defaults to 0.
425
+ */
426
+ photo_cover_index?: number;
427
+
428
+ /**
429
+ * Who can see this post. Defaults to "SELF_ONLY" (required for unreviewed apps).
430
+ * Upgrade to PUBLIC_TO_EVERYONE after TikTok app review.
431
+ */
432
+ privacy_level?: 'PUBLIC_TO_EVERYONE' | 'MUTUAL_FOLLOW_FRIENDS' | 'FOLLOWER_OF_CREATOR' | 'SELF_ONLY';
433
+
434
+ /**
435
+ * Timestamp in milliseconds to use as the video cover frame. Videos only. Defaults
436
+ * to 1000ms.
437
+ */
438
+ video_cover_timestamp_ms?: number;
439
+ }
440
+
441
+ /**
442
+ * Pass this object in platformSpecificData when posting to Pinterest.
443
+ */
444
+ export interface PinterestConfigurations {
445
+ /**
446
+ * Target board ID. Retrieve available boards via GET /connect/pinterest/boards.
447
+ */
448
+ boardId: string;
449
+
450
+ /**
451
+ * Accessible image description. Max 500 characters.
452
+ */
453
+ altText?: string;
454
+
455
+ /**
456
+ * Custom cover image URL for video pins.
457
+ */
458
+ coverImageUrl?: string;
459
+
460
+ /**
461
+ * Hex color for the loading placeholder (e.g. "#6E7874").
462
+ */
463
+ dominantColor?: string;
464
+
465
+ /**
466
+ * HTTPS destination URL when the pin is clicked. Important for driving traffic.
467
+ */
468
+ link?: string;
469
+
470
+ /**
471
+ * Pin title. Max 100 characters. Defaults to first line of content.
472
+ */
473
+ title?: string;
474
+ }
475
+
476
+ /**
477
+ * Pass this object in platformSpecificData when posting to LinkedIn.
478
+ */
479
+ export interface LinkedInConfigurations {
480
+ /**
481
+ * Description for the article preview card. Max 400 characters.
482
+ */
483
+ article_description?: string;
484
+
485
+ /**
486
+ * Title for the article preview card. Max 400 characters.
487
+ */
488
+ article_title?: string;
489
+
490
+ /**
491
+ * URL for an article/link post. When provided, the post becomes a link share with
492
+ * a preview card.
493
+ */
494
+ article_url?: string;
495
+
496
+ /**
497
+ * Post visibility. "PUBLIC" = visible to everyone, "CONNECTIONS" = visible to
498
+ * connections only. Defaults to "PUBLIC".
499
+ */
500
+ visibility?: 'PUBLIC' | 'CONNECTIONS';
501
+ }
502
+ }
503
+
504
+ export interface MediaItem {
505
+ type: 'image' | 'video' | 'gif';
506
+
507
+ url: string;
508
+
509
+ /**
510
+ * Thumbnail image URL for video items. Supported on YouTube regular videos (not
511
+ * Shorts). JPEG, PNG, or GIF, max 2 MB, min 640 px wide.
512
+ */
513
+ thumbnail?: string;
514
+ }
515
+ }
516
+
517
+ export interface PostListParams {
518
+ /**
519
+ * ISO 8601 lower bound on createdAt
520
+ */
521
+ createdAfter?: string;
522
+
523
+ /**
524
+ * ISO 8601 upper bound on createdAt
525
+ */
526
+ createdBefore?: string;
527
+
528
+ /**
529
+ * Page size (max 100)
530
+ */
531
+ limit?: number;
532
+
533
+ /**
534
+ * Number of posts to skip
535
+ */
536
+ offset?: number;
537
+
538
+ /**
539
+ * Filter by platform (repeatable — OR logic)
540
+ */
541
+ platform?: Array<'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin'>;
542
+
543
+ /**
544
+ * ISO 8601 lower bound on scheduledFor
545
+ */
546
+ scheduledAfter?: string;
547
+
548
+ /**
549
+ * ISO 8601 upper bound on scheduledFor
550
+ */
551
+ scheduledBefore?: string;
552
+
553
+ /**
554
+ * Sort direction by createdAt
555
+ */
556
+ sort?: 'asc' | 'desc';
557
+
558
+ status?: Status;
559
+ }
560
+
561
+ Posts.Scheduled = Scheduled;
562
+
563
+ export declare namespace Posts {
564
+ export {
565
+ type PostSummary as PostSummary,
566
+ type Status as Status,
567
+ type PostCreateResponse as PostCreateResponse,
568
+ type PostRetrieveResponse as PostRetrieveResponse,
569
+ type PostListResponse as PostListResponse,
570
+ type PostDeleteResponse as PostDeleteResponse,
571
+ type PostCreateParams as PostCreateParams,
572
+ type PostListParams as PostListParams,
573
+ };
574
+
575
+ export {
576
+ Scheduled as Scheduled,
577
+ type ScheduledListResponse as ScheduledListResponse,
578
+ type ScheduledCancelResponse as ScheduledCancelResponse,
579
+ type ScheduledRescheduleResponse as ScheduledRescheduleResponse,
580
+ type ScheduledRescheduleParams as ScheduledRescheduleParams,
581
+ };
582
+ }