@whop/sdk 0.0.26 → 0.0.28

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 (463) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/client.d.mts +10 -9
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -9
  5. package/client.d.ts.map +1 -1
  6. package/client.js +16 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +16 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +3 -3
  11. package/resources/access-tokens.d.mts +34 -54
  12. package/resources/access-tokens.d.mts.map +1 -1
  13. package/resources/access-tokens.d.ts +34 -54
  14. package/resources/access-tokens.d.ts.map +1 -1
  15. package/resources/access-tokens.js +6 -8
  16. package/resources/access-tokens.js.map +1 -1
  17. package/resources/access-tokens.mjs +6 -8
  18. package/resources/access-tokens.mjs.map +1 -1
  19. package/resources/account-links.d.mts +15 -13
  20. package/resources/account-links.d.mts.map +1 -1
  21. package/resources/account-links.d.ts +15 -13
  22. package/resources/account-links.d.ts.map +1 -1
  23. package/resources/account-links.js +2 -3
  24. package/resources/account-links.js.map +1 -1
  25. package/resources/account-links.mjs +2 -3
  26. package/resources/account-links.mjs.map +1 -1
  27. package/resources/ai-chats.d.mts +70 -30
  28. package/resources/ai-chats.d.mts.map +1 -1
  29. package/resources/ai-chats.d.ts +70 -30
  30. package/resources/ai-chats.d.ts.map +1 -1
  31. package/resources/ai-chats.js +6 -6
  32. package/resources/ai-chats.js.map +1 -1
  33. package/resources/ai-chats.mjs +6 -6
  34. package/resources/ai-chats.mjs.map +1 -1
  35. package/resources/app-builds.d.mts +37 -35
  36. package/resources/app-builds.d.mts.map +1 -1
  37. package/resources/app-builds.d.ts +37 -35
  38. package/resources/app-builds.d.ts.map +1 -1
  39. package/resources/app-builds.js +7 -4
  40. package/resources/app-builds.js.map +1 -1
  41. package/resources/app-builds.mjs +7 -4
  42. package/resources/app-builds.mjs.map +1 -1
  43. package/resources/apps.d.mts +86 -60
  44. package/resources/apps.d.mts.map +1 -1
  45. package/resources/apps.d.ts +86 -60
  46. package/resources/apps.d.ts.map +1 -1
  47. package/resources/apps.js +7 -4
  48. package/resources/apps.js.map +1 -1
  49. package/resources/apps.mjs +7 -4
  50. package/resources/apps.mjs.map +1 -1
  51. package/resources/authorized-users.d.mts +38 -32
  52. package/resources/authorized-users.d.mts.map +1 -1
  53. package/resources/authorized-users.d.ts +38 -32
  54. package/resources/authorized-users.d.ts.map +1 -1
  55. package/resources/authorized-users.js +3 -2
  56. package/resources/authorized-users.js.map +1 -1
  57. package/resources/authorized-users.mjs +3 -2
  58. package/resources/authorized-users.mjs.map +1 -1
  59. package/resources/chat-channels.d.mts +28 -20
  60. package/resources/chat-channels.d.mts.map +1 -1
  61. package/resources/chat-channels.d.ts +28 -20
  62. package/resources/chat-channels.d.ts.map +1 -1
  63. package/resources/chat-channels.js +5 -3
  64. package/resources/chat-channels.js.map +1 -1
  65. package/resources/chat-channels.mjs +5 -3
  66. package/resources/chat-channels.mjs.map +1 -1
  67. package/resources/checkout-configurations.d.mts +75 -58
  68. package/resources/checkout-configurations.d.mts.map +1 -1
  69. package/resources/checkout-configurations.d.ts +75 -58
  70. package/resources/checkout-configurations.d.ts.map +1 -1
  71. package/resources/checkout-configurations.js +3 -2
  72. package/resources/checkout-configurations.js.map +1 -1
  73. package/resources/checkout-configurations.mjs +3 -2
  74. package/resources/checkout-configurations.mjs.map +1 -1
  75. package/resources/companies.d.mts +88 -56
  76. package/resources/companies.d.mts.map +1 -1
  77. package/resources/companies.d.ts +88 -56
  78. package/resources/companies.d.ts.map +1 -1
  79. package/resources/companies.js +9 -7
  80. package/resources/companies.js.map +1 -1
  81. package/resources/companies.mjs +9 -7
  82. package/resources/companies.mjs.map +1 -1
  83. package/resources/company-token-transactions.d.mts +90 -67
  84. package/resources/company-token-transactions.d.mts.map +1 -1
  85. package/resources/company-token-transactions.d.ts +90 -67
  86. package/resources/company-token-transactions.d.ts.map +1 -1
  87. package/resources/company-token-transactions.js +6 -3
  88. package/resources/company-token-transactions.js.map +1 -1
  89. package/resources/company-token-transactions.mjs +6 -3
  90. package/resources/company-token-transactions.mjs.map +1 -1
  91. package/resources/course-chapters.d.mts +27 -22
  92. package/resources/course-chapters.d.mts.map +1 -1
  93. package/resources/course-chapters.d.ts +27 -22
  94. package/resources/course-chapters.d.ts.map +1 -1
  95. package/resources/course-chapters.js +5 -5
  96. package/resources/course-chapters.mjs +5 -5
  97. package/resources/course-lesson-interactions.d.mts +7 -6
  98. package/resources/course-lesson-interactions.d.mts.map +1 -1
  99. package/resources/course-lesson-interactions.d.ts +7 -6
  100. package/resources/course-lesson-interactions.d.ts.map +1 -1
  101. package/resources/course-lesson-interactions.js +3 -2
  102. package/resources/course-lesson-interactions.js.map +1 -1
  103. package/resources/course-lesson-interactions.mjs +3 -2
  104. package/resources/course-lesson-interactions.mjs.map +1 -1
  105. package/resources/course-lessons.d.mts +141 -99
  106. package/resources/course-lessons.d.mts.map +1 -1
  107. package/resources/course-lessons.d.ts +141 -99
  108. package/resources/course-lessons.d.ts.map +1 -1
  109. package/resources/course-lessons.js +12 -8
  110. package/resources/course-lessons.js.map +1 -1
  111. package/resources/course-lessons.mjs +12 -8
  112. package/resources/course-lessons.mjs.map +1 -1
  113. package/resources/course-students.d.mts +44 -35
  114. package/resources/course-students.d.mts.map +1 -1
  115. package/resources/course-students.d.ts +44 -35
  116. package/resources/course-students.d.ts.map +1 -1
  117. package/resources/course-students.js +3 -2
  118. package/resources/course-students.js.map +1 -1
  119. package/resources/course-students.mjs +3 -2
  120. package/resources/course-students.mjs.map +1 -1
  121. package/resources/courses.d.mts +140 -99
  122. package/resources/courses.d.mts.map +1 -1
  123. package/resources/courses.d.ts +140 -99
  124. package/resources/courses.d.ts.map +1 -1
  125. package/resources/courses.js +9 -5
  126. package/resources/courses.js.map +1 -1
  127. package/resources/courses.mjs +9 -5
  128. package/resources/courses.mjs.map +1 -1
  129. package/resources/disputes.d.mts +176 -120
  130. package/resources/disputes.d.mts.map +1 -1
  131. package/resources/disputes.d.ts +176 -120
  132. package/resources/disputes.d.ts.map +1 -1
  133. package/resources/disputes.js +4 -2
  134. package/resources/disputes.js.map +1 -1
  135. package/resources/disputes.mjs +4 -2
  136. package/resources/disputes.mjs.map +1 -1
  137. package/resources/dm-channels.d.mts +29 -16
  138. package/resources/dm-channels.d.mts.map +1 -1
  139. package/resources/dm-channels.d.ts +29 -16
  140. package/resources/dm-channels.d.ts.map +1 -1
  141. package/resources/dm-channels.js +9 -5
  142. package/resources/dm-channels.js.map +1 -1
  143. package/resources/dm-channels.mjs +9 -5
  144. package/resources/dm-channels.mjs.map +1 -1
  145. package/resources/dm-members.d.mts +30 -21
  146. package/resources/dm-members.d.mts.map +1 -1
  147. package/resources/dm-members.d.ts +30 -21
  148. package/resources/dm-members.d.ts.map +1 -1
  149. package/resources/dm-members.js +9 -5
  150. package/resources/dm-members.js.map +1 -1
  151. package/resources/dm-members.mjs +9 -5
  152. package/resources/dm-members.mjs.map +1 -1
  153. package/resources/entries.d.mts +35 -27
  154. package/resources/entries.d.mts.map +1 -1
  155. package/resources/entries.d.ts +35 -27
  156. package/resources/entries.d.ts.map +1 -1
  157. package/resources/entries.js +7 -4
  158. package/resources/entries.js.map +1 -1
  159. package/resources/entries.mjs +7 -4
  160. package/resources/entries.mjs.map +1 -1
  161. package/resources/experiences.d.mts +58 -49
  162. package/resources/experiences.d.mts.map +1 -1
  163. package/resources/experiences.d.ts +58 -49
  164. package/resources/experiences.d.ts.map +1 -1
  165. package/resources/experiences.js +6 -5
  166. package/resources/experiences.js.map +1 -1
  167. package/resources/experiences.mjs +6 -5
  168. package/resources/experiences.mjs.map +1 -1
  169. package/resources/fee-markups.d.mts +38 -27
  170. package/resources/fee-markups.d.mts.map +1 -1
  171. package/resources/fee-markups.d.ts +38 -27
  172. package/resources/fee-markups.d.ts.map +1 -1
  173. package/resources/fee-markups.js +6 -3
  174. package/resources/fee-markups.js.map +1 -1
  175. package/resources/fee-markups.mjs +6 -3
  176. package/resources/fee-markups.mjs.map +1 -1
  177. package/resources/files.d.mts +23 -19
  178. package/resources/files.d.mts.map +1 -1
  179. package/resources/files.d.ts +23 -19
  180. package/resources/files.d.ts.map +1 -1
  181. package/resources/files.js +3 -2
  182. package/resources/files.js.map +1 -1
  183. package/resources/files.mjs +3 -2
  184. package/resources/files.mjs.map +1 -1
  185. package/resources/forum-posts.d.mts +68 -45
  186. package/resources/forum-posts.d.mts.map +1 -1
  187. package/resources/forum-posts.d.ts +68 -45
  188. package/resources/forum-posts.d.ts.map +1 -1
  189. package/resources/forum-posts.js +8 -4
  190. package/resources/forum-posts.js.map +1 -1
  191. package/resources/forum-posts.mjs +8 -4
  192. package/resources/forum-posts.mjs.map +1 -1
  193. package/resources/forums.d.mts +21 -13
  194. package/resources/forums.d.mts.map +1 -1
  195. package/resources/forums.d.ts +21 -13
  196. package/resources/forums.d.ts.map +1 -1
  197. package/resources/forums.js +5 -3
  198. package/resources/forums.js.map +1 -1
  199. package/resources/forums.mjs +5 -3
  200. package/resources/forums.mjs.map +1 -1
  201. package/resources/index.d.mts +3 -3
  202. package/resources/index.d.mts.map +1 -1
  203. package/resources/index.d.ts +3 -3
  204. package/resources/index.d.ts.map +1 -1
  205. package/resources/index.js.map +1 -1
  206. package/resources/index.mjs.map +1 -1
  207. package/resources/invoices.d.mts +136 -100
  208. package/resources/invoices.d.mts.map +1 -1
  209. package/resources/invoices.d.ts +136 -100
  210. package/resources/invoices.d.ts.map +1 -1
  211. package/resources/invoices.js +7 -4
  212. package/resources/invoices.js.map +1 -1
  213. package/resources/invoices.mjs +7 -4
  214. package/resources/invoices.mjs.map +1 -1
  215. package/resources/leads.d.mts +76 -54
  216. package/resources/leads.d.mts.map +1 -1
  217. package/resources/leads.d.ts +76 -54
  218. package/resources/leads.d.ts.map +1 -1
  219. package/resources/leads.js +6 -4
  220. package/resources/leads.js.map +1 -1
  221. package/resources/leads.mjs +6 -4
  222. package/resources/leads.mjs.map +1 -1
  223. package/resources/ledger-accounts.d.mts +19 -15
  224. package/resources/ledger-accounts.d.mts.map +1 -1
  225. package/resources/ledger-accounts.d.ts +19 -15
  226. package/resources/ledger-accounts.d.ts.map +1 -1
  227. package/resources/ledger-accounts.js +1 -1
  228. package/resources/ledger-accounts.mjs +1 -1
  229. package/resources/members.d.mts +27 -28
  230. package/resources/members.d.mts.map +1 -1
  231. package/resources/members.d.ts +27 -28
  232. package/resources/members.d.ts.map +1 -1
  233. package/resources/members.js +3 -2
  234. package/resources/members.js.map +1 -1
  235. package/resources/members.mjs +3 -2
  236. package/resources/members.mjs.map +1 -1
  237. package/resources/memberships.d.mts +85 -62
  238. package/resources/memberships.d.mts.map +1 -1
  239. package/resources/memberships.d.ts +85 -62
  240. package/resources/memberships.d.ts.map +1 -1
  241. package/resources/memberships.js +12 -8
  242. package/resources/memberships.js.map +1 -1
  243. package/resources/memberships.mjs +12 -8
  244. package/resources/memberships.mjs.map +1 -1
  245. package/resources/messages.d.mts +53 -35
  246. package/resources/messages.d.mts.map +1 -1
  247. package/resources/messages.d.ts +53 -35
  248. package/resources/messages.d.ts.map +1 -1
  249. package/resources/messages.js +9 -5
  250. package/resources/messages.js.map +1 -1
  251. package/resources/messages.mjs +9 -5
  252. package/resources/messages.mjs.map +1 -1
  253. package/resources/notifications.d.mts +33 -25
  254. package/resources/notifications.d.mts.map +1 -1
  255. package/resources/notifications.d.ts +33 -25
  256. package/resources/notifications.d.ts.map +1 -1
  257. package/resources/notifications.js +2 -1
  258. package/resources/notifications.js.map +1 -1
  259. package/resources/notifications.mjs +2 -1
  260. package/resources/notifications.mjs.map +1 -1
  261. package/resources/payment-methods.d.mts +212 -114
  262. package/resources/payment-methods.d.mts.map +1 -1
  263. package/resources/payment-methods.d.ts +212 -114
  264. package/resources/payment-methods.d.ts.map +1 -1
  265. package/resources/payment-methods.js +5 -10
  266. package/resources/payment-methods.js.map +1 -1
  267. package/resources/payment-methods.mjs +5 -10
  268. package/resources/payment-methods.mjs.map +1 -1
  269. package/resources/payments.d.mts +96 -56
  270. package/resources/payments.d.mts.map +1 -1
  271. package/resources/payments.d.ts +96 -56
  272. package/resources/payments.d.ts.map +1 -1
  273. package/resources/payments.js +23 -10
  274. package/resources/payments.js.map +1 -1
  275. package/resources/payments.mjs +23 -10
  276. package/resources/payments.mjs.map +1 -1
  277. package/resources/payout-methods.d.mts +50 -35
  278. package/resources/payout-methods.d.mts.map +1 -1
  279. package/resources/payout-methods.d.ts +50 -35
  280. package/resources/payout-methods.d.ts.map +1 -1
  281. package/resources/payout-methods.js +3 -2
  282. package/resources/payout-methods.js.map +1 -1
  283. package/resources/payout-methods.mjs +3 -2
  284. package/resources/payout-methods.mjs.map +1 -1
  285. package/resources/plans.d.mts +136 -95
  286. package/resources/plans.d.mts.map +1 -1
  287. package/resources/plans.d.ts +136 -95
  288. package/resources/plans.d.ts.map +1 -1
  289. package/resources/plans.js +9 -5
  290. package/resources/plans.js.map +1 -1
  291. package/resources/plans.mjs +9 -5
  292. package/resources/plans.mjs.map +1 -1
  293. package/resources/products.d.mts +80 -67
  294. package/resources/products.d.mts.map +1 -1
  295. package/resources/products.d.ts +80 -67
  296. package/resources/products.d.ts.map +1 -1
  297. package/resources/products.js +7 -5
  298. package/resources/products.js.map +1 -1
  299. package/resources/products.mjs +7 -5
  300. package/resources/products.mjs.map +1 -1
  301. package/resources/promo-codes.d.mts +60 -40
  302. package/resources/promo-codes.d.mts.map +1 -1
  303. package/resources/promo-codes.d.ts +60 -40
  304. package/resources/promo-codes.d.ts.map +1 -1
  305. package/resources/promo-codes.js +7 -4
  306. package/resources/promo-codes.js.map +1 -1
  307. package/resources/promo-codes.mjs +7 -4
  308. package/resources/promo-codes.mjs.map +1 -1
  309. package/resources/reactions.d.mts +25 -19
  310. package/resources/reactions.d.mts.map +1 -1
  311. package/resources/reactions.d.ts +25 -19
  312. package/resources/reactions.d.ts.map +1 -1
  313. package/resources/reactions.js +7 -4
  314. package/resources/reactions.js.map +1 -1
  315. package/resources/reactions.mjs +7 -4
  316. package/resources/reactions.mjs.map +1 -1
  317. package/resources/refunds.d.mts +57 -39
  318. package/resources/refunds.d.mts.map +1 -1
  319. package/resources/refunds.d.ts +57 -39
  320. package/resources/refunds.d.ts.map +1 -1
  321. package/resources/refunds.js +3 -2
  322. package/resources/refunds.js.map +1 -1
  323. package/resources/refunds.mjs +3 -2
  324. package/resources/refunds.mjs.map +1 -1
  325. package/resources/reviews.d.mts +76 -60
  326. package/resources/reviews.d.mts.map +1 -1
  327. package/resources/reviews.d.ts +76 -60
  328. package/resources/reviews.d.ts.map +1 -1
  329. package/resources/reviews.js +3 -2
  330. package/resources/reviews.js.map +1 -1
  331. package/resources/reviews.mjs +3 -2
  332. package/resources/reviews.mjs.map +1 -1
  333. package/resources/setup-intents.d.mts +77 -61
  334. package/resources/setup-intents.d.mts.map +1 -1
  335. package/resources/setup-intents.d.ts +77 -61
  336. package/resources/setup-intents.d.ts.map +1 -1
  337. package/resources/setup-intents.js +4 -10
  338. package/resources/setup-intents.js.map +1 -1
  339. package/resources/setup-intents.mjs +4 -10
  340. package/resources/setup-intents.mjs.map +1 -1
  341. package/resources/shared.d.mts +854 -509
  342. package/resources/shared.d.mts.map +1 -1
  343. package/resources/shared.d.ts +854 -509
  344. package/resources/shared.d.ts.map +1 -1
  345. package/resources/shipments.d.mts +30 -21
  346. package/resources/shipments.d.mts.map +1 -1
  347. package/resources/shipments.d.ts +30 -21
  348. package/resources/shipments.d.ts.map +1 -1
  349. package/resources/shipments.js +5 -3
  350. package/resources/shipments.js.map +1 -1
  351. package/resources/shipments.mjs +5 -3
  352. package/resources/shipments.mjs.map +1 -1
  353. package/resources/support-channels.d.mts +28 -20
  354. package/resources/support-channels.d.mts.map +1 -1
  355. package/resources/support-channels.d.ts +28 -20
  356. package/resources/support-channels.d.ts.map +1 -1
  357. package/resources/support-channels.js +5 -4
  358. package/resources/support-channels.js.map +1 -1
  359. package/resources/support-channels.mjs +5 -4
  360. package/resources/support-channels.mjs.map +1 -1
  361. package/resources/topups.d.mts +13 -9
  362. package/resources/topups.d.mts.map +1 -1
  363. package/resources/topups.d.ts +13 -9
  364. package/resources/topups.d.ts.map +1 -1
  365. package/resources/topups.js +2 -1
  366. package/resources/topups.js.map +1 -1
  367. package/resources/topups.mjs +2 -1
  368. package/resources/topups.mjs.map +1 -1
  369. package/resources/transfers.d.mts +37 -28
  370. package/resources/transfers.d.mts.map +1 -1
  371. package/resources/transfers.d.ts +37 -28
  372. package/resources/transfers.d.ts.map +1 -1
  373. package/resources/transfers.js +5 -3
  374. package/resources/transfers.js.map +1 -1
  375. package/resources/transfers.mjs +5 -3
  376. package/resources/transfers.mjs.map +1 -1
  377. package/resources/users.d.mts +60 -18
  378. package/resources/users.d.mts.map +1 -1
  379. package/resources/users.d.ts +60 -18
  380. package/resources/users.d.ts.map +1 -1
  381. package/resources/users.js +13 -2
  382. package/resources/users.js.map +1 -1
  383. package/resources/users.mjs +13 -2
  384. package/resources/users.mjs.map +1 -1
  385. package/resources/verifications.d.mts +7 -5
  386. package/resources/verifications.d.mts.map +1 -1
  387. package/resources/verifications.d.ts +7 -5
  388. package/resources/verifications.d.ts.map +1 -1
  389. package/resources/verifications.js +1 -1
  390. package/resources/verifications.mjs +1 -1
  391. package/resources/webhooks.d.mts +188 -133
  392. package/resources/webhooks.d.mts.map +1 -1
  393. package/resources/webhooks.d.ts +188 -133
  394. package/resources/webhooks.d.ts.map +1 -1
  395. package/resources/webhooks.js +3 -2
  396. package/resources/webhooks.js.map +1 -1
  397. package/resources/webhooks.mjs +3 -2
  398. package/resources/webhooks.mjs.map +1 -1
  399. package/resources/withdrawals.d.mts +60 -47
  400. package/resources/withdrawals.d.mts.map +1 -1
  401. package/resources/withdrawals.d.ts +60 -47
  402. package/resources/withdrawals.d.ts.map +1 -1
  403. package/resources/withdrawals.js +3 -2
  404. package/resources/withdrawals.js.map +1 -1
  405. package/resources/withdrawals.mjs +3 -2
  406. package/resources/withdrawals.mjs.map +1 -1
  407. package/src/client.ts +33 -11
  408. package/src/resources/access-tokens.ts +37 -59
  409. package/src/resources/account-links.ts +15 -13
  410. package/src/resources/ai-chats.ts +76 -30
  411. package/src/resources/app-builds.ts +37 -35
  412. package/src/resources/apps.ts +89 -60
  413. package/src/resources/authorized-users.ts +38 -32
  414. package/src/resources/chat-channels.ts +28 -20
  415. package/src/resources/checkout-configurations.ts +76 -58
  416. package/src/resources/companies.ts +94 -57
  417. package/src/resources/company-token-transactions.ts +91 -68
  418. package/src/resources/course-chapters.ts +27 -22
  419. package/src/resources/course-lesson-interactions.ts +7 -6
  420. package/src/resources/course-lessons.ts +141 -99
  421. package/src/resources/course-students.ts +44 -35
  422. package/src/resources/courses.ts +140 -99
  423. package/src/resources/disputes.ts +176 -120
  424. package/src/resources/dm-channels.ts +29 -16
  425. package/src/resources/dm-members.ts +30 -21
  426. package/src/resources/entries.ts +35 -27
  427. package/src/resources/experiences.ts +58 -49
  428. package/src/resources/fee-markups.ts +38 -27
  429. package/src/resources/files.ts +23 -19
  430. package/src/resources/forum-posts.ts +69 -45
  431. package/src/resources/forums.ts +21 -13
  432. package/src/resources/index.ts +4 -2
  433. package/src/resources/invoices.ts +140 -100
  434. package/src/resources/leads.ts +76 -54
  435. package/src/resources/ledger-accounts.ts +19 -15
  436. package/src/resources/members.ts +27 -28
  437. package/src/resources/memberships.ts +86 -62
  438. package/src/resources/messages.ts +53 -35
  439. package/src/resources/notifications.ts +33 -25
  440. package/src/resources/payment-methods.ts +212 -114
  441. package/src/resources/payments.ts +103 -55
  442. package/src/resources/payout-methods.ts +50 -35
  443. package/src/resources/plans.ts +136 -95
  444. package/src/resources/products.ts +219 -70
  445. package/src/resources/promo-codes.ts +60 -40
  446. package/src/resources/reactions.ts +25 -19
  447. package/src/resources/refunds.ts +59 -39
  448. package/src/resources/reviews.ts +76 -60
  449. package/src/resources/setup-intents.ts +77 -61
  450. package/src/resources/shared.ts +2797 -508
  451. package/src/resources/shipments.ts +30 -21
  452. package/src/resources/support-channels.ts +28 -20
  453. package/src/resources/topups.ts +13 -9
  454. package/src/resources/transfers.ts +37 -28
  455. package/src/resources/users.ts +72 -18
  456. package/src/resources/verifications.ts +7 -5
  457. package/src/resources/webhooks.ts +188 -133
  458. package/src/resources/withdrawals.ts +60 -46
  459. package/src/version.ts +1 -1
  460. package/version.d.mts +1 -1
  461. package/version.d.ts +1 -1
  462. package/version.js +1 -1
  463. package/version.mjs +1 -1
