@whop/sdk 0.0.30 → 0.0.32

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 (505) hide show
  1. package/CHANGELOG.md +57 -105
  2. package/client.d.mts +165 -9
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +165 -9
  5. package/client.d.ts.map +1 -1
  6. package/client.js +164 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +164 -7
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +22 -22
  11. package/internal/utils/query.d.mts +2 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +2 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +10 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +6 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +7 -1
  25. package/resources/access-tokens.d.mts +3 -0
  26. package/resources/access-tokens.d.mts.map +1 -1
  27. package/resources/access-tokens.d.ts +3 -0
  28. package/resources/access-tokens.d.ts.map +1 -1
  29. package/resources/access-tokens.js +3 -0
  30. package/resources/access-tokens.js.map +1 -1
  31. package/resources/access-tokens.mjs +3 -0
  32. package/resources/access-tokens.mjs.map +1 -1
  33. package/resources/account-links.d.mts +3 -0
  34. package/resources/account-links.d.mts.map +1 -1
  35. package/resources/account-links.d.ts +3 -0
  36. package/resources/account-links.d.ts.map +1 -1
  37. package/resources/account-links.js +3 -0
  38. package/resources/account-links.js.map +1 -1
  39. package/resources/account-links.mjs +3 -0
  40. package/resources/account-links.mjs.map +1 -1
  41. package/resources/ai-chats.d.mts +12 -0
  42. package/resources/ai-chats.d.mts.map +1 -1
  43. package/resources/ai-chats.d.ts +12 -0
  44. package/resources/ai-chats.d.ts.map +1 -1
  45. package/resources/ai-chats.js +3 -0
  46. package/resources/ai-chats.js.map +1 -1
  47. package/resources/ai-chats.mjs +3 -0
  48. package/resources/ai-chats.mjs.map +1 -1
  49. package/resources/app-builds.d.mts +3 -0
  50. package/resources/app-builds.d.mts.map +1 -1
  51. package/resources/app-builds.d.ts +3 -0
  52. package/resources/app-builds.d.ts.map +1 -1
  53. package/resources/app-builds.js +3 -0
  54. package/resources/app-builds.js.map +1 -1
  55. package/resources/app-builds.mjs +3 -0
  56. package/resources/app-builds.mjs.map +1 -1
  57. package/resources/apps.d.mts +3 -0
  58. package/resources/apps.d.mts.map +1 -1
  59. package/resources/apps.d.ts +3 -0
  60. package/resources/apps.d.ts.map +1 -1
  61. package/resources/apps.js +3 -0
  62. package/resources/apps.js.map +1 -1
  63. package/resources/apps.mjs +3 -0
  64. package/resources/apps.mjs.map +1 -1
  65. package/resources/authorized-users.d.mts +88 -6
  66. package/resources/authorized-users.d.mts.map +1 -1
  67. package/resources/authorized-users.d.ts +88 -6
  68. package/resources/authorized-users.d.ts.map +1 -1
  69. package/resources/authorized-users.js +57 -0
  70. package/resources/authorized-users.js.map +1 -1
  71. package/resources/authorized-users.mjs +57 -0
  72. package/resources/authorized-users.mjs.map +1 -1
  73. package/resources/chat-channels.d.mts +3 -0
  74. package/resources/chat-channels.d.mts.map +1 -1
  75. package/resources/chat-channels.d.ts +3 -0
  76. package/resources/chat-channels.d.ts.map +1 -1
  77. package/resources/chat-channels.js +3 -0
  78. package/resources/chat-channels.js.map +1 -1
  79. package/resources/chat-channels.mjs +3 -0
  80. package/resources/chat-channels.mjs.map +1 -1
  81. package/resources/checkout-configurations.d.mts +3 -0
  82. package/resources/checkout-configurations.d.mts.map +1 -1
  83. package/resources/checkout-configurations.d.ts +3 -0
  84. package/resources/checkout-configurations.d.ts.map +1 -1
  85. package/resources/checkout-configurations.js +3 -0
  86. package/resources/checkout-configurations.js.map +1 -1
  87. package/resources/checkout-configurations.mjs +3 -0
  88. package/resources/checkout-configurations.mjs.map +1 -1
  89. package/resources/companies.d.mts +54 -1
  90. package/resources/companies.d.mts.map +1 -1
  91. package/resources/companies.d.ts +54 -1
  92. package/resources/companies.d.ts.map +1 -1
  93. package/resources/companies.js +3 -0
  94. package/resources/companies.js.map +1 -1
  95. package/resources/companies.mjs +3 -0
  96. package/resources/companies.mjs.map +1 -1
  97. package/resources/company-token-transactions.d.mts +3 -0
  98. package/resources/company-token-transactions.d.mts.map +1 -1
  99. package/resources/company-token-transactions.d.ts +3 -0
  100. package/resources/company-token-transactions.d.ts.map +1 -1
  101. package/resources/company-token-transactions.js +3 -0
  102. package/resources/company-token-transactions.js.map +1 -1
  103. package/resources/company-token-transactions.mjs +3 -0
  104. package/resources/company-token-transactions.mjs.map +1 -1
  105. package/resources/course-chapters.d.mts +3 -0
  106. package/resources/course-chapters.d.mts.map +1 -1
  107. package/resources/course-chapters.d.ts +3 -0
  108. package/resources/course-chapters.d.ts.map +1 -1
  109. package/resources/course-chapters.js +3 -0
  110. package/resources/course-chapters.js.map +1 -1
  111. package/resources/course-chapters.mjs +3 -0
  112. package/resources/course-chapters.mjs.map +1 -1
  113. package/resources/course-lesson-interactions.d.mts +3 -0
  114. package/resources/course-lesson-interactions.d.mts.map +1 -1
  115. package/resources/course-lesson-interactions.d.ts +3 -0
  116. package/resources/course-lesson-interactions.d.ts.map +1 -1
  117. package/resources/course-lesson-interactions.js +3 -0
  118. package/resources/course-lesson-interactions.js.map +1 -1
  119. package/resources/course-lesson-interactions.mjs +3 -0
  120. package/resources/course-lesson-interactions.mjs.map +1 -1
  121. package/resources/course-lessons.d.mts +3 -0
  122. package/resources/course-lessons.d.mts.map +1 -1
  123. package/resources/course-lessons.d.ts +3 -0
  124. package/resources/course-lessons.d.ts.map +1 -1
  125. package/resources/course-lessons.js +3 -0
  126. package/resources/course-lessons.js.map +1 -1
  127. package/resources/course-lessons.mjs +3 -0
  128. package/resources/course-lessons.mjs.map +1 -1
  129. package/resources/course-students.d.mts +3 -0
  130. package/resources/course-students.d.mts.map +1 -1
  131. package/resources/course-students.d.ts +3 -0
  132. package/resources/course-students.d.ts.map +1 -1
  133. package/resources/course-students.js +3 -0
  134. package/resources/course-students.js.map +1 -1
  135. package/resources/course-students.mjs +3 -0
  136. package/resources/course-students.mjs.map +1 -1
  137. package/resources/courses.d.mts +3 -0
  138. package/resources/courses.d.mts.map +1 -1
  139. package/resources/courses.d.ts +3 -0
  140. package/resources/courses.d.ts.map +1 -1
  141. package/resources/courses.js +3 -0
  142. package/resources/courses.js.map +1 -1
  143. package/resources/courses.mjs +3 -0
  144. package/resources/courses.mjs.map +1 -1
  145. package/resources/dispute-alerts.d.mts +3 -0
  146. package/resources/dispute-alerts.d.mts.map +1 -1
  147. package/resources/dispute-alerts.d.ts +3 -0
  148. package/resources/dispute-alerts.d.ts.map +1 -1
  149. package/resources/dispute-alerts.js +3 -0
  150. package/resources/dispute-alerts.js.map +1 -1
  151. package/resources/dispute-alerts.mjs +3 -0
  152. package/resources/dispute-alerts.mjs.map +1 -1
  153. package/resources/disputes.d.mts +3 -0
  154. package/resources/disputes.d.mts.map +1 -1
  155. package/resources/disputes.d.ts +3 -0
  156. package/resources/disputes.d.ts.map +1 -1
  157. package/resources/disputes.js +3 -0
  158. package/resources/disputes.js.map +1 -1
  159. package/resources/disputes.mjs +3 -0
  160. package/resources/disputes.mjs.map +1 -1
  161. package/resources/dm-channels.d.mts +3 -0
  162. package/resources/dm-channels.d.mts.map +1 -1
  163. package/resources/dm-channels.d.ts +3 -0
  164. package/resources/dm-channels.d.ts.map +1 -1
  165. package/resources/dm-channels.js +3 -0
  166. package/resources/dm-channels.js.map +1 -1
  167. package/resources/dm-channels.mjs +3 -0
  168. package/resources/dm-channels.mjs.map +1 -1
  169. package/resources/dm-members.d.mts +3 -0
  170. package/resources/dm-members.d.mts.map +1 -1
  171. package/resources/dm-members.d.ts +3 -0
  172. package/resources/dm-members.d.ts.map +1 -1
  173. package/resources/dm-members.js +3 -0
  174. package/resources/dm-members.js.map +1 -1
  175. package/resources/dm-members.mjs +3 -0
  176. package/resources/dm-members.mjs.map +1 -1
  177. package/resources/entries.d.mts +3 -0
  178. package/resources/entries.d.mts.map +1 -1
  179. package/resources/entries.d.ts +3 -0
  180. package/resources/entries.d.ts.map +1 -1
  181. package/resources/entries.js +3 -0
  182. package/resources/entries.js.map +1 -1
  183. package/resources/entries.mjs +3 -0
  184. package/resources/entries.mjs.map +1 -1
  185. package/resources/experiences.d.mts +3 -0
  186. package/resources/experiences.d.mts.map +1 -1
  187. package/resources/experiences.d.ts +3 -0
  188. package/resources/experiences.d.ts.map +1 -1
  189. package/resources/experiences.js +3 -0
  190. package/resources/experiences.js.map +1 -1
  191. package/resources/experiences.mjs +3 -0
  192. package/resources/experiences.mjs.map +1 -1
  193. package/resources/fee-markups.d.mts +3 -0
  194. package/resources/fee-markups.d.mts.map +1 -1
  195. package/resources/fee-markups.d.ts +3 -0
  196. package/resources/fee-markups.d.ts.map +1 -1
  197. package/resources/fee-markups.js +3 -0
  198. package/resources/fee-markups.js.map +1 -1
  199. package/resources/fee-markups.mjs +3 -0
  200. package/resources/fee-markups.mjs.map +1 -1
  201. package/resources/files.d.mts +3 -0
  202. package/resources/files.d.mts.map +1 -1
  203. package/resources/files.d.ts +3 -0
  204. package/resources/files.d.ts.map +1 -1
  205. package/resources/files.js +3 -0
  206. package/resources/files.js.map +1 -1
  207. package/resources/files.mjs +3 -0
  208. package/resources/files.mjs.map +1 -1
  209. package/resources/forum-posts.d.mts +38 -0
  210. package/resources/forum-posts.d.mts.map +1 -1
  211. package/resources/forum-posts.d.ts +38 -0
  212. package/resources/forum-posts.d.ts.map +1 -1
  213. package/resources/forum-posts.js +3 -0
  214. package/resources/forum-posts.js.map +1 -1
  215. package/resources/forum-posts.mjs +3 -0
  216. package/resources/forum-posts.mjs.map +1 -1
  217. package/resources/forums.d.mts +20 -0
  218. package/resources/forums.d.mts.map +1 -1
  219. package/resources/forums.d.ts +20 -0
  220. package/resources/forums.d.ts.map +1 -1
  221. package/resources/forums.js +3 -0
  222. package/resources/forums.js.map +1 -1
  223. package/resources/forums.mjs +3 -0
  224. package/resources/forums.mjs.map +1 -1
  225. package/resources/index.d.mts +5 -4
  226. package/resources/index.d.mts.map +1 -1
  227. package/resources/index.d.ts +5 -4
  228. package/resources/index.d.ts.map +1 -1
  229. package/resources/index.js +4 -1
  230. package/resources/index.js.map +1 -1
  231. package/resources/index.mjs +1 -0
  232. package/resources/index.mjs.map +1 -1
  233. package/resources/invoices.d.mts +141 -8
  234. package/resources/invoices.d.mts.map +1 -1
  235. package/resources/invoices.d.ts +141 -8
  236. package/resources/invoices.d.ts.map +1 -1
  237. package/resources/invoices.js +4 -4
  238. package/resources/invoices.js.map +1 -1
  239. package/resources/invoices.mjs +4 -4
  240. package/resources/invoices.mjs.map +1 -1
  241. package/resources/leads.d.mts +3 -0
  242. package/resources/leads.d.mts.map +1 -1
  243. package/resources/leads.d.ts +3 -0
  244. package/resources/leads.d.ts.map +1 -1
  245. package/resources/leads.js +3 -0
  246. package/resources/leads.js.map +1 -1
  247. package/resources/leads.mjs +3 -0
  248. package/resources/leads.mjs.map +1 -1
  249. package/resources/ledger-accounts.d.mts +3 -0
  250. package/resources/ledger-accounts.d.mts.map +1 -1
  251. package/resources/ledger-accounts.d.ts +3 -0
  252. package/resources/ledger-accounts.d.ts.map +1 -1
  253. package/resources/ledger-accounts.js +3 -0
  254. package/resources/ledger-accounts.js.map +1 -1
  255. package/resources/ledger-accounts.mjs +3 -0
  256. package/resources/ledger-accounts.mjs.map +1 -1
  257. package/resources/members.d.mts +3 -0
  258. package/resources/members.d.mts.map +1 -1
  259. package/resources/members.d.ts +3 -0
  260. package/resources/members.d.ts.map +1 -1
  261. package/resources/members.js +3 -0
  262. package/resources/members.js.map +1 -1
  263. package/resources/members.mjs +3 -0
  264. package/resources/members.mjs.map +1 -1
  265. package/resources/memberships.d.mts +81 -2
  266. package/resources/memberships.d.mts.map +1 -1
  267. package/resources/memberships.d.ts +81 -2
  268. package/resources/memberships.d.ts.map +1 -1
  269. package/resources/memberships.js +75 -1
  270. package/resources/memberships.js.map +1 -1
  271. package/resources/memberships.mjs +75 -1
  272. package/resources/memberships.mjs.map +1 -1
  273. package/resources/messages.d.mts +12 -0
  274. package/resources/messages.d.mts.map +1 -1
  275. package/resources/messages.d.ts +12 -0
  276. package/resources/messages.d.ts.map +1 -1
  277. package/resources/messages.js +3 -0
  278. package/resources/messages.js.map +1 -1
  279. package/resources/messages.mjs +3 -0
  280. package/resources/messages.mjs.map +1 -1
  281. package/resources/notifications.d.mts +3 -0
  282. package/resources/notifications.d.mts.map +1 -1
  283. package/resources/notifications.d.ts +3 -0
  284. package/resources/notifications.d.ts.map +1 -1
  285. package/resources/notifications.js +3 -0
  286. package/resources/notifications.js.map +1 -1
  287. package/resources/notifications.mjs +3 -0
  288. package/resources/notifications.mjs.map +1 -1
  289. package/resources/payment-methods.d.mts +3 -0
  290. package/resources/payment-methods.d.mts.map +1 -1
  291. package/resources/payment-methods.d.ts +3 -0
  292. package/resources/payment-methods.d.ts.map +1 -1
  293. package/resources/payment-methods.js +3 -0
  294. package/resources/payment-methods.js.map +1 -1
  295. package/resources/payment-methods.mjs +3 -0
  296. package/resources/payment-methods.mjs.map +1 -1
  297. package/resources/payments.d.mts +19 -2
  298. package/resources/payments.d.mts.map +1 -1
  299. package/resources/payments.d.ts +19 -2
  300. package/resources/payments.d.ts.map +1 -1
  301. package/resources/payments.js +3 -0
  302. package/resources/payments.js.map +1 -1
  303. package/resources/payments.mjs +3 -0
  304. package/resources/payments.mjs.map +1 -1
  305. package/resources/payout-methods.d.mts +3 -0
  306. package/resources/payout-methods.d.mts.map +1 -1
  307. package/resources/payout-methods.d.ts +3 -0
  308. package/resources/payout-methods.d.ts.map +1 -1
  309. package/resources/payout-methods.js +3 -0
  310. package/resources/payout-methods.js.map +1 -1
  311. package/resources/payout-methods.mjs +3 -0
  312. package/resources/payout-methods.mjs.map +1 -1
  313. package/resources/plans.d.mts +3 -0
  314. package/resources/plans.d.mts.map +1 -1
  315. package/resources/plans.d.ts +3 -0
  316. package/resources/plans.d.ts.map +1 -1
  317. package/resources/plans.js +3 -0
  318. package/resources/plans.js.map +1 -1
  319. package/resources/plans.mjs +3 -0
  320. package/resources/plans.mjs.map +1 -1
  321. package/resources/products.d.mts +13 -0
  322. package/resources/products.d.mts.map +1 -1
  323. package/resources/products.d.ts +13 -0
  324. package/resources/products.d.ts.map +1 -1
  325. package/resources/products.js +3 -0
  326. package/resources/products.js.map +1 -1
  327. package/resources/products.mjs +3 -0
  328. package/resources/products.mjs.map +1 -1
  329. package/resources/promo-codes.d.mts +3 -0
  330. package/resources/promo-codes.d.mts.map +1 -1
  331. package/resources/promo-codes.d.ts +3 -0
  332. package/resources/promo-codes.d.ts.map +1 -1
  333. package/resources/promo-codes.js +3 -0
  334. package/resources/promo-codes.js.map +1 -1
  335. package/resources/promo-codes.mjs +3 -0
  336. package/resources/promo-codes.mjs.map +1 -1
  337. package/resources/reactions.d.mts +3 -0
  338. package/resources/reactions.d.mts.map +1 -1
  339. package/resources/reactions.d.ts +3 -0
  340. package/resources/reactions.d.ts.map +1 -1
  341. package/resources/reactions.js +3 -0
  342. package/resources/reactions.js.map +1 -1
  343. package/resources/reactions.mjs +3 -0
  344. package/resources/reactions.mjs.map +1 -1
  345. package/resources/refunds.d.mts +17 -1
  346. package/resources/refunds.d.mts.map +1 -1
  347. package/resources/refunds.d.ts +17 -1
  348. package/resources/refunds.d.ts.map +1 -1
  349. package/resources/refunds.js +3 -0
  350. package/resources/refunds.js.map +1 -1
  351. package/resources/refunds.mjs +3 -0
  352. package/resources/refunds.mjs.map +1 -1
  353. package/resources/resolution-center-cases.d.mts +367 -0
  354. package/resources/resolution-center-cases.d.mts.map +1 -0
  355. package/resources/resolution-center-cases.d.ts +367 -0
  356. package/resources/resolution-center-cases.d.ts.map +1 -0
  357. package/resources/resolution-center-cases.js +38 -0
  358. package/resources/resolution-center-cases.js.map +1 -0
  359. package/resources/resolution-center-cases.mjs +34 -0
  360. package/resources/resolution-center-cases.mjs.map +1 -0
  361. package/resources/reviews.d.mts +3 -0
  362. package/resources/reviews.d.mts.map +1 -1
  363. package/resources/reviews.d.ts +3 -0
  364. package/resources/reviews.d.ts.map +1 -1
  365. package/resources/reviews.js +3 -0
  366. package/resources/reviews.js.map +1 -1
  367. package/resources/reviews.mjs +3 -0
  368. package/resources/reviews.mjs.map +1 -1
  369. package/resources/setup-intents.d.mts +3 -0
  370. package/resources/setup-intents.d.mts.map +1 -1
  371. package/resources/setup-intents.d.ts +3 -0
  372. package/resources/setup-intents.d.ts.map +1 -1
  373. package/resources/setup-intents.js +3 -0
  374. package/resources/setup-intents.js.map +1 -1
  375. package/resources/setup-intents.mjs +3 -0
  376. package/resources/setup-intents.mjs.map +1 -1
  377. package/resources/shared.d.mts +63 -9
  378. package/resources/shared.d.mts.map +1 -1
  379. package/resources/shared.d.ts +63 -9
  380. package/resources/shared.d.ts.map +1 -1
  381. package/resources/shipments.d.mts +3 -0
  382. package/resources/shipments.d.mts.map +1 -1
  383. package/resources/shipments.d.ts +3 -0
  384. package/resources/shipments.d.ts.map +1 -1
  385. package/resources/shipments.js +3 -0
  386. package/resources/shipments.js.map +1 -1
  387. package/resources/shipments.mjs +3 -0
  388. package/resources/shipments.mjs.map +1 -1
  389. package/resources/support-channels.d.mts +3 -0
  390. package/resources/support-channels.d.mts.map +1 -1
  391. package/resources/support-channels.d.ts +3 -0
  392. package/resources/support-channels.d.ts.map +1 -1
  393. package/resources/support-channels.js +3 -0
  394. package/resources/support-channels.js.map +1 -1
  395. package/resources/support-channels.mjs +3 -0
  396. package/resources/support-channels.mjs.map +1 -1
  397. package/resources/topups.d.mts +3 -0
  398. package/resources/topups.d.mts.map +1 -1
  399. package/resources/topups.d.ts +3 -0
  400. package/resources/topups.d.ts.map +1 -1
  401. package/resources/topups.js +3 -0
  402. package/resources/topups.js.map +1 -1
  403. package/resources/topups.mjs +3 -0
  404. package/resources/topups.mjs.map +1 -1
  405. package/resources/transfers.d.mts +3 -0
  406. package/resources/transfers.d.mts.map +1 -1
  407. package/resources/transfers.d.ts +3 -0
  408. package/resources/transfers.d.ts.map +1 -1
  409. package/resources/transfers.js +3 -0
  410. package/resources/transfers.js.map +1 -1
  411. package/resources/transfers.mjs +3 -0
  412. package/resources/transfers.mjs.map +1 -1
  413. package/resources/users.d.mts +3 -0
  414. package/resources/users.d.mts.map +1 -1
  415. package/resources/users.d.ts +3 -0
  416. package/resources/users.d.ts.map +1 -1
  417. package/resources/users.js +3 -0
  418. package/resources/users.js.map +1 -1
  419. package/resources/users.mjs +3 -0
  420. package/resources/users.mjs.map +1 -1
  421. package/resources/verifications.d.mts +3 -0
  422. package/resources/verifications.d.mts.map +1 -1
  423. package/resources/verifications.d.ts +3 -0
  424. package/resources/verifications.d.ts.map +1 -1
  425. package/resources/verifications.js +3 -0
  426. package/resources/verifications.js.map +1 -1
  427. package/resources/verifications.mjs +3 -0
  428. package/resources/verifications.mjs.map +1 -1
  429. package/resources/webhooks.d.mts +29 -0
  430. package/resources/webhooks.d.mts.map +1 -1
  431. package/resources/webhooks.d.ts +29 -0
  432. package/resources/webhooks.d.ts.map +1 -1
  433. package/resources/webhooks.js +3 -0
  434. package/resources/webhooks.js.map +1 -1
  435. package/resources/webhooks.mjs +3 -0
  436. package/resources/webhooks.mjs.map +1 -1
  437. package/resources/withdrawals.d.mts +3 -0
  438. package/resources/withdrawals.d.mts.map +1 -1
  439. package/resources/withdrawals.d.ts +3 -0
  440. package/resources/withdrawals.d.ts.map +1 -1
  441. package/resources/withdrawals.js +3 -0
  442. package/resources/withdrawals.js.map +1 -1
  443. package/resources/withdrawals.mjs +3 -0
  444. package/resources/withdrawals.mjs.map +1 -1
  445. package/src/client.ts +205 -12
  446. package/src/internal/utils/query.ts +7 -0
  447. package/src/internal/utils.ts +1 -0
  448. package/src/resources/access-tokens.ts +3 -0
  449. package/src/resources/account-links.ts +3 -0
  450. package/src/resources/ai-chats.ts +14 -0
  451. package/src/resources/app-builds.ts +3 -0
  452. package/src/resources/apps.ts +3 -0
  453. package/src/resources/authorized-users.ts +108 -6
  454. package/src/resources/chat-channels.ts +3 -0
  455. package/src/resources/checkout-configurations.ts +3 -0
  456. package/src/resources/companies.ts +72 -0
  457. package/src/resources/company-token-transactions.ts +3 -0
  458. package/src/resources/course-chapters.ts +3 -0
  459. package/src/resources/course-lesson-interactions.ts +3 -0
  460. package/src/resources/course-lessons.ts +3 -0
  461. package/src/resources/course-students.ts +3 -0
  462. package/src/resources/courses.ts +3 -0
  463. package/src/resources/dispute-alerts.ts +3 -0
  464. package/src/resources/disputes.ts +3 -0
  465. package/src/resources/dm-channels.ts +3 -0
  466. package/src/resources/dm-members.ts +3 -0
  467. package/src/resources/entries.ts +3 -0
  468. package/src/resources/experiences.ts +3 -0
  469. package/src/resources/fee-markups.ts +3 -0
  470. package/src/resources/files.ts +3 -0
  471. package/src/resources/forum-posts.ts +44 -0
  472. package/src/resources/forums.ts +22 -0
  473. package/src/resources/index.ts +19 -1
  474. package/src/resources/invoices.ts +162 -9
  475. package/src/resources/leads.ts +3 -0
  476. package/src/resources/ledger-accounts.ts +3 -0
  477. package/src/resources/members.ts +3 -0
  478. package/src/resources/memberships.ts +89 -1
  479. package/src/resources/messages.ts +14 -0
  480. package/src/resources/notifications.ts +3 -0
  481. package/src/resources/payment-methods.ts +3 -0
  482. package/src/resources/payments.ts +22 -0
  483. package/src/resources/payout-methods.ts +3 -0
  484. package/src/resources/plans.ts +3 -0
  485. package/src/resources/products.ts +15 -0
  486. package/src/resources/promo-codes.ts +3 -0
  487. package/src/resources/reactions.ts +3 -0
  488. package/src/resources/refunds.ts +21 -1
  489. package/src/resources/resolution-center-cases.ts +492 -0
  490. package/src/resources/reviews.ts +3 -0
  491. package/src/resources/setup-intents.ts +3 -0
  492. package/src/resources/shared.ts +74 -33
  493. package/src/resources/shipments.ts +3 -0
  494. package/src/resources/support-channels.ts +3 -0
  495. package/src/resources/topups.ts +3 -0
  496. package/src/resources/transfers.ts +3 -0
  497. package/src/resources/users.ts +3 -0
  498. package/src/resources/verifications.ts +3 -0
  499. package/src/resources/webhooks.ts +35 -0
  500. package/src/resources/withdrawals.ts +3 -0
  501. package/src/version.ts +1 -1
  502. package/version.d.mts +1 -1
  503. package/version.d.ts +1 -1
  504. package/version.js +1 -1
  505. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
