@postpeer/node 0.7.0 → 0.8.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 (468) hide show
  1. package/CHANGELOG.md +7 -128
  2. package/LICENSE +1 -1
  3. package/README.md +92 -314
  4. package/dist/index.cjs +1709 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +3484 -0
  7. package/dist/index.d.ts +3484 -0
  8. package/dist/index.js +1690 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +58 -131
  11. package/api-promise.d.mts +0 -3
  12. package/api-promise.d.mts.map +0 -1
  13. package/api-promise.d.ts +0 -3
  14. package/api-promise.d.ts.map +0 -1
  15. package/api-promise.js +0 -6
  16. package/api-promise.js.map +0 -1
  17. package/api-promise.mjs +0 -3
  18. package/api-promise.mjs.map +0 -1
  19. package/client.d.mts +0 -190
  20. package/client.d.mts.map +0 -1
  21. package/client.d.ts +0 -190
  22. package/client.d.ts.map +0 -1
  23. package/client.js +0 -485
  24. package/client.js.map +0 -1
  25. package/client.mjs +0 -481
  26. package/client.mjs.map +0 -1
  27. package/core/api-promise.d.mts +0 -46
  28. package/core/api-promise.d.mts.map +0 -1
  29. package/core/api-promise.d.ts +0 -46
  30. package/core/api-promise.d.ts.map +0 -1
  31. package/core/api-promise.js +0 -74
  32. package/core/api-promise.js.map +0 -1
  33. package/core/api-promise.mjs +0 -70
  34. package/core/api-promise.mjs.map +0 -1
  35. package/core/error.d.mts +0 -46
  36. package/core/error.d.mts.map +0 -1
  37. package/core/error.d.ts +0 -46
  38. package/core/error.d.ts.map +0 -1
  39. package/core/error.js +0 -113
  40. package/core/error.js.map +0 -1
  41. package/core/error.mjs +0 -97
  42. package/core/error.mjs.map +0 -1
  43. package/core/resource.d.mts +0 -6
  44. package/core/resource.d.mts.map +0 -1
  45. package/core/resource.d.ts +0 -6
  46. package/core/resource.d.ts.map +0 -1
  47. package/core/resource.js +0 -11
  48. package/core/resource.js.map +0 -1
  49. package/core/resource.mjs +0 -7
  50. package/core/resource.mjs.map +0 -1
  51. package/core/uploads.d.mts +0 -3
  52. package/core/uploads.d.mts.map +0 -1
  53. package/core/uploads.d.ts +0 -3
  54. package/core/uploads.d.ts.map +0 -1
  55. package/core/uploads.js +0 -6
  56. package/core/uploads.js.map +0 -1
  57. package/core/uploads.mjs +0 -2
  58. package/core/uploads.mjs.map +0 -1
  59. package/error.d.mts +0 -3
  60. package/error.d.mts.map +0 -1
  61. package/error.d.ts +0 -3
  62. package/error.d.ts.map +0 -1
  63. package/error.js +0 -6
  64. package/error.js.map +0 -1
  65. package/error.mjs +0 -3
  66. package/error.mjs.map +0 -1
  67. package/index.d.mts +0 -6
  68. package/index.d.mts.map +0 -1
  69. package/index.d.ts +0 -6
  70. package/index.d.ts.map +0 -1
  71. package/index.js +0 -30
  72. package/index.js.map +0 -1
  73. package/index.mjs +0 -7
  74. package/index.mjs.map +0 -1
  75. package/internal/builtin-types.d.mts +0 -73
  76. package/internal/builtin-types.d.mts.map +0 -1
  77. package/internal/builtin-types.d.ts +0 -73
  78. package/internal/builtin-types.d.ts.map +0 -1
  79. package/internal/builtin-types.js +0 -4
  80. package/internal/builtin-types.js.map +0 -1
  81. package/internal/builtin-types.mjs +0 -3
  82. package/internal/builtin-types.mjs.map +0 -1
  83. package/internal/detect-platform.d.mts +0 -15
  84. package/internal/detect-platform.d.mts.map +0 -1
  85. package/internal/detect-platform.d.ts +0 -15
  86. package/internal/detect-platform.d.ts.map +0 -1
  87. package/internal/detect-platform.js +0 -162
  88. package/internal/detect-platform.js.map +0 -1
  89. package/internal/detect-platform.mjs +0 -157
  90. package/internal/detect-platform.mjs.map +0 -1
  91. package/internal/errors.d.mts +0 -3
  92. package/internal/errors.d.mts.map +0 -1
  93. package/internal/errors.d.ts +0 -3
  94. package/internal/errors.d.ts.map +0 -1
  95. package/internal/errors.js +0 -41
  96. package/internal/errors.js.map +0 -1
  97. package/internal/errors.mjs +0 -36
  98. package/internal/errors.mjs.map +0 -1
  99. package/internal/headers.d.mts +0 -20
  100. package/internal/headers.d.mts.map +0 -1
  101. package/internal/headers.d.ts +0 -20
  102. package/internal/headers.d.ts.map +0 -1
  103. package/internal/headers.js +0 -79
  104. package/internal/headers.js.map +0 -1
  105. package/internal/headers.mjs +0 -74
  106. package/internal/headers.mjs.map +0 -1
  107. package/internal/parse.d.mts +0 -12
  108. package/internal/parse.d.mts.map +0 -1
  109. package/internal/parse.d.ts +0 -12
  110. package/internal/parse.d.ts.map +0 -1
  111. package/internal/parse.js +0 -40
  112. package/internal/parse.js.map +0 -1
  113. package/internal/parse.mjs +0 -37
  114. package/internal/parse.mjs.map +0 -1
  115. package/internal/qs/formats.d.mts +0 -7
  116. package/internal/qs/formats.d.mts.map +0 -1
  117. package/internal/qs/formats.d.ts +0 -7
  118. package/internal/qs/formats.d.ts.map +0 -1
  119. package/internal/qs/formats.js +0 -13
  120. package/internal/qs/formats.js.map +0 -1
  121. package/internal/qs/formats.mjs +0 -9
  122. package/internal/qs/formats.mjs.map +0 -1
  123. package/internal/qs/index.d.mts +0 -10
  124. package/internal/qs/index.d.mts.map +0 -1
  125. package/internal/qs/index.d.ts +0 -10
  126. package/internal/qs/index.d.ts.map +0 -1
  127. package/internal/qs/index.js +0 -14
  128. package/internal/qs/index.js.map +0 -1
  129. package/internal/qs/index.mjs +0 -10
  130. package/internal/qs/index.mjs.map +0 -1
  131. package/internal/qs/stringify.d.mts +0 -3
  132. package/internal/qs/stringify.d.mts.map +0 -1
  133. package/internal/qs/stringify.d.ts +0 -3
  134. package/internal/qs/stringify.d.ts.map +0 -1
  135. package/internal/qs/stringify.js +0 -277
  136. package/internal/qs/stringify.js.map +0 -1
  137. package/internal/qs/stringify.mjs +0 -274
  138. package/internal/qs/stringify.mjs.map +0 -1
  139. package/internal/qs/types.d.mts +0 -57
  140. package/internal/qs/types.d.mts.map +0 -1
  141. package/internal/qs/types.d.ts +0 -57
  142. package/internal/qs/types.d.ts.map +0 -1
  143. package/internal/qs/types.js +0 -3
  144. package/internal/qs/types.js.map +0 -1
  145. package/internal/qs/types.mjs +0 -2
  146. package/internal/qs/types.mjs.map +0 -1
  147. package/internal/qs/utils.d.mts +0 -15
  148. package/internal/qs/utils.d.mts.map +0 -1
  149. package/internal/qs/utils.d.ts +0 -15
  150. package/internal/qs/utils.d.ts.map +0 -1
  151. package/internal/qs/utils.js +0 -230
  152. package/internal/qs/utils.js.map +0 -1
  153. package/internal/qs/utils.mjs +0 -217
  154. package/internal/qs/utils.mjs.map +0 -1
  155. package/internal/request-options.d.mts +0 -75
  156. package/internal/request-options.d.mts.map +0 -1
  157. package/internal/request-options.d.ts +0 -75
  158. package/internal/request-options.d.ts.map +0 -1
  159. package/internal/request-options.js +0 -14
  160. package/internal/request-options.js.map +0 -1
  161. package/internal/request-options.mjs +0 -10
  162. package/internal/request-options.mjs.map +0 -1
  163. package/internal/shim-types.d.mts +0 -17
  164. package/internal/shim-types.d.mts.map +0 -1
  165. package/internal/shim-types.d.ts +0 -17
  166. package/internal/shim-types.d.ts.map +0 -1
  167. package/internal/shim-types.js +0 -4
  168. package/internal/shim-types.js.map +0 -1
  169. package/internal/shim-types.mjs +0 -3
  170. package/internal/shim-types.mjs.map +0 -1
  171. package/internal/shims.d.mts +0 -26
  172. package/internal/shims.d.mts.map +0 -1
  173. package/internal/shims.d.ts +0 -26
  174. package/internal/shims.d.ts.map +0 -1
  175. package/internal/shims.js +0 -92
  176. package/internal/shims.js.map +0 -1
  177. package/internal/shims.mjs +0 -85
  178. package/internal/shims.mjs.map +0 -1
  179. package/internal/to-file.d.mts +0 -45
  180. package/internal/to-file.d.mts.map +0 -1
  181. package/internal/to-file.d.ts +0 -45
  182. package/internal/to-file.d.ts.map +0 -1
  183. package/internal/to-file.js +0 -91
  184. package/internal/to-file.js.map +0 -1
  185. package/internal/to-file.mjs +0 -88
  186. package/internal/to-file.mjs.map +0 -1
  187. package/internal/tslib.js +0 -81
  188. package/internal/tslib.mjs +0 -17
  189. package/internal/types.d.mts +0 -69
  190. package/internal/types.d.mts.map +0 -1
  191. package/internal/types.d.ts +0 -69
  192. package/internal/types.d.ts.map +0 -1
  193. package/internal/types.js +0 -4
  194. package/internal/types.js.map +0 -1
  195. package/internal/types.mjs +0 -3
  196. package/internal/types.mjs.map +0 -1
  197. package/internal/uploads.d.mts +0 -42
  198. package/internal/uploads.d.mts.map +0 -1
  199. package/internal/uploads.d.ts +0 -42
  200. package/internal/uploads.d.ts.map +0 -1
  201. package/internal/uploads.js +0 -141
  202. package/internal/uploads.js.map +0 -1
  203. package/internal/uploads.mjs +0 -131
  204. package/internal/uploads.mjs.map +0 -1
  205. package/internal/utils/base64.d.mts +0 -3
  206. package/internal/utils/base64.d.mts.map +0 -1
  207. package/internal/utils/base64.d.ts +0 -3
  208. package/internal/utils/base64.d.ts.map +0 -1
  209. package/internal/utils/base64.js +0 -38
  210. package/internal/utils/base64.js.map +0 -1
  211. package/internal/utils/base64.mjs +0 -33
  212. package/internal/utils/base64.mjs.map +0 -1
  213. package/internal/utils/bytes.d.mts +0 -4
  214. package/internal/utils/bytes.d.mts.map +0 -1
  215. package/internal/utils/bytes.d.ts +0 -4
  216. package/internal/utils/bytes.d.ts.map +0 -1
  217. package/internal/utils/bytes.js +0 -31
  218. package/internal/utils/bytes.js.map +0 -1
  219. package/internal/utils/bytes.mjs +0 -26
  220. package/internal/utils/bytes.mjs.map +0 -1
  221. package/internal/utils/env.d.mts +0 -9
  222. package/internal/utils/env.d.mts.map +0 -1
  223. package/internal/utils/env.d.ts +0 -9
  224. package/internal/utils/env.d.ts.map +0 -1
  225. package/internal/utils/env.js +0 -22
  226. package/internal/utils/env.js.map +0 -1
  227. package/internal/utils/env.mjs +0 -18
  228. package/internal/utils/env.mjs.map +0 -1
  229. package/internal/utils/log.d.mts +0 -37
  230. package/internal/utils/log.d.mts.map +0 -1
  231. package/internal/utils/log.d.ts +0 -37
  232. package/internal/utils/log.d.ts.map +0 -1
  233. package/internal/utils/log.js +0 -88
  234. package/internal/utils/log.js.map +0 -1
  235. package/internal/utils/log.mjs +0 -82
  236. package/internal/utils/log.mjs.map +0 -1
  237. package/internal/utils/path.d.mts +0 -15
  238. package/internal/utils/path.d.mts.map +0 -1
  239. package/internal/utils/path.d.ts +0 -15
  240. package/internal/utils/path.d.ts.map +0 -1
  241. package/internal/utils/path.js +0 -79
  242. package/internal/utils/path.js.map +0 -1
  243. package/internal/utils/path.mjs +0 -74
  244. package/internal/utils/path.mjs.map +0 -1
  245. package/internal/utils/query.d.mts +0 -2
  246. package/internal/utils/query.d.mts.map +0 -1
  247. package/internal/utils/query.d.ts +0 -2
  248. package/internal/utils/query.d.ts.map +0 -1
  249. package/internal/utils/query.js +0 -10
  250. package/internal/utils/query.js.map +0 -1
  251. package/internal/utils/query.mjs +0 -6
  252. package/internal/utils/query.mjs.map +0 -1
  253. package/internal/utils/sleep.d.mts +0 -2
  254. package/internal/utils/sleep.d.mts.map +0 -1
  255. package/internal/utils/sleep.d.ts +0 -2
  256. package/internal/utils/sleep.d.ts.map +0 -1
  257. package/internal/utils/sleep.js +0 -7
  258. package/internal/utils/sleep.js.map +0 -1
  259. package/internal/utils/sleep.mjs +0 -3
  260. package/internal/utils/sleep.mjs.map +0 -1
  261. package/internal/utils/uuid.d.mts +0 -5
  262. package/internal/utils/uuid.d.mts.map +0 -1
  263. package/internal/utils/uuid.d.ts +0 -5
  264. package/internal/utils/uuid.d.ts.map +0 -1
  265. package/internal/utils/uuid.js +0 -19
  266. package/internal/utils/uuid.js.map +0 -1
  267. package/internal/utils/uuid.mjs +0 -15
  268. package/internal/utils/uuid.mjs.map +0 -1
  269. package/internal/utils/values.d.mts +0 -18
  270. package/internal/utils/values.d.mts.map +0 -1
  271. package/internal/utils/values.d.ts +0 -18
  272. package/internal/utils/values.d.ts.map +0 -1
  273. package/internal/utils/values.js +0 -112
  274. package/internal/utils/values.js.map +0 -1
  275. package/internal/utils/values.mjs +0 -94
  276. package/internal/utils/values.mjs.map +0 -1
  277. package/internal/utils.d.mts +0 -8
  278. package/internal/utils.d.mts.map +0 -1
  279. package/internal/utils.d.ts +0 -8
  280. package/internal/utils.d.ts.map +0 -1
  281. package/internal/utils.js +0 -12
  282. package/internal/utils.js.map +0 -1
  283. package/internal/utils.mjs +0 -9
  284. package/internal/utils.mjs.map +0 -1
  285. package/resource.d.mts +0 -3
  286. package/resource.d.mts.map +0 -1
  287. package/resource.d.ts +0 -3
  288. package/resource.d.ts.map +0 -1
  289. package/resource.js +0 -6
  290. package/resource.js.map +0 -1
  291. package/resource.mjs +0 -3
  292. package/resource.mjs.map +0 -1
  293. package/resources/connect/connect.d.mts +0 -31
  294. package/resources/connect/connect.d.mts.map +0 -1
  295. package/resources/connect/connect.d.ts +0 -31
  296. package/resources/connect/connect.d.ts.map +0 -1
  297. package/resources/connect/connect.js +0 -24
  298. package/resources/connect/connect.js.map +0 -1
  299. package/resources/connect/connect.mjs +0 -19
  300. package/resources/connect/connect.mjs.map +0 -1
  301. package/resources/connect/index.d.mts +0 -3
  302. package/resources/connect/index.d.mts.map +0 -1
  303. package/resources/connect/index.d.ts +0 -3
  304. package/resources/connect/index.d.ts.map +0 -1
  305. package/resources/connect/index.js +0 -9
  306. package/resources/connect/index.js.map +0 -1
  307. package/resources/connect/index.mjs +0 -4
  308. package/resources/connect/index.mjs.map +0 -1
  309. package/resources/connect/integrations.d.mts +0 -78
  310. package/resources/connect/integrations.d.mts.map +0 -1
  311. package/resources/connect/integrations.d.ts +0 -78
  312. package/resources/connect/integrations.d.ts.map +0 -1
  313. package/resources/connect/integrations.js +0 -22
  314. package/resources/connect/integrations.js.map +0 -1
  315. package/resources/connect/integrations.mjs +0 -18
  316. package/resources/connect/integrations.mjs.map +0 -1
  317. package/resources/connect.d.mts +0 -2
  318. package/resources/connect.d.mts.map +0 -1
  319. package/resources/connect.d.ts +0 -2
  320. package/resources/connect.d.ts.map +0 -1
  321. package/resources/connect.js +0 -6
  322. package/resources/connect.js.map +0 -1
  323. package/resources/connect.mjs +0 -3
  324. package/resources/connect.mjs.map +0 -1
  325. package/resources/health.d.mts +0 -23
  326. package/resources/health.d.mts.map +0 -1
  327. package/resources/health.d.ts +0 -23
  328. package/resources/health.d.ts.map +0 -1
  329. package/resources/health.js +0 -21
  330. package/resources/health.js.map +0 -1
  331. package/resources/health.mjs +0 -17
  332. package/resources/health.mjs.map +0 -1
  333. package/resources/index.d.mts +0 -6
  334. package/resources/index.d.mts.map +0 -1
  335. package/resources/index.d.ts +0 -6
  336. package/resources/index.d.ts.map +0 -1
  337. package/resources/index.js +0 -15
  338. package/resources/index.js.map +0 -1
  339. package/resources/index.mjs +0 -7
  340. package/resources/index.mjs.map +0 -1
  341. package/resources/media.d.mts +0 -27
  342. package/resources/media.d.mts.map +0 -1
  343. package/resources/media.d.ts +0 -27
  344. package/resources/media.d.ts.map +0 -1
  345. package/resources/media.js +0 -15
  346. package/resources/media.js.map +0 -1
  347. package/resources/media.mjs +0 -11
  348. package/resources/media.mjs.map +0 -1
  349. package/resources/platforms.d.mts +0 -22
  350. package/resources/platforms.d.mts.map +0 -1
  351. package/resources/platforms.d.ts +0 -22
  352. package/resources/platforms.d.ts.map +0 -1
  353. package/resources/platforms.js +0 -15
  354. package/resources/platforms.js.map +0 -1
  355. package/resources/platforms.mjs +0 -11
  356. package/resources/platforms.mjs.map +0 -1
  357. package/resources/posts/index.d.mts +0 -3
  358. package/resources/posts/index.d.mts.map +0 -1
  359. package/resources/posts/index.d.ts +0 -3
  360. package/resources/posts/index.d.ts.map +0 -1
  361. package/resources/posts/index.js +0 -9
  362. package/resources/posts/index.js.map +0 -1
  363. package/resources/posts/index.mjs +0 -4
  364. package/resources/posts/index.mjs.map +0 -1
  365. package/resources/posts/posts.d.mts +0 -300
  366. package/resources/posts/posts.d.mts.map +0 -1
  367. package/resources/posts/posts.d.ts +0 -300
  368. package/resources/posts/posts.d.ts.map +0 -1
  369. package/resources/posts/posts.js +0 -69
  370. package/resources/posts/posts.js.map +0 -1
  371. package/resources/posts/posts.mjs +0 -64
  372. package/resources/posts/posts.mjs.map +0 -1
  373. package/resources/posts/scheduled.d.mts +0 -121
  374. package/resources/posts/scheduled.d.mts.map +0 -1
  375. package/resources/posts/scheduled.d.ts +0 -121
  376. package/resources/posts/scheduled.d.ts.map +0 -1
  377. package/resources/posts/scheduled.js +0 -49
  378. package/resources/posts/scheduled.js.map +0 -1
  379. package/resources/posts/scheduled.mjs +0 -45
  380. package/resources/posts/scheduled.mjs.map +0 -1
  381. package/resources/posts.d.mts +0 -2
  382. package/resources/posts.d.mts.map +0 -1
  383. package/resources/posts.d.ts +0 -2
  384. package/resources/posts.d.ts.map +0 -1
  385. package/resources/posts.js +0 -6
  386. package/resources/posts.js.map +0 -1
  387. package/resources/posts.mjs +0 -3
  388. package/resources/posts.mjs.map +0 -1
  389. package/resources.d.mts +0 -2
  390. package/resources.d.mts.map +0 -1
  391. package/resources.d.ts +0 -2
  392. package/resources.d.ts.map +0 -1
  393. package/resources.js +0 -5
  394. package/resources.js.map +0 -1
  395. package/resources.mjs +0 -2
  396. package/resources.mjs.map +0 -1
  397. package/src/api-promise.ts +0 -2
  398. package/src/client.ts +0 -789
  399. package/src/core/README.md +0 -3
  400. package/src/core/api-promise.ts +0 -92
  401. package/src/core/error.ts +0 -130
  402. package/src/core/resource.ts +0 -11
  403. package/src/core/uploads.ts +0 -2
  404. package/src/error.ts +0 -2
  405. package/src/index.ts +0 -22
  406. package/src/internal/README.md +0 -3
  407. package/src/internal/builtin-types.ts +0 -93
  408. package/src/internal/detect-platform.ts +0 -196
  409. package/src/internal/errors.ts +0 -33
  410. package/src/internal/headers.ts +0 -97
  411. package/src/internal/parse.ts +0 -56
  412. package/src/internal/qs/LICENSE.md +0 -13
  413. package/src/internal/qs/README.md +0 -3
  414. package/src/internal/qs/formats.ts +0 -10
  415. package/src/internal/qs/index.ts +0 -13
  416. package/src/internal/qs/stringify.ts +0 -385
  417. package/src/internal/qs/types.ts +0 -71
  418. package/src/internal/qs/utils.ts +0 -265
  419. package/src/internal/request-options.ts +0 -91
  420. package/src/internal/shim-types.ts +0 -26
  421. package/src/internal/shims.ts +0 -107
  422. package/src/internal/to-file.ts +0 -154
  423. package/src/internal/types.ts +0 -93
  424. package/src/internal/uploads.ts +0 -187
  425. package/src/internal/utils/base64.ts +0 -40
  426. package/src/internal/utils/bytes.ts +0 -32
  427. package/src/internal/utils/env.ts +0 -18
  428. package/src/internal/utils/log.ts +0 -129
  429. package/src/internal/utils/path.ts +0 -88
  430. package/src/internal/utils/query.ts +0 -7
  431. package/src/internal/utils/sleep.ts +0 -3
  432. package/src/internal/utils/uuid.ts +0 -17
  433. package/src/internal/utils/values.ts +0 -105
  434. package/src/internal/utils.ts +0 -9
  435. package/src/lib/.keep +0 -4
  436. package/src/resource.ts +0 -2
  437. package/src/resources/connect/connect.ts +0 -70
  438. package/src/resources/connect/index.ts +0 -9
  439. package/src/resources/connect/integrations.ts +0 -130
  440. package/src/resources/connect.ts +0 -3
  441. package/src/resources/health.ts +0 -36
  442. package/src/resources/index.ts +0 -16
  443. package/src/resources/media.ts +0 -38
  444. package/src/resources/platforms.ts +0 -39
  445. package/src/resources/posts/index.ts +0 -20
  446. package/src/resources/posts/posts.ts +0 -472
  447. package/src/resources/posts/scheduled.ts +0 -180
  448. package/src/resources/posts.ts +0 -3
  449. package/src/resources.ts +0 -1
  450. package/src/tsconfig.json +0 -11
  451. package/src/uploads.ts +0 -2
  452. package/src/version.ts +0 -1
  453. package/uploads.d.mts +0 -3
  454. package/uploads.d.mts.map +0 -1
  455. package/uploads.d.ts +0 -3
  456. package/uploads.d.ts.map +0 -1
  457. package/uploads.js +0 -6
  458. package/uploads.js.map +0 -1
  459. package/uploads.mjs +0 -3
  460. package/uploads.mjs.map +0 -1
  461. package/version.d.mts +0 -2
  462. package/version.d.mts.map +0 -1
  463. package/version.d.ts +0 -2
  464. package/version.d.ts.map +0 -1
  465. package/version.js +0 -5
  466. package/version.js.map +0 -1
  467. package/version.mjs +0 -2
  468. package/version.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,134 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.7.0 (2026-05-19)