@@ -23,7 +23,7 @@ export declare class Withdrawals extends APIResource {
23
23
  */
24
24
  create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<Withdrawal>;
25
25
  /**
26
- * Retrieves a withdrawal by ID
26
+ * Retrieves the details of an existing withdrawal.
27
27
  *
28
28
  * Required permissions:
29
29
  *
@@ -39,7 +39,8 @@ export declare class Withdrawals extends APIResource {
39
39
  */
40
40
  retrieve(id: string, options?: RequestOptions): APIPromise<Withdrawal>;
41
41
  /**
42
- * Lists withdrawals
42
+ * Returns a paginated list of withdrawals for a company, with optional sorting and
43
+ * date filtering.
43
44
  *
44
45
  * Required permissions:
45
46
  *
@@ -59,40 +60,44 @@ export declare class Withdrawals extends APIResource {
59
60
  }
60
61
  export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
61
62
  /**
62
- * A withdrawal request.
63
+ * A withdrawal represents a request to transfer funds from a ledger account to an
64
+ * external payout method.
63
65
  */
64
66
  export interface Withdrawal {
65
67
  /**
66
- * Internal ID of the withdrawal request.
68
+ * The unique identifier for the withdrawal.
67
69
  */
68
70
  id: string;
69
71
  /**
70
- * How much money was attempted to be withdrawn, in a float type.
72
+ * The withdrawal amount as a decimal number in the specified currency (e.g.,
73
+ * 100.00 for $100.00 USD).
71
74
  */
72
75
  amount: number;
73
76
  /**
74
- * When the withdrawal request was created.
77
+ * The datetime the withdrawal was created.
75
78
  */
76
79
  created_at: string;
77
80
  /**
78
- * The currency of the withdrawal request.
81
+ * The three-letter ISO currency code for this withdrawal (e.g., 'usd', 'eur').
79
82
  */
80
83
  currency: Shared.Currency;
81
84
  /**
82
85
  * The different error codes a payout can be in.
83
86
  */
84
- error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_mailing_address' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
87
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_mailing_address' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | 'payout_provider_timeout' | null;
85
88
  /**
86
- * The error message for the withdrawal, if any.
89
+ * A human-readable message describing why the payout failed. Null if no error
90
+ * occurred.
87
91
  */
88
92
  error_message: string | null;
89
93
  /**
90
- * The estimated availability date for the withdrawal, if any.
94
+ * The estimated time at which the funds become available in the destination
95
+ * account. Null if no estimate is available. As a Unix timestamp.
91
96
  */
92
97
  estimated_availability: string | null;
93
98
  /**
94
- * The fee amount that was charged for the withdrawal. This is in the same currency
95
- * as the withdrawal amount.
99
+ * The fee charged for processing this withdrawal, in the same currency as the
100
+ * withdrawal amount.
96
101
  */
97
102
  fee_amount: number;
98
103
  /**
@@ -100,71 +105,77 @@ export interface Withdrawal {
100
105
  */
101
106
  fee_type: WithdrawalFeeTypes | null;
102
107
  /**
103
- * The ledger account associated with the withdrawal.
108
+ * The ledger account from which the withdrawal funds are sourced.
104
109
  */
105
110
  ledger_account: Withdrawal.LedgerAccount;
106
111
  /**
107
- * The markup fee that was charged for the withdrawal. This is in the same currency
108
- * as the withdrawal amount. This only applies to platform accounts using Whop
109
- * Rails.
112
+ * An additional markup fee charged for the withdrawal, in the same currency as the
113
+ * withdrawal amount. Only applies to platform accounts using Whop Rails.
110
114
  */
111
115
  markup_fee: number;
112
116
  /**
113
- * The payout token used for the withdrawal, if applicable.
117
+ * The saved payout destination used for this withdrawal (e.g., a bank account or
118
+ * PayPal address). Null if no payout token was used.
114
119
  */
115
120
  payout_token: Withdrawal.PayoutToken | null;
116
121
  /**
117
- * The speed of the withdrawal.
122
+ * The processing speed selected for this withdrawal ('standard' or 'instant').
118
123
  */
119
124
  speed: WithdrawalSpeeds;
120
125
  /**
121
- * Status of the withdrawal.
126
+ * The computed lifecycle status of the withdrawal, accounting for the state of
127
+ * associated payouts (e.g., 'requested', 'in_transit', 'completed', 'failed').
122
128
  */
123
129
  status: WithdrawalStatus;
124
130
  /**
125
- * The trace code for the payout, if applicable. Provided on ACH transactions when
126
- * available.
131
+ * The ACH trace number for tracking the payout through the banking network. Null
132
+ * if not available or not an ACH transaction.
127
133
  */
128
134
  trace_code: string | null;
129
135
  }
130
136
  export declare namespace Withdrawal {
131
137
  /**
132
- * The ledger account associated with the withdrawal.
138
+ * The ledger account from which the withdrawal funds are sourced.
133
139
  */
134
140
  interface LedgerAccount {
135
141
  /**
136
- * The ID of the LedgerAccount.
142
+ * The unique identifier for the ledger account.
137
143
  */
138
144
  id: string;
139
145
  /**
140
- * The ID of the company associated with this ledger account.
146
+ * Represents a unique identifier that is Base64 obfuscated. It is often used to
147
+ * refetch an object or as key for a cache. The ID type appears in a JSON response
148
+ * as a String; however, it is not intended to be human-readable. When expected as
149
+ * an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`)
150
+ * input value will be accepted as an ID.
141
151
  */
142
152
  company_id: string | null;
143
153
  }
144
154
  /**
145
- * The payout token used for the withdrawal, if applicable.
155
+ * The saved payout destination used for this withdrawal (e.g., a bank account or
156
+ * PayPal address). Null if no payout token was used.
146
157
  */
147
158
  interface PayoutToken {
148
159
  /**
149
- * The ID of the payout token
160
+ * The unique identifier for the payout token.
150
161
  */
151
162
  id: string;
152
163
  /**
153
- * The date and time the payout token was created
164
+ * The datetime the payout token was created.
154
165
  */
155
166
  created_at: string;
156
167
  /**
157
- * The currency code of the payout destination. This is the currency that payouts
158
- * will be made in for this token.
168
+ * The three-letter ISO currency code that payouts are delivered in for this
169
+ * destination.
159
170
  */
160
171
  destination_currency_code: string;
161
172
  /**
162
- * An optional nickname for the payout token to help the user identify it. This is
163
- * not used by the provider and is only for the user's reference.
173
+ * A user-defined label to help identify this payout destination. Not sent to the
174
+ * provider. Null if no nickname has been set.
164
175
  */
165
176
  nickname: string | null;
166
177
  /**
167
- * The name of the payer associated with the payout token.
178
+ * The legal name of the account holder receiving payouts. Null if not provided.
168
179
  */
169
180
  payer_name: string | null;
170
181
  }
@@ -182,28 +193,30 @@ export type WithdrawalSpeeds = 'standard' | 'instant';
182
193
  */
183
194
  export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
184
195
  /**
185
- * A withdrawal request.
196
+ * A withdrawal represents a request to transfer funds from a ledger account to an
197
+ * external payout method.
186
198
  */
187
199
  export interface WithdrawalListResponse {
188
200
  /**
189
- * Internal ID of the withdrawal request.
201
+ * The unique identifier for the withdrawal.
190
202
  */
191
203
  id: string;
192
204
  /**
193
- * How much money was attempted to be withdrawn, in a float type.
205
+ * The withdrawal amount as a decimal number in the specified currency (e.g.,
206
+ * 100.00 for $100.00 USD).
194
207
  */
195
208
  amount: number;
196
209
  /**
197
- * When the withdrawal request was created.
210
+ * The datetime the withdrawal was created.
198
211
  */
199
212
  created_at: string;
200
213
  /**
201
- * The currency of the withdrawal request.
214
+ * The three-letter ISO currency code for this withdrawal (e.g., 'usd', 'eur').
202
215
  */
203
216
  currency: Shared.Currency;
204
217
  /**
205
- * The fee amount that was charged for the withdrawal. This is in the same currency
206
- * as the withdrawal amount.
218
+ * The fee charged for processing this withdrawal, in the same currency as the
219
+ * withdrawal amount.
207
220
  */
208
221
  fee_amount: number;
209
222
  /**
@@ -211,17 +224,17 @@ export interface WithdrawalListResponse {
211
224
  */
212
225
  fee_type: WithdrawalFeeTypes | null;
213
226
  /**
214
- * The markup fee that was charged for the withdrawal. This is in the same currency
215
- * as the withdrawal amount. This only applies to platform accounts using Whop
216
- * Rails.
227
+ * An additional markup fee charged for the withdrawal, in the same currency as the
228
+ * withdrawal amount. Only applies to platform accounts using Whop Rails.
217
229
  */
218
230
  markup_fee: number;
219
231
  /**
220
- * The speed of the withdrawal.
232
+ * The processing speed selected for this withdrawal ('standard' or 'instant').
221
233
  */
222
234
  speed: WithdrawalSpeeds;
223
235
  /**
224
- * Status of the withdrawal.
236
+ * The computed lifecycle status of the withdrawal, accounting for the state of
237
+ * associated payouts (e.g., 'requested', 'in_transit', 'completed', 'failed').
225
238
  */
226
239
  status: WithdrawalStatus;
227
240
  }
@@ -254,7 +267,7 @@ export interface WithdrawalCreateParams {
254
267
  }
255
268
  export interface WithdrawalListParams extends CursorPageParams {
256
269
  /**
257
- * The ID of the company to list withdrawals for
270
+ * The unique identifier of the company to list withdrawals for.
258
271
  */
259
272
  company_id: string;
260
273
  /**
@@ -262,11 +275,11 @@ export interface WithdrawalListParams extends CursorPageParams {
262
275
  */
263
276
  before?: string | null;
264
277
  /**
265
- * The minimum creation date to filter by
278
+ * Only return withdrawals created after this timestamp.
266
279
  */
267
280
  created_after?: string | null;
268
281
  /**
269
- * The maximum creation date to filter by
282
+ * Only return withdrawals created before this timestamp.
270
283
  */
271
284
  created_before?: string | null;
272
285
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAItF;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAItE;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAAK,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;CAG1E;AAED,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC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EAAE,MAAM,CAAC,QAAQ,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -27,7 +27,7 @@ class Withdrawals extends resource_1.APIResource {
27
27
  return this._client.post('/withdrawals', { body, ...options });
28
28
  }
29
29
  /**
30
- * Retrieves a withdrawal by ID
30
+ * Retrieves the details of an existing withdrawal.
31
31
  *
32
32
  * Required permissions:
33
33
  *
@@ -45,7 +45,8 @@ class Withdrawals extends resource_1.APIResource {
45
45
  return this._client.get((0, path_1.path) `/withdrawals/${id}`, options);
46
46
  }
47
47
  /**
48
- * Lists withdrawals
48
+ * Returns a paginated list of withdrawals for a company, with optional sorting and
49
+ * date filtering.
49
50
  *
50
51
  * Required permissions:
51
52
  *
@@ -1 +1 @@
1
- {"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AAhED,kCAgEC"}
1
+ {"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AAjED,kCAiEC"}
@@ -24,7 +24,7 @@ export class Withdrawals extends APIResource {
24
24
  return this._client.post('/withdrawals', { body, ...options });
25
25
  }
26
26
  /**
27
- * Retrieves a withdrawal by ID
27
+ * Retrieves the details of an existing withdrawal.
28
28
  *
29
29
  * Required permissions:
30
30
  *
@@ -42,7 +42,8 @@ export class Withdrawals extends APIResource {
42
42
  return this._client.get(path `/withdrawals/${id}`, options);
43
43
  }
44
44
  /**
45
- * Lists withdrawals
45
+ * Returns a paginated list of withdrawals for a company, with optional sorting and
46
+ * date filtering.
46
47
  *
47
48
  * Required permissions:
48
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"withdrawals.mjs","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,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EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -78,12 +78,12 @@ import {
78
78
  CompanyUpdateParams,
79
79
  } from './resources/companies';
80
80
  import {
81
- BotTokenTransactionTypes,
82
81
  CompanyTokenTransaction,
83
82
  CompanyTokenTransactionCreateParams,
84
83
  CompanyTokenTransactionListParams,
85
84
  CompanyTokenTransactionListResponse,
86
85
  CompanyTokenTransactionListResponsesCursorPage,
86
+ CompanyTokenTransactionType,
87
87
  CompanyTokenTransactions,
88
88
  } from './resources/company-token-transactions';
89
89
  import {
@@ -302,6 +302,7 @@ import {
302
302
  Plans,
303
303
  } from './resources/plans';
304
304
  import {
305
+ IndustryGroups,
305
306
  ProductCreateParams,
306
307
  ProductDeleteResponse,
307
308
  ProductListParams,
@@ -378,9 +379,10 @@ import {
378
379
  Transfers,
379
380
  } from './resources/transfers';
380
381
  import {
382
+ User,
381
383
  UserCheckAccessParams,
382
384
  UserCheckAccessResponse,
383
- UserRetrieveResponse,
385
+ UserUpdateProfileParams,
384
386
  Users,
385
387
  } from './resources/users';
386
388
  import {
@@ -457,7 +459,7 @@ import { makeUserTokenVerifierFromSdk } from './lib/verify-user-token';
457
459
 
458
460
  export interface ClientOptions {
459
461
  /**
460
- * The app API key from an app from the /dashboard/developer page
462
+ * A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like `Bearer ***************************`
461
463
  */
462
464
  apiKey?: string | undefined;
463
465
 
@@ -547,7 +549,6 @@ export class Whop {
547
549
  apiKey: string;
548
550
  webhookKey: string | null;
549
551
  appID: string | null;
550
-
551
552
  baseURL: string;
552
553
  maxRetries: number;
553
554
  timeout: number;
@@ -879,7 +880,7 @@ export class Whop {
879
880
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
880
881
 
881
882
  const errText = await response.text().catch((err: any) => castToError(err).message);
882
- const errJSON = safeJSON(errText);
883
+ const errJSON = safeJSON(errText) as any;
883
884
  const errMessage = errJSON ? undefined : errText;
884
885
 
885
886
  loggerFor(this).debug(
@@ -916,9 +917,14 @@ export class Whop {
916
917
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
917
918
  path: string,
918
919
  Page: new (...args: any[]) => PageClass,
919
- opts?: RequestOptions,
920
+ opts?: PromiseOrValue<RequestOptions>,
920
921
  ): Pagination.PagePromise<PageClass, Item> {
921
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
922
+ return this.requestAPIList(
923
+ Page,
924
+ opts && 'then' in opts ?
925
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
926
+ : { method: 'get', path, ...opts },
927
+ );
922
928
  }
923
929
 
924
930
  requestAPIList<
@@ -926,7 +932,7 @@ export class Whop {
926
932
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
927
933
  >(
928
934
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
929
- options: FinalRequestOptions,
935
+ options: PromiseOrValue<FinalRequestOptions>,
930
936
  ): Pagination.PagePromise<PageClass, Item> {
931
937
  const request = this.makeRequest(options, null, undefined);
932
938
  return new Pagination.PagePromise<PageClass, Item>(this as any as Whop, request, Page);
@@ -939,7 +945,7 @@ export class Whop {
939
945
  controller: AbortController,
940
946
  ): Promise<Response> {
941
947
  const { signal, method, ...options } = init || {};
942
- const abort = controller.abort.bind(controller);
948
+ const abort = this._makeAbort(controller);
943
949
  if (signal) signal.addEventListener('abort', abort, { once: true });
944
950
 
945
951
  const timeout = setTimeout(abort, ms);
@@ -1110,6 +1116,12 @@ export class Whop {
1110
1116
  return headers.values;
1111
1117
  }
1112
1118
 
1119
+ private _makeAbort(controller: AbortController) {
1120
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
1121
+ // would capture all request options, and cause a memory leak.
1122
+ return () => controller.abort();
1123
+ }
1124
+
1113
1125
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
1114
1126
  bodyHeaders: HeadersLike;
1115
1127
  body: BodyInit | undefined;
@@ -1142,6 +1154,14 @@ export class Whop {
1142
1154
  (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
1143
1155
  ) {
1144
1156
  return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
1157
+ } else if (
1158
+ typeof body === 'object' &&
1159
+ headers.values.get('content-type') === 'application/x-www-form-urlencoded'
1160
+ ) {
1161
+ return {
1162
+ bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
1163
+ body: this.stringifyQuery(body as Record<string, unknown>),
1164
+ };
1145
1165
  } else {
1146
1166
  return this.#encoder({ body, headers });
1147
1167
  }
@@ -1299,6 +1319,7 @@ export declare namespace Whop {
1299
1319
 
1300
1320
  export {
1301
1321
  Products as Products,
1322
+ type IndustryGroups as IndustryGroups,
1302
1323
  type ProductDeleteResponse as ProductDeleteResponse,
1303
1324
  type ProductCreateParams as ProductCreateParams,
1304
1325
  type ProductUpdateParams as ProductUpdateParams,
@@ -1461,9 +1482,10 @@ export declare namespace Whop {
1461
1482
 
1462
1483
  export {
1463
1484
  Users as Users,
1464
- type UserRetrieveResponse as UserRetrieveResponse,
1485
+ type User as User,
1465
1486
  type UserCheckAccessResponse as UserCheckAccessResponse,
1466
1487
  type UserCheckAccessParams as UserCheckAccessParams,
1488
+ type UserUpdateProfileParams as UserUpdateProfileParams,
1467
1489
  };
1468
1490
 
1469
1491
  export {
@@ -1723,8 +1745,8 @@ export declare namespace Whop {
1723
1745
 
1724
1746
  export {
1725
1747
  CompanyTokenTransactions as CompanyTokenTransactions,
1726
- type BotTokenTransactionTypes as BotTokenTransactionTypes,
1727
1748
  type CompanyTokenTransaction as CompanyTokenTransaction,
1749
+ type CompanyTokenTransactionType as CompanyTokenTransactionType,
1728
1750
  type CompanyTokenTransactionListResponse as CompanyTokenTransactionListResponse,
1729
1751
  type CompanyTokenTransactionListResponsesCursorPage as CompanyTokenTransactionListResponsesCursorPage,
1730
1752
  type CompanyTokenTransactionCreateParams as CompanyTokenTransactionCreateParams,
@@ -6,89 +6,67 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class AccessTokens extends APIResource {
8
8
  /**
9
- * Create a short-lived access token to authenticate API requests on behalf of a
10
- * Company or User. This token should be used with Whop's web and mobile embedded
11
- * components. You must provide either a company_id or a user_id argument, but not
12
- * both.
9
+ * Create a short-lived access token for authenticating API requests. When using
10
+ * API key authentication, provide company_id or user_id. When using OAuth, the
11
+ * user is derived from the token. Use this token with Whop's web and mobile
12
+ * embedded components.
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
- * const accessToken = await client.accessTokens.create({
17
- * company_id: 'biz_xxxxxxxxxxxxxx',
18
- * });
16
+ * const accessToken = await client.accessTokens.create();
19
17
  * ```
20
18
  */
21
- create(body: AccessTokenCreateParams, options?: RequestOptions): APIPromise<AccessTokenCreateResponse> {
19
+ create(
20
+ body: AccessTokenCreateParams | null | undefined = {},
21
+ options?: RequestOptions,
22
+ ): APIPromise<AccessTokenCreateResponse> {
22
23
  return this._client.post('/access_tokens', { body, ...options });
23
24
  }
24
25
  }
25
26
 
26
27
  /**
27
- * An object representing an access token used for authenticating API requests.
28
+ * A short-lived access token used to authenticate API requests on behalf of a
29
+ * user.
28
30
  */
29
31
  export interface AccessTokenCreateResponse {
30
32
  /**
31
- * The JWT access token string.
33
+ * The signed JWT access token string to include in API request Authorization
34
+ * headers.
32
35
  */
33
36
  token: string;
34
37
 
35
38
  /**
36
- * The expiration timestamp of the access token.
39
+ * The timestamp after which this access token is no longer valid and must be
40
+ * refreshed.
37
41
  */
38
42
  expires_at: string;
39
43
  }
40
44
 
41
- export type AccessTokenCreateParams =
42
- | AccessTokenCreateParams.CreateAccessTokenInputWithCompanyID
43
- | AccessTokenCreateParams.CreateAccessTokenInputWithUserID;
44
-
45
- export declare namespace AccessTokenCreateParams {
46
- export interface CreateAccessTokenInputWithCompanyID {
47
- /**
48
- * The ID of the Company to generate the token for. The API key must have
49
- * permission to access this Company, such as the being the company the API key
50
- * belongs to or a sub-merchant of it
51
- */
52
- company_id: string;
53
-
54
- /**
55
- * The expiration timestamp for the access token. If not provided, a default
56
- * expiration time of 1 hour will be used. The expiration can be set to a maximum
57
- * of 3 hours from the current time.
58
- */
59
- expires_at?: string | null;
60
-
61
- /**
62
- * Array of desired scoped actions for the access token. If sent as an empty array
63
- * or not provided, all permissions from the API key making the request will be
64
- * available on the token. If sending an explicit list, they must be a subset of
65
- * the API keys's existing permissions. Otherwise, an error will be raised.
66
- */
67
- scoped_actions?: Array<string> | null;
68
- }
45
+ export interface AccessTokenCreateParams {
46
+ /**
47
+ * The unique identifier of the company to generate the token for, starting with
48
+ * 'biz\_'. The API key must have permission to access this company.
49
+ */
50
+ company_id?: string | null;
69
51
 
70
- export interface CreateAccessTokenInputWithUserID {
71
- /**
72
- * The ID of the User to generate the token for. The API key must have permission
73
- * to access this User.
74
- */
75
- user_id: string;
52
+ /**
53
+ * The expiration timestamp for the access token. Defaults to 1 hour from now, with
54
+ * a maximum of 3 hours.
55
+ */
56
+ expires_at?: string | null;
76
57
 
77
- /**
78
- * The expiration timestamp for the access token. If not provided, a default
79
- * expiration time of 1 hour will be used. The expiration can be set to a maximum
80
- * of 3 hours from the current time.
81
- */
82
- expires_at?: string | null;
58
+ /**
59
+ * An array of permission scopes to grant to the access token. If empty or omitted,
60
+ * all permissions from the authenticating credential are inherited. Must be a
61
+ * subset of the credential's permissions.
62
+ */
63
+ scoped_actions?: Array<string> | null;
83
64
 
84
- /**
85
- * Array of desired scoped actions for the access token. If sent as an empty array
86
- * or not provided, all permissions from the API key making the request will be
87
- * available on the token. If sending an explicit list, they must be a subset of
88
- * the API keys's existing permissions. Otherwise, an error will be raised.
89
- */
90
- scoped_actions?: Array<string> | null;
91
- }
65
+ /**
66
+ * The unique identifier of the user to generate the token for, starting with
67
+ * 'user\_'. The API key must have permission to access this user.
68
+ */
69
+ user_id?: string | null;
92
70
  }
93
71
 
94
72
  export declare namespace AccessTokens {