11
11
  import { getPlatformHeaders } from './internal/detect-platform';
12
12
  import * as Shims from './internal/shims';
13
13
  import * as Opts from './internal/request-options';
14
- import * as qs from './internal/qs';
14
+ import { stringifyQuery } from './internal/utils/query';
15
15
  import { VERSION } from './version';
16
16
  import * as Errors from './core/error';
17
17
  import * as Pagination from './core/pagination';
@@ -48,10 +48,13 @@ import {
48
48
  Apps,
49
49
  } from './resources/apps';
50
50
  import {
51
+ AuthorizedUser,
52
+ AuthorizedUserCreateParams,
53
+ AuthorizedUserDeleteParams,
54
+ AuthorizedUserDeleteResponse,
51
55
  AuthorizedUserListParams,
52
56
  AuthorizedUserListResponse,
53
57
  AuthorizedUserListResponsesCursorPage,
54
- AuthorizedUserRetrieveResponse,
55
58
  AuthorizedUsers,
56
59
  } from './resources/authorized-users';
57
60
  import {
@@ -76,6 +79,7 @@ import {
76
79
  CompanyListResponse,
77
80
  CompanyListResponsesCursorPage,
78
81
  CompanyUpdateParams,
82
+ SocialLinkWebsites,
79
83
  } from './resources/companies';
80
84
  import {
81
85
  CompanyTokenTransaction,
@@ -248,6 +252,7 @@ import {
248
252
  } from './resources/members';
249
253
  import {
250
254
  CancelOptions,
255
+ MembershipAddFreeDaysParams,
251
256
  MembershipCancelParams,
252
257
  MembershipListParams,
253
258
  MembershipListResponse,
@@ -291,6 +296,7 @@ import {
291
296
  PaymentMethodTypes,
292
297
  PaymentRefundParams,
293
298
  Payments,
299
+ ReceiptTaxBehavior,
294
300
  } from './resources/payments';
295
301
  import {
296
302
  PayoutDestinationCategory,
@@ -347,6 +353,18 @@ import {
347
353
  RefundStatus,
348
354
  Refunds,
349
355
  } from './resources/refunds';
356
+ import {
357
+ ResolutionCenterCaseCustomerResponse,
358
+ ResolutionCenterCaseIssueType,
359
+ ResolutionCenterCaseListParams,
360
+ ResolutionCenterCaseListResponse,
361
+ ResolutionCenterCaseListResponsesCursorPage,
362
+ ResolutionCenterCaseMerchantResponse,
363
+ ResolutionCenterCasePlatformResponse,
364
+ ResolutionCenterCaseRetrieveResponse,
365
+ ResolutionCenterCaseStatus,
366
+ ResolutionCenterCases,
367
+ } from './resources/resolution-center-cases';
350
368
  import {
351
369
  ReviewListParams,
352
370
  ReviewListResponse,
@@ -666,8 +684,8 @@ export class Whop {
666
684
  return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
667
685
  }
668
686
 
669
- protected stringifyQuery(query: Record<string, unknown>): string {
670
- return qs.stringify(query, { arrayFormat: 'brackets' });
687
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
688
+ return stringifyQuery(query);
671
689
  }
672
690
 
673
691
  private getUserAgent(): string {
@@ -699,12 +717,13 @@ export class Whop {
699
717
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
700
718
 
701
719
  const defaultQuery = this.defaultQuery();
702
- if (!isEmptyObj(defaultQuery)) {
703
- query = { ...defaultQuery, ...query };
720
+ const pathQuery = Object.fromEntries(url.searchParams);
721
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
722
+ query = { ...pathQuery, ...defaultQuery, ...query };
704
723
  }
705
724
 
706
725
  if (typeof query === 'object' && query && !Array.isArray(query)) {
707
- url.search = this.stringifyQuery(query as Record<string, unknown>);
726
+ url.search = this.stringifyQuery(query);
708
727
  }
709
728
 
710
729
  return url.toString();
@@ -1033,9 +1052,9 @@ export class Whop {
1033
1052
  }
1034
1053
  }
1035
1054
 
1036
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
1037
- // just do what it says, but otherwise calculate a default
1038
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
1055
+ // If the API asks us to wait a certain amount of time, just do what it
1056
+ // says, but otherwise calculate a default
1057
+ if (timeoutMillis === undefined) {
1039
1058
  const maxRetries = options.maxRetries ?? this.maxRetries;
1040
1059
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
1041
1060
  }
@@ -1168,7 +1187,7 @@ export class Whop {
1168
1187
  ) {
1169
1188
  return {
1170
1189
  bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
1171
- body: this.stringifyQuery(body as Record<string, unknown>),
1190
+ body: this.stringifyQuery(body),
1172
1191
  };
1173
1192
  } else {
1174
1193
  return this.#encoder({ body, headers });
@@ -1196,56 +1215,210 @@ export class Whop {
1196
1215
 
1197
1216
  static toFile = Uploads.toFile;
1198
1217
 
1218
+ /**
1219
+ * Apps
1220
+ */
1199
1221
  apps: API.Apps = new API.Apps(this);
1222
+ /**
1223
+ * Invoices
1224
+ */
1200
1225
  invoices: API.Invoices = new API.Invoices(this);
1226
+ /**
1227
+ * Course lesson interactions
1228
+ */
1201
1229
  courseLessonInteractions: API.CourseLessonInteractions = new API.CourseLessonInteractions(this);
1230
+ /**
1231
+ * Products
1232
+ */
1202
1233
  products: API.Products = new API.Products(this);
1234
+ /**
1235
+ * Companies
1236
+ */
1203
1237
  companies: API.Companies = new API.Companies(this);
1238
+ /**
1239
+ * Webhooks
1240
+ */
1204
1241
  webhooks: API.Webhooks = new API.Webhooks(this);
1242
+ /**
1243
+ * Plans
1244
+ */
1205
1245
  plans: API.Plans = new API.Plans(this);
1246
+ /**
1247
+ * Entries
1248
+ */
1206
1249
  entries: API.Entries = new API.Entries(this);
1250
+ /**
1251
+ * Forum posts
1252
+ */
1207
1253
  forumPosts: API.ForumPosts = new API.ForumPosts(this);
1254
+ /**
1255
+ * Transfers
1256
+ */
1208
1257
  transfers: API.Transfers = new API.Transfers(this);
1258
+ /**
1259
+ * Ledger accounts
1260
+ */
1209
1261
  ledgerAccounts: API.LedgerAccounts = new API.LedgerAccounts(this);
1262
+ /**
1263
+ * Memberships
1264
+ */
1210
1265
  memberships: API.Memberships = new API.Memberships(this);
1266
+ /**
1267
+ * Authorized users
1268
+ */
1211
1269
  authorizedUsers: API.AuthorizedUsers = new API.AuthorizedUsers(this);
1270
+ /**
1271
+ * App builds
1272
+ */
1212
1273
  appBuilds: API.AppBuilds = new API.AppBuilds(this);
1274
+ /**
1275
+ * Shipments
1276
+ */
1213
1277
  shipments: API.Shipments = new API.Shipments(this);
1278
+ /**
1279
+ * Checkout configurations
1280
+ */
1214
1281
  checkoutConfigurations: API.CheckoutConfigurations = new API.CheckoutConfigurations(this);
1282
+ /**
1283
+ * Messages
1284
+ */
1215
1285
  messages: API.Messages = new API.Messages(this);
1286
+ /**
1287
+ * Chat channels
1288
+ */
1216
1289
  chatChannels: API.ChatChannels = new API.ChatChannels(this);
1290
+ /**
1291
+ * Users
1292
+ */
1217
1293
  users: API.Users = new API.Users(this);
1294
+ /**
1295
+ * Payments
1296
+ */
1218
1297
  payments: API.Payments = new API.Payments(this);
1298
+ /**
1299
+ * Support channels
1300
+ */
1219
1301
  supportChannels: API.SupportChannels = new API.SupportChannels(this);
1302
+ /**
1303
+ * Experiences
1304
+ */
1220
1305
  experiences: API.Experiences = new API.Experiences(this);
1306
+ /**
1307
+ * Reactions
1308
+ */
1221
1309
  reactions: API.Reactions = new API.Reactions(this);
1310
+ /**
1311
+ * Members
1312
+ */
1222
1313
  members: API.Members = new API.Members(this);
1314
+ /**
1315
+ * Forums
1316
+ */
1223
1317
  forums: API.Forums = new API.Forums(this);
1318
+ /**
1319
+ * Promo codes
1320
+ */
1224
1321
  promoCodes: API.PromoCodes = new API.PromoCodes(this);
1322
+ /**
1323
+ * Courses
1324
+ */
1225
1325
  courses: API.Courses = new API.Courses(this);
1326
+ /**
1327
+ * Course chapters
1328
+ */
1226
1329
  courseChapters: API.CourseChapters = new API.CourseChapters(this);
1330
+ /**
1331
+ * Course lessons
1332
+ */
1227
1333
  courseLessons: API.CourseLessons = new API.CourseLessons(this);
1334
+ /**
1335
+ * Reviews
1336
+ */
1228
1337
  reviews: API.Reviews = new API.Reviews(this);
1338
+ /**
1339
+ * Course students
1340
+ */
1229
1341
  courseStudents: API.CourseStudents = new API.CourseStudents(this);
1342
+ /**
1343
+ * Access tokens
1344
+ */
1230
1345
  accessTokens: API.AccessTokens = new API.AccessTokens(this);
1346
+ /**
1347
+ * Notifications
1348
+ */
1231
1349
  notifications: API.Notifications = new API.Notifications(this);
1350
+ /**
1351
+ * Disputes
1352
+ */
1232
1353
  disputes: API.Disputes = new API.Disputes(this);
1354
+ /**
1355
+ * Refunds
1356
+ */
1233
1357
  refunds: API.Refunds = new API.Refunds(this);
1358
+ /**
1359
+ * Withdrawals
1360
+ */
1234
1361
  withdrawals: API.Withdrawals = new API.Withdrawals(this);
1362
+ /**
1363
+ * Account links
1364
+ */
1235
1365
  accountLinks: API.AccountLinks = new API.AccountLinks(this);
1366
+ /**
1367
+ * Setup intents
1368
+ */
1236
1369
  setupIntents: API.SetupIntents = new API.SetupIntents(this);
1370
+ /**
1371
+ * Payment methods
1372
+ */
1237
1373
  paymentMethods: API.PaymentMethods = new API.PaymentMethods(this);
1374
+ /**
1375
+ * Fee markups
1376
+ */
1238
1377
  feeMarkups: API.FeeMarkups = new API.FeeMarkups(this);
1378
+ /**
1379
+ * Payout methods
1380
+ */
1239
1381
  payoutMethods: API.PayoutMethods = new API.PayoutMethods(this);
1382
+ /**
1383
+ * Verifications
1384
+ */
1240
1385
  verifications: API.Verifications = new API.Verifications(this);
1386
+ /**
1387
+ * Leads
1388
+ */
1241
1389
  leads: API.Leads = new API.Leads(this);
1390
+ /**
1391
+ * Topups
1392
+ */
1242
1393
  topups: API.Topups = new API.Topups(this);
1394
+ /**
1395
+ * Files
1396
+ */
1243
1397
  files: API.Files = new API.Files(this);
1398
+ /**
1399
+ * Company token transactions
1400
+ */
1244
1401
  companyTokenTransactions: API.CompanyTokenTransactions = new API.CompanyTokenTransactions(this);
1402
+ /**
1403
+ * Dm members
1404
+ */
1245
1405
  dmMembers: API.DmMembers = new API.DmMembers(this);
1406
+ /**
1407
+ * Ai chats
1408
+ */
1246
1409
  aiChats: API.AIChats = new API.AIChats(this);
1410
+ /**
1411
+ * Dm channels
1412
+ */
1247
1413
  dmChannels: API.DmChannels = new API.DmChannels(this);
1414
+ /**
1415
+ * Dispute alerts
1416
+ */
1248
1417
  disputeAlerts: API.DisputeAlerts = new API.DisputeAlerts(this);
1418
+ /**
1419
+ * Resolution center cases
1420
+ */
1421
+ resolutionCenterCases: API.ResolutionCenterCases = new API.ResolutionCenterCases(this);
1249
1422
  }
1250
1423
 
1251
1424
  Whop.Apps = Apps;
@@ -1298,6 +1471,7 @@ Whop.DmMembers = DmMembers;
1298
1471
  Whop.AIChats = AIChats;
1299
1472
  Whop.DmChannels = DmChannels;
1300
1473
  Whop.DisputeAlerts = DisputeAlerts;
1474
+ Whop.ResolutionCenterCases = ResolutionCenterCases;
1301
1475
 
1302
1476
  export declare namespace Whop {
1303
1477
  export type RequestOptions = Opts.RequestOptions;
@@ -1337,6 +1511,7 @@ export declare namespace Whop {
1337
1511
 
1338
1512
  export {
1339
1513
  Companies as Companies,
1514
+ type SocialLinkWebsites as SocialLinkWebsites,
1340
1515
  type CompanyListResponse as CompanyListResponse,
1341
1516
  type CompanyListResponsesCursorPage as CompanyListResponsesCursorPage,
1342
1517
  type CompanyCreateParams as CompanyCreateParams,
@@ -1435,16 +1610,20 @@ export declare namespace Whop {
1435
1610
  type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
1436
1611
  type MembershipUpdateParams as MembershipUpdateParams,
1437
1612
  type MembershipListParams as MembershipListParams,
1613
+ type MembershipAddFreeDaysParams as MembershipAddFreeDaysParams,
1438
1614
  type MembershipCancelParams as MembershipCancelParams,
1439
1615
  type MembershipPauseParams as MembershipPauseParams,
1440
1616
  };
1441
1617
 
1442
1618
  export {
1443
1619
  AuthorizedUsers as AuthorizedUsers,
1444
- type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
1620
+ type AuthorizedUser as AuthorizedUser,
1445
1621
  type AuthorizedUserListResponse as AuthorizedUserListResponse,
1622
+ type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
1446
1623
  type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
1624
+ type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
1447
1625
  type AuthorizedUserListParams as AuthorizedUserListParams,
1626
+ type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
1448
1627
  };
1449
1628
 
1450
1629
  export {
@@ -1503,6 +1682,7 @@ export declare namespace Whop {
1503
1682
  type BillingReasons as BillingReasons,
1504
1683
  type CardBrands as CardBrands,
1505
1684
  type PaymentMethodTypes as PaymentMethodTypes,
1685
+ type ReceiptTaxBehavior as ReceiptTaxBehavior,
1506
1686
  type PaymentListResponse as PaymentListResponse,
1507
1687
  type PaymentListFeesResponse as PaymentListFeesResponse,
1508
1688
  type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
@@ -1807,6 +1987,19 @@ export declare namespace Whop {
1807
1987
  type DisputeAlertListParams as DisputeAlertListParams,
1808
1988
  };
1809
1989
 
1990
+ export {
1991
+ ResolutionCenterCases as ResolutionCenterCases,
1992
+ type ResolutionCenterCaseCustomerResponse as ResolutionCenterCaseCustomerResponse,
1993
+ type ResolutionCenterCaseIssueType as ResolutionCenterCaseIssueType,
1994
+ type ResolutionCenterCaseMerchantResponse as ResolutionCenterCaseMerchantResponse,
1995
+ type ResolutionCenterCasePlatformResponse as ResolutionCenterCasePlatformResponse,
1996
+ type ResolutionCenterCaseStatus as ResolutionCenterCaseStatus,
1997
+ type ResolutionCenterCaseRetrieveResponse as ResolutionCenterCaseRetrieveResponse,
1998
+ type ResolutionCenterCaseListResponse as ResolutionCenterCaseListResponse,
1999
+ type ResolutionCenterCaseListResponsesCursorPage as ResolutionCenterCaseListResponsesCursorPage,
2000
+ type ResolutionCenterCaseListParams as ResolutionCenterCaseListParams,
2001
+ };
2002
+
1810
2003
  export type AccessLevel = API.AccessLevel;
1811
2004
  export type AccessPassType = API.AccessPassType;
1812
2005
  export type App = API.App;
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import * as qs from '../qs/stringify';
4
+
5
+ export function stringifyQuery(query: object | Record<string, unknown>) {
6
+ return qs.stringify(query, { arrayFormat: 'brackets' });
7
+ }
@@ -6,3 +6,4 @@ export * from './utils/env';
6
6
  export * from './utils/log';
7
7
  export * from './utils/uuid';
8
8
  export * from './utils/sleep';
9
+ export * from './utils/query';
@@ -4,6 +4,9 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * Access tokens
9
+ */
7
10
  export class AccessTokens extends APIResource {
8
11
  /**
9
12
  * Create a short-lived access token for authenticating API requests. When using
@@ -4,6 +4,9 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * Account links
9
+ */
7
10
  export class AccountLinks extends APIResource {
8
11
  /**
9
12
  * Generate a URL that directs a sub-merchant to their account portal, such as the
@@ -6,6 +6,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
6
6
  import { RequestOptions } from '../internal/request-options';
7
7
  import { path } from '../internal/utils/path';
8
8
 
9
+ /**
10
+ * Ai chats
11
+ */
9
12
  export class AIChats extends APIResource {
10
13
  /**
11
14
  * Create a new AI chat thread and send the first message to the AI agent.
@@ -212,6 +215,12 @@ export interface AIChatCreateParams {
212
215
  */
213
216
  message_source?: 'manual' | 'suggestion' | 'link' | null;
214
217
 
218
+ /**
219
+ * The type of suggestion prompt that was clicked, when message_source is
220
+ * 'suggestion'.
221
+ */
222
+ suggestion_type?: string | null;
223
+
215
224
  /**
216
225
  * An optional display title for the AI chat thread (e.g., "Help with billing").
217
226
  */
@@ -258,6 +267,11 @@ export interface AIChatListParams extends CursorPageParams {
258
267
  * Returns the last _n_ elements from the list.
259
268
  */
260
269
  last?: number | null;
270
+
271
+ /**
272
+ * When true, returns only chats with an active cron schedule
273
+ */
274
+ only_active_crons?: boolean | null;
261
275
  }
262
276
 
263
277
  export declare namespace AIChats {
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
7
7
  import { RequestOptions } from '../internal/request-options';
8
8
  import { path } from '../internal/utils/path';
9
9
 
10
+ /**
11
+ * App builds
12
+ */
10
13
  export class AppBuilds extends APIResource {
11
14
  /**
12
15
  * Upload a new build artifact for an app. The build must include a compiled code
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
7
7
  import { RequestOptions } from '../internal/request-options';
8
8
  import { path } from '../internal/utils/path';
9
9
 
10
+ /**
11
+ * Apps
12
+ */
10
13
  export class Apps extends APIResource {
11
14
  /**
12
15
  * Register a new app on the Whop developer platform. Apps provide custom
@@ -7,7 +7,31 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
7
7
  import { RequestOptions } from '../internal/request-options';
8
8
  import { path } from '../internal/utils/path';
9
9
 
10
+ /**
11
+ * Authorized users
12
+ */
10
13
  export class AuthorizedUsers extends APIResource {
14
+ /**
15
+ * Add a new authorized user to a company.
16
+ *
17
+ * Required permissions:
18
+ *
19
+ * - `authorized_user:create`
20
+ * - `member:email:read`
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const authorizedUser = await client.authorizedUsers.create({
25
+ * company_id: 'biz_xxxxxxxxxxxxxx',
26
+ * role: 'owner',
27
+ * user_id: 'user_xxxxxxxxxxxxx',
28
+ * });
29
+ * ```
30
+ */
31
+ create(body: AuthorizedUserCreateParams, options?: RequestOptions): APIPromise<AuthorizedUser> {
32
+ return this._client.post('/authorized_users', { body, ...options });
33
+ }
34
+
11
35
  /**
12
36
  * Retrieves the details of an existing authorized user.
13
37
  *
@@ -15,8 +39,16 @@ export class AuthorizedUsers extends APIResource {
15
39
  *
16
40
  * - `company:authorized_user:read`
17
41
  * - `member:email:read`
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const authorizedUser =
46
+ * await client.authorizedUsers.retrieve(
47
+ * 'ausr_xxxxxxxxxxxxx',
48
+ * );
49
+ * ```
18
50
  */
19
- retrieve(id: string, options?: RequestOptions): APIPromise<AuthorizedUserRetrieveResponse> {
51
+ retrieve(id: string, options?: RequestOptions): APIPromise<AuthorizedUser> {
20
52
  return this._client.get(path`/authorized_users/${id}`, options);
21
53
  }
22
54
 
@@ -28,6 +60,14 @@ export class AuthorizedUsers extends APIResource {
28
60
  *
29
61
  * - `company:authorized_user:read`
30
62
  * - `member:email:read`
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * // Automatically fetches more pages as needed.
67
+ * for await (const authorizedUserListResponse of client.authorizedUsers.list()) {
68
+ * // ...
69
+ * }
70
+ * ```
31
71
  */
32
72
  list(
33
73
  query: AuthorizedUserListParams | null | undefined = {},
@@ -38,6 +78,29 @@ export class AuthorizedUsers extends APIResource {
38
78
  ...options,
39
79
  });
40
80
  }
81
+
82
+ /**
83
+ * Remove an authorized user from a company.
84
+ *
85
+ * Required permissions:
86
+ *
87
+ * - `authorized_user:delete`
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const authorizedUser = await client.authorizedUsers.delete(
92
+ * 'ausr_xxxxxxxxxxxxx',
93
+ * );
94
+ * ```
95
+ */
96
+ delete(
97
+ id: string,
98
+ params: AuthorizedUserDeleteParams | null | undefined = {},
99
+ options?: RequestOptions,
100
+ ): APIPromise<AuthorizedUserDeleteResponse> {
101
+ const { company_id } = params ?? {};
102
+ return this._client.delete(path`/authorized_users/${id}`, { query: { company_id }, ...options });
103
+ }
41
104
  }
42
105
 
43
106
  export type AuthorizedUserListResponsesCursorPage = CursorPage<AuthorizedUserListResponse>;
@@ -46,7 +109,7 @@ export type AuthorizedUserListResponsesCursorPage = CursorPage<AuthorizedUserLis
46
109
  * A user who has been granted administrative access to manage a company's
47
110
  * dashboard and settings.
48
111
  */
49
- export interface AuthorizedUserRetrieveResponse {
112
+ export interface AuthorizedUser {
50
113
  /**
51
114
  * The unique identifier for the authorized user.
52
115
  */
@@ -55,7 +118,7 @@ export interface AuthorizedUserRetrieveResponse {
55
118
  /**
56
119
  * The company this authorized user has access to.
57
120
  */
58
- company: AuthorizedUserRetrieveResponse.Company;
121
+ company: AuthorizedUser.Company;
59
122
 
60
123
  /**
61
124
  * The permission role assigned to this authorized user within the company.
@@ -65,10 +128,10 @@ export interface AuthorizedUserRetrieveResponse {
65
128
  /**
66
129
  * The user account linked to this authorized user record.
67
130
  */
68
- user: AuthorizedUserRetrieveResponse.User;
131
+ user: AuthorizedUser.User;
69
132
  }
70
133
 
71
- export namespace AuthorizedUserRetrieveResponse {
134
+ export namespace AuthorizedUser {
72
135
  /**
73
136
  * The company this authorized user has access to.
74
137
  */
@@ -180,6 +243,34 @@ export namespace AuthorizedUserListResponse {
180
243
  }
181
244
  }
182
245
 
246
+ /**
247
+ * Represents `true` or `false` values.
248
+ */
249
+ export type AuthorizedUserDeleteResponse = boolean;
250
+
251
+ export interface AuthorizedUserCreateParams {
252
+ /**
253
+ * The ID of the company to add the authorized user to.
254
+ */
255
+ company_id: string;
256
+
257
+ /**
258
+ * The role to assign to the authorized user within the company. Supported roles:
259
+ * 'moderator', 'sales_manager'.
260
+ */
261
+ role: Shared.AuthorizedUserRoles;
262
+
263
+ /**
264
+ * The ID of the user to add as an authorized user.
265
+ */
266
+ user_id: string;
267
+
268
+ /**
269
+ * Whether to send notification emails to the user on creation.
270
+ */
271
+ send_emails?: boolean | null;
272
+ }
273
+
183
274
  export interface AuthorizedUserListParams extends CursorPageParams {
184
275
  /**
185
276
  * Returns the elements in the list that come before the specified cursor.
@@ -223,11 +314,22 @@ export interface AuthorizedUserListParams extends CursorPageParams {
223
314
  user_id?: string | null;
224
315
  }
225
316
 
317
+ export interface AuthorizedUserDeleteParams {
318
+ /**
319
+ * The ID of the company the authorized user belongs to. Optional if the authorized
320
+ * user ID is provided.
321
+ */
322
+ company_id?: string | null;
323
+ }
324
+
226
325
  export declare namespace AuthorizedUsers {
227
326
  export {
228
- type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
327
+ type AuthorizedUser as AuthorizedUser,
229
328
  type AuthorizedUserListResponse as AuthorizedUserListResponse,
329
+ type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
230
330
  type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
331
+ type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
231
332
  type AuthorizedUserListParams as AuthorizedUserListParams,
333
+ type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
232
334
  };
233
335
  }
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
7
7
  import { RequestOptions } from '../internal/request-options';
8
8
  import { path } from '../internal/utils/path';
9
9
 
10
+ /**
11
+ * Chat channels
12
+ */
10
13
  export class ChatChannels extends APIResource {
11
14
  /**
12
15
  * Retrieves the details of an existing chat channel.
@@ -8,6 +8,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
8
8
  import { RequestOptions } from '../internal/request-options';
9
9
  import { path } from '../internal/utils/path';
10
10
 
11
+ /**
12
+ * Checkout configurations
13
+ */
11
14
  export class CheckoutConfigurations extends APIResource {
12
15
  /**
13
16
  * Creates a new checkout configuration