3
+ ## 0.8.1
4
4
 
5
- Full Changelog: [v0.6.0...v0.7.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.6.0...v0.7.0)
5
+ - Standardized the public SDK class name as `PostPeer` throughout generated code and documentation.
6
6
 
7
- ### Features
7
+ ## 0.8.0
8
8
 
9
- * **api:** api update ([3ea6c9c](https://github.com/PostPeer-API/postpeer-node/commit/3ea6c9cd024624c0780f12b15a666f484a3cfa12))
10
- * **api:** api update ([92bcd6e](https://github.com/PostPeer-API/postpeer-node/commit/92bcd6e92baf495de01fa30194810c03ddeb73fd))
11
- * **api:** api update ([71fe758](https://github.com/PostPeer-API/postpeer-node/commit/71fe7580cc67c705e868208f430af8ef18e10399))
12
- * **api:** api update ([ba583d0](https://github.com/PostPeer-API/postpeer-node/commit/ba583d0b9bfea6ea5657f8d73e832b3d5ab0a056))
13
- * **api:** api update ([01f1907](https://github.com/PostPeer-API/postpeer-node/commit/01f1907a729f7e0fdbf1aa7b133553d4397417c1))
14
- * **api:** api update ([7395420](https://github.com/PostPeer-API/postpeer-node/commit/7395420c425cb7d6efe09f53b5a45f0a9450c5cf))
9
+ - Rebuilt the SDK with Hey API from the PostPeer OpenAPI specification.
10
+ - Added the `PostPeer` client with retries, timeouts, and typed errors.
11
+ - Simplified generation, testing, packaging, and releases.
15
12
 
16
-
17
- ### Bug Fixes
18
-
19
- * **typescript:** upgrade tsc-multi so that it works with Node 26 ([790d61c](https://github.com/PostPeer-API/postpeer-node/commit/790d61cba30fb1f83076f686ccfa2e586e958c5e))
20
-
21
-
22
- ### Chores
23
-
24
- * redact api-key headers in debug logs ([9f4b4c0](https://github.com/PostPeer-API/postpeer-node/commit/9f4b4c000fb771ea8d1e510043537e1cbfb438e4))
25
- * **tests:** remove redundant File import ([6f6647f](https://github.com/PostPeer-API/postpeer-node/commit/6f6647fdb4e21d9576a3898d724aefbaeecd1af9))
26
-
27
-
28
- ### Documentation
29
-
30
- * update http mcp docs ([a7586bf](https://github.com/PostPeer-API/postpeer-node/commit/a7586bfc91be444612dc4137409c97fe89cc1617))
31
-
32
- ## 0.6.0 (2026-04-30)
33
-
34
- Full Changelog: [v0.5.0...v0.6.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.5.0...v0.6.0)
35
-
36
- ### Features
37
-
38
- * **api:** api update ([d2e32a9](https://github.com/PostPeer-API/postpeer-node/commit/d2e32a9b1ed5f1ba0fffc0937262f97945840299))
39
- * **api:** api update ([7fe25ac](https://github.com/PostPeer-API/postpeer-node/commit/7fe25ac62bd8fff2b4a8595bdf2354247125bee8))
40
- * **api:** api update ([0f4244a](https://github.com/PostPeer-API/postpeer-node/commit/0f4244a93883c46284d9a3aae68fed3ee3dd470a))
41
- * **api:** manual updates ([1a587f1](https://github.com/PostPeer-API/postpeer-node/commit/1a587f1d8d28cc22aa7a60065238bf27739a90b2))
42
- * support setting headers via env ([da2c3df](https://github.com/PostPeer-API/postpeer-node/commit/da2c3df88282d1a007a836853a407271db3fcb43))
43
-
44
-
45
- ### Chores
46
-
47
- * avoid formatting file that gets changed during releases ([bbec615](https://github.com/PostPeer-API/postpeer-node/commit/bbec6155e6d2255bd46e504ddaf932f84f829763))
48
- * **format:** run eslint and prettier separately ([6da828b](https://github.com/PostPeer-API/postpeer-node/commit/6da828bb9a28fb72bb3b73e7c582d98369b6b320))
49
- * **internal:** codegen related update ([a02ee4a](https://github.com/PostPeer-API/postpeer-node/commit/a02ee4a29b99d489770e63d73bf784d1b92e2eb3))
50
-
51
- ## 0.5.0 (2026-04-27)
52
-
53
- Full Changelog: [v0.4.0...v0.5.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.4.0...v0.5.0)
54
-
55
- ### Features
56
-
57
- * **api:** api update ([4d62307](https://github.com/PostPeer-API/postpeer-node/commit/4d6230790ddd0f60eb57b8f98b0361cbf16f4904))
58
- * **api:** api update ([9411834](https://github.com/PostPeer-API/postpeer-node/commit/9411834d9792457de0fc2904e31a8128c21f2c5d))
59
-
60
-
61
- ### Chores
62
-
63
- * **formatter:** run prettier and eslint separately ([80fe4b5](https://github.com/PostPeer-API/postpeer-node/commit/80fe4b51aabe1b22f5275c2f1c09c360f994f75c))
64
- * **internal:** more robust bootstrap script ([b581aeb](https://github.com/PostPeer-API/postpeer-node/commit/b581aeb94a851b78096edeee23bea88f491a5f9a))
65
- * restructure docs search code ([162a5ca](https://github.com/PostPeer-API/postpeer-node/commit/162a5ca3ff9decf80a52a5e8849ab1bd32e84d17))
66
-
67
- ## 0.4.0 (2026-04-16)
68
-
69
- Full Changelog: [v0.3.1...v0.4.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.3.1...v0.4.0)
70
-
71
- ### Features
72
-
73
- * **api:** manual updates ([f6c645f](https://github.com/PostPeer-API/postpeer-node/commit/f6c645f270e89f136b31e6eb77deee347721cc3c))
74
-
75
-
76
- ### Chores
77
-
78
- * sync repo ([64cc226](https://github.com/PostPeer-API/postpeer-node/commit/64cc226bdaec83152c6fe31c843a952a50ea1b52))
79
- * update SDK settings ([726ba8c](https://github.com/PostPeer-API/postpeer-node/commit/726ba8cc5e14a8fec6eee1f2c8062254ad7ab49d))
80
-
81
- ## 0.3.1 (2026-04-16)
82
-
83
- Full Changelog: [v0.3.0...v0.3.1](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.3.0...v0.3.1)
84
-
85
- ## 0.3.0 (2026-04-16)
86
-
87
- Full Changelog: [v0.2.0...v0.3.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.2.0...v0.3.0)
88
-
89
- ### Features
90
-
91
- * **api:** manual updates ([0e51c04](https://github.com/PostPeer-API/postpeer-typescript/commit/0e51c04af30a1656bfd425e2f5efcac90c05f9f8))
92
-
93
-
94
- ### Chores
95
-
96
- * remove custom code ([0f67ec6](https://github.com/PostPeer-API/postpeer-typescript/commit/0f67ec6be9415fc5fb2471c878f02007fe632a02))
97
- * update SDK settings ([bda5df5](https://github.com/PostPeer-API/postpeer-typescript/commit/bda5df5817239e8cb162a3c1b69cc661fb6ac6f0))
98
-
99
- ## 0.2.0 (2026-04-16)
100
-
101
- Full Changelog: [v0.1.2...v0.2.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.2...v0.2.0)
102
-
103
- ### Features
104
-
105
- * **api:** api update ([06b89da](https://github.com/PostPeer-API/postpeer-typescript/commit/06b89dad537b8cca199c69dcba8a5239012dc591))
106
-
107
- ## 0.1.2 (2026-04-15)
108
-
109
- Full Changelog: [v0.1.1...v0.1.2](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.1...v0.1.2)
110
-
111
- ## 0.1.1 (2026-04-15)
112
-
113
- Full Changelog: [v0.1.0...v0.1.1](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.0...v0.1.1)
114
-
115
- ### Chores
116
-
117
- * configure new SDK language ([3ea01db](https://github.com/PostPeer-API/postpeer-typescript/commit/3ea01db9930bbcbcb20e3216db9d1e75f3ef21c9))
118
-
119
- ## 0.1.0 (2026-04-15)
120
-
121
- Full Changelog: [v0.0.1...v0.1.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.0.1...v0.1.0)
122
-
123
- ### Features
124
-
125
- * **api:** manual updates ([77ced69](https://github.com/PostPeer-API/postpeer-typescript/commit/77ced69d5ab0d5840ad15b8bf0026620021b1b31))
126
-
127
-
128
- ### Chores
129
-
130
- * configure new SDK language ([656bd65](https://github.com/PostPeer-API/postpeer-typescript/commit/656bd653dd11e873734b34cba9f8b117ba50ee59))
131
- * update SDK settings ([9256963](https://github.com/PostPeer-API/postpeer-typescript/commit/9256963d1e1bfdfa976d477545618c64ed092360))
132
- * update SDK settings ([24f8c7b](https://github.com/PostPeer-API/postpeer-typescript/commit/24f8c7b95dd8412634fb90832b64a2b0e1c48e02))
133
- * update SDK settings ([f630304](https://github.com/PostPeer-API/postpeer-typescript/commit/f630304937e27a2bb454d7d9198011859d1f3e22))
134
- * update SDK settings ([76cf155](https://github.com/PostPeer-API/postpeer-typescript/commit/76cf15568d0738279cc7e77eb03510dc2d5f8d9c))
13
+ Earlier release history remains available in Git tags.
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2026 Postpeer
189
+ Copyright 2026 PostPeer
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,364 +1,142 @@
1
- # PostPeer TypeScript API Library
1
+ # PostPeer Node.js SDK
2
2
 
3
- [![NPM version](<https://img.shields.io/npm/v/@postpeer/node.svg?label=npm%20(stable)>)](https://npmjs.org/package/@postpeer/node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@postpeer/node)
4
-
5
- This library provides convenient access to the PostPeer REST API from server-side TypeScript or JavaScript.
6
-
7
-
8
- ## MCP Server
9
-
10
- Use the Postpeer MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
11
-
12
- [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=postpeer-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBvc3RwZWVyLW1jcCJdLCJlbnYiOnsiUE9TVFBFRVJfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)
13
- [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22postpeer-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22postpeer-mcp%22%5D%2C%22env%22%3A%7B%22POSTPEER_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
14
-
15
- > Note: You may need to set environment variables in your MCP client.
3
+ The official TypeScript SDK for the [PostPeer API](https://postpeer.dev), generated from PostPeer's OpenAPI contract with [Hey API](https://heyapi.dev/).
16
4
 
17
5
  ## Installation
18
6
 
19
- ```sh
7
+ ```bash
20
8
  npm install @postpeer/node
21
9
  ```
22
10
 
23
- ## Usage
11
+ Node.js 20 or newer is required.
24
12
 
25
- The full API of this library can be found in [api.md](api.md).
13
+ ## Quick start
26
14
 
27
- <!-- prettier-ignore -->
28
- ```js
29
- import Postpeer from '@postpeer/node';
30
-
31
- const client = new Postpeer({
32
- apiKey: process.env['POSTPEER_API_KEY'], // This is the default and can be omitted
33
- });
34
-
35
- const response = await client.health.check();
36
-
37
- console.log(response.ok);
38
- ```
39
-
40
- ### Request & Response types
41
-
42
- This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
43
-
44
- <!-- prettier-ignore -->
45
15
  ```ts
46
- import Postpeer from '@postpeer/node';
47
-
48
- const client = new Postpeer({
49
- apiKey: process.env['POSTPEER_API_KEY'], // This is the default and can be omitted
50
- });
51
-
52
- const response: Postpeer.HealthCheckResponse = await client.health.check();
53
- ```
54
-
55
- Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
56
-
57
- ## Handling errors
58
-
59
- When the library is unable to connect to the API,
60
- or if the API returns a non-success status code (i.e., 4xx or 5xx response),
61
- a subclass of `APIError` will be thrown:
62
-
63
- <!-- prettier-ignore -->
64
- ```ts
65
- const response = await client.health.check().catch(async (err) => {
66
- if (err instanceof Postpeer.APIError) {
67
- console.log(err.status); // 400
68
- console.log(err.name); // BadRequestError
69
- console.log(err.headers); // {server: 'nginx', ...}
70
- } else {
71
- throw err;
72
- }
73
- });
74
- ```
75
-
76
- Error codes are as follows:
77
-
78
- | Status Code | Error Type |
79
- | ----------- | -------------------------- |
80
- | 400 | `BadRequestError` |
81
- | 401 | `AuthenticationError` |
82
- | 403 | `PermissionDeniedError` |
83
- | 404 | `NotFoundError` |
84
- | 422 | `UnprocessableEntityError` |
85
- | 429 | `RateLimitError` |
86
- | >=500 | `InternalServerError` |
87
- | N/A | `APIConnectionError` |
88
-
89
- ### Retries
16
+ import PostPeer from '@postpeer/node';
90
17
 
91
- Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
92
- Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
93
- 429 Rate Limit, and >=500 Internal errors will all be retried by default.
18
+ const client = new PostPeer(); // Uses POSTPEER_API_KEY
94
19
 
95
- You can use the `maxRetries` option to configure or disable this:
96
-
97
- <!-- prettier-ignore -->
98
- ```js
99
- // Configure the default for all requests:
100
- const client = new Postpeer({
101
- maxRetries: 0, // default is 2
102
- });
103
-
104
- // Or, configure per-request:
105
- await client.health.check({
106
- maxRetries: 5,
107
- });
108
- ```
109
-
110
- ### Timeouts
111
-
112
- Requests time out after 1 minute by default. You can configure this with a `timeout` option:
113
-
114
- <!-- prettier-ignore -->
115
- ```ts
116
- // Configure the default for all requests:
117
- const client = new Postpeer({
118
- timeout: 20 * 1000, // 20 seconds (default is 1 minute)
119
- });
120
-
121
- // Override per-request:
122
- await client.health.check({
123
- timeout: 5 * 1000,
20
+ const { data: post } = await client.posts.create({
21
+ body: {
22
+ content: 'Hello from PostPeer!',
23
+ platforms: [{ platform: 'twitter', accountId: 'integration-id' }],
24
+ publishNow: true,
25
+ },
124
26
  });
125
- ```
126
-
127
- On timeout, an `APIConnectionTimeoutError` is thrown.
128
27
 
129
- Note that requests which time out will be [retried twice by default](#retries).
130
-
131
- ## Advanced Usage
132
-
133
- ### Accessing raw Response data (e.g., headers)
134
-
135
- The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
136
- This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
137
-
138
- You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
139
- Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
140
-
141
- <!-- prettier-ignore -->
142
- ```ts
143
- const client = new Postpeer();
144
-
145
- const response = await client.health.check().asResponse();
146
- console.log(response.headers.get('X-My-Header'));
147
- console.log(response.statusText); // access the underlying Response object
148
-
149
- const { data: response, response: raw } = await client.health.check().withResponse();
150
- console.log(raw.headers.get('X-My-Header'));
151
- console.log(response.ok);
28
+ console.log(post);
152
29
  ```
153
30
 
154
- ### Logging
155
-
156
- > [!IMPORTANT]
157
- > All log messages are intended for debugging only. The format and content of log messages
158
- > may change between releases.
159
-
160
- #### Log levels
161
-
162
- The log level can be configured in two ways:
163
-
164
- 1. Via the `POSTPEER_LOG` environment variable
165
- 2. Using the `logLevel` client option (overrides the environment variable if set)
31
+ You can also pass the key directly:
166
32
 
167
33
  ```ts
168
- import Postpeer from '@postpeer/node';
169
-
170
- const client = new Postpeer({
171
- logLevel: 'debug', // Show all log messages
34
+ const client = new PostPeer({
35
+ apiKey: 'your-access-key',
172
36
  });
173
37
  ```
174
38
 
175
- Available log levels, from most to least verbose:
176
-
177
- - `'debug'` - Show debug messages, info, warnings, and errors
178
- - `'info'` - Show info messages, warnings, and errors
179
- - `'warn'` - Show warnings and errors (default)
180
- - `'error'` - Show only errors
181
- - `'off'` - Disable all logging
182
-
183
- At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
184
- Some authentication-related headers are redacted, but sensitive data in request and response bodies
185
- may still be visible.
186
-
187
- #### Custom logger
188
-
189
- By default, this library logs to `globalThis.console`. You can also provide a custom logger.
190
- Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
191
-
192
- When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
193
- below the configured level will not be sent to your logger.
39
+ ## Configuration
194
40
 
195
41
  ```ts
196
- import Postpeer from '@postpeer/node';
197
- import pino from 'pino';
198
-
199
- const logger = pino();
200
-
201
- const client = new Postpeer({
202
- logger: logger.child({ name: 'Postpeer' }),
203
- logLevel: 'debug', // Send all messages to pino, allowing it to filter
42
+ const client = new PostPeer({
43
+ apiKey: 'your-access-key',
44
+ baseURL: 'https://api.postpeer.dev',
45
+ timeout: 60_000,
46
+ maxRetries: 2,
47
+ defaultHeaders: { 'X-Application': 'my-app' },
48
+ fetch: customFetch,
204
49
  });
205
50
  ```
206
51
 
207
- ### Making custom/undocumented requests
52
+ Every `PostPeer` instance owns an isolated HTTP client, so separate API keys and base URLs do not interfere with one another.
208
53
 
209
- This library is typed for convenient access to the documented API. If you need to access undocumented
210
- endpoints, params, or response properties, the library can still be used.
54
+ ## Resources
211
55
 
212
- #### Undocumented endpoints
213
-
214
- To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
215
- Options on the client, such as retries, will be respected when making these requests.
56
+ The SDK follows the API's resource structure:
216
57
 
217
58
  ```ts
218
- await client.post('/some/path', {
219
- body: { some_prop: 'foo' },
220
- query: { some_query_arg: 'bar' },
221
- });
222
- ```
223
-
224
- #### Undocumented request params
225
-
226
- To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
227
- parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
228
- send will be sent as-is.
59
+ client.health.check();
60
+ client.health.verifyAccessKey();
61
+
62
+ client.posts.create({ body });
63
+ client.posts.list({ query });
64
+ client.posts.get({ path: { postId } });
65
+ client.posts.delete({ path: { postId } });
66
+ client.posts.scheduled.list();
67
+ client.posts.scheduled.cancel({ path: { postId } });
68
+ client.posts.scheduled.reschedule({ path: { postId }, body });
69
+
70
+ client.connect.getOAuthUrl({ path: { platform }, query });
71
+ client.connect.integrations.list();
72
+ client.connect.integrations.disconnect({ path: { id } });
73
+
74
+ client.profiles.list();
75
+ client.apps.list();
76
+ client.notifications.list();
77
+ client.platforms.list();
78
+ client.media.upload({ body });
79
+ client.analytics.get({ query });
80
+ client.usage.get();
81
+ client.pinterest.getBoards({ query });
82
+ client.tiktok.getCreatorInfo({ query });
83
+ client.ai.write({ body });
84
+ client.ai.generateImage({ body });
85
+ ```
86
+
87
+ Request parameters are grouped under `body`, `path`, `query`, and `headers`. Responses include `data`, `request`, and `response`, giving you access to the parsed result and the native Fetch objects.
88
+
89
+ ## Error handling
229
90
 
230
91
  ```ts
231
- client.health.check({
232
- // ...
233
- // @ts-expect-error baz is not yet public
234
- baz: 'undocumented option',
235
- });
236
- ```
237
-
238
- For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
239
- extra param in the body.
240
-
241
- If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
242
- options.
92
+ import PostPeer, { NotFoundError, RateLimitError } from '@postpeer/node';
243
93
 
244
- #### Undocumented response properties
94
+ const client = new PostPeer();
245
95
 
246
- To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
247
- the response object, or cast the response object to the requisite type. Like the request params, we do not
248
- validate or strip extra properties from the response from the API.
249
-
250
- ### Customizing the fetch client
251
-
252
- By default, this library expects a global `fetch` function is defined.
253
-
254
- If you want to use a different `fetch` function, you can either polyfill the global:
255
-
256
- ```ts
257
- import fetch from 'my-fetch';
258
-
259
- globalThis.fetch = fetch;
260
- ```
261
-
262
- Or pass it to the client:
263
-
264
- ```ts
265
- import Postpeer from '@postpeer/node';
266
- import fetch from 'my-fetch';
267
-
268
- const client = new Postpeer({ fetch });
96
+ try {
97
+ await client.posts.get({ path: { postId: 'missing' } });
98
+ } catch (error) {
99
+ if (error instanceof NotFoundError) {
100
+ console.error(error.status, error.requestId, error.message);
101
+ } else if (error instanceof RateLimitError) {
102
+ console.error('PostPeer rate limit reached');
103
+ }
104
+ }
269
105
  ```
270
106
 
271
- ### Fetch options
107
+ The SDK exports typed API, connection, timeout, and user-abort errors.
272
108
 
273
- If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
109
+ ## Updating the generated SDK
274
110
 
275
- ```ts
276
- import Postpeer from '@postpeer/node';
111
+ The OpenAPI specification and npm releases are intentionally separate.
277
112
 
278
- const client = new Postpeer({
279
- fetchOptions: {
280
- // `RequestInit` options
281
- },
282
- });
113
+ ```bash
114
+ pnpm spec:fetch
115
+ pnpm generate
116
+ pnpm check
283
117
  ```
284
118
 
285
- #### Configuring proxies
286
-
287
- To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
288
- options to requests:
119
+ Commit `openapi.json` and `src/generated` together. This updates the code but does not publish a package.
289
120
 
290
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
291
-
292
- ```ts
293
- import Postpeer from '@postpeer/node';
294
- import * as undici from 'undici';
121
+ For a release, update `package.json`, `src/version.ts`, and `CHANGELOG.md`, run `pnpm check`, then publish with `npm publish --access public`.
295
122
 
296
- const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
297
- const client = new Postpeer({
298
- fetchOptions: {
299
- dispatcher: proxyAgent,
300
- },
301
- });
302
- ```
123
+ Generated files under `src/generated` must not be edited by hand.
303
124
 
304
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
125
+ ## Versioning
305
126
 
306
- ```ts
307
- import Postpeer from '@postpeer/node';
127
+ PostPeer uses conservative pre-1.0 versioning:
308
128
 
309
- const client = new Postpeer({
310
- fetchOptions: {
311
- proxy: 'http://localhost:8888',
312
- },
313
- });
314
- ```
129
+ - `0.8.0` is the first Hey API release.
130
+ - Compatible fixes and additions remain in `0.8.x`.
131
+ - A breaking SDK change moves to `0.9.0`.
132
+ - `1.0.0` will be published only when the SDK contract is considered mature.
315
133
 
316
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
134
+ OpenAPI changes may accumulate before a package release.
317
135
 
318
- ```ts
319
- import Postpeer from 'npm:@postpeer/node';
136
+ ## Development
320
137
 
321
- const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
322
- const client = new Postpeer({
323
- fetchOptions: {
324
- client: httpClient,
325
- },
326
- });
138
+ ```bash
139
+ pnpm install
140
+ pnpm generate
141
+ pnpm check
327
142
  ```
328
-
329
- ## Frequently Asked Questions
330
-
331
- ## Semantic versioning
332
-
333
- This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
334
-
335
- 1. Changes that only affect static types, without breaking runtime behavior.
336
- 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
337
- 3. Changes that we do not expect to impact the vast majority of users in practice.
338
-
339
- We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
340
-
341
- We are keen for your feedback; please open an [issue](https://www.github.com/PostPeer-API/postpeer-node/issues) with questions, bugs, or suggestions.
342
-
343
- ## Requirements
344
-
345
- TypeScript >= 4.9 is supported.
346
-
347
- The following runtimes are supported:
348
-
349
- - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
350
- - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
351
- - Deno v1.28.0 or higher.
352
- - Bun 1.0 or later.
353
- - Cloudflare Workers.
354
- - Vercel Edge Runtime.
355
- - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
356
- - Nitro v2.6 or greater.
357
-
358
- Note that React Native is not supported at this time.
359
-
360
- If you are interested in other runtime environments, please open or upvote an issue on GitHub.
361
-
362
- ## Contributing
363
-
364
- See [the contributing documentation](./CONTRIBUTING.md).