@whop/sdk 0.0.29 → 0.0.31

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 (494) hide show
  1. package/CHANGELOG.md +48 -99
  2. package/client.d.mts +161 -13
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +161 -13
  5. package/client.d.ts.map +1 -1
  6. package/client.js +158 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +158 -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 +8 -0
  42. package/resources/ai-chats.d.mts.map +1 -1
  43. package/resources/ai-chats.d.ts +8 -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 +142 -1
  66. package/resources/authorized-users.d.mts.map +1 -1
  67. package/resources/authorized-users.d.ts +142 -1
  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 -13
  82. package/resources/checkout-configurations.d.mts.map +1 -1
  83. package/resources/checkout-configurations.d.ts +3 -13
  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 -34
  90. package/resources/companies.d.mts.map +1 -1
  91. package/resources/companies.d.ts +54 -34
  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 -5
  226. package/resources/index.d.mts.map +1 -1
  227. package/resources/index.d.ts +5 -5
  228. package/resources/index.d.ts.map +1 -1
  229. package/resources/index.js.map +1 -1
  230. package/resources/index.mjs.map +1 -1
  231. package/resources/invoices.d.mts +141 -8
  232. package/resources/invoices.d.mts.map +1 -1
  233. package/resources/invoices.d.ts +141 -8
  234. package/resources/invoices.d.ts.map +1 -1
  235. package/resources/invoices.js +4 -4
  236. package/resources/invoices.js.map +1 -1
  237. package/resources/invoices.mjs +4 -4
  238. package/resources/invoices.mjs.map +1 -1
  239. package/resources/leads.d.mts +3 -0
  240. package/resources/leads.d.mts.map +1 -1
  241. package/resources/leads.d.ts +3 -0
  242. package/resources/leads.d.ts.map +1 -1
  243. package/resources/leads.js +3 -0
  244. package/resources/leads.js.map +1 -1
  245. package/resources/leads.mjs +3 -0
  246. package/resources/leads.mjs.map +1 -1
  247. package/resources/ledger-accounts.d.mts +3 -0
  248. package/resources/ledger-accounts.d.mts.map +1 -1
  249. package/resources/ledger-accounts.d.ts +3 -0
  250. package/resources/ledger-accounts.d.ts.map +1 -1
  251. package/resources/ledger-accounts.js +3 -0
  252. package/resources/ledger-accounts.js.map +1 -1
  253. package/resources/ledger-accounts.mjs +3 -0
  254. package/resources/ledger-accounts.mjs.map +1 -1
  255. package/resources/members.d.mts +3 -0
  256. package/resources/members.d.mts.map +1 -1
  257. package/resources/members.d.ts +3 -0
  258. package/resources/members.d.ts.map +1 -1
  259. package/resources/members.js +3 -0
  260. package/resources/members.js.map +1 -1
  261. package/resources/members.mjs +3 -0
  262. package/resources/members.mjs.map +1 -1
  263. package/resources/memberships.d.mts +81 -2
  264. package/resources/memberships.d.mts.map +1 -1
  265. package/resources/memberships.d.ts +81 -2
  266. package/resources/memberships.d.ts.map +1 -1
  267. package/resources/memberships.js +75 -1
  268. package/resources/memberships.js.map +1 -1
  269. package/resources/memberships.mjs +75 -1
  270. package/resources/memberships.mjs.map +1 -1
  271. package/resources/messages.d.mts +12 -0
  272. package/resources/messages.d.mts.map +1 -1
  273. package/resources/messages.d.ts +12 -0
  274. package/resources/messages.d.ts.map +1 -1
  275. package/resources/messages.js +3 -0
  276. package/resources/messages.js.map +1 -1
  277. package/resources/messages.mjs +3 -0
  278. package/resources/messages.mjs.map +1 -1
  279. package/resources/notifications.d.mts +3 -0
  280. package/resources/notifications.d.mts.map +1 -1
  281. package/resources/notifications.d.ts +3 -0
  282. package/resources/notifications.d.ts.map +1 -1
  283. package/resources/notifications.js +3 -0
  284. package/resources/notifications.js.map +1 -1
  285. package/resources/notifications.mjs +3 -0
  286. package/resources/notifications.mjs.map +1 -1
  287. package/resources/payment-methods.d.mts +3 -0
  288. package/resources/payment-methods.d.mts.map +1 -1
  289. package/resources/payment-methods.d.ts +3 -0
  290. package/resources/payment-methods.d.ts.map +1 -1
  291. package/resources/payment-methods.js +3 -0
  292. package/resources/payment-methods.js.map +1 -1
  293. package/resources/payment-methods.mjs +3 -0
  294. package/resources/payment-methods.mjs.map +1 -1
  295. package/resources/payments.d.mts +19 -15
  296. package/resources/payments.d.mts.map +1 -1
  297. package/resources/payments.d.ts +19 -15
  298. package/resources/payments.d.ts.map +1 -1
  299. package/resources/payments.js +3 -0
  300. package/resources/payments.js.map +1 -1
  301. package/resources/payments.mjs +3 -0
  302. package/resources/payments.mjs.map +1 -1
  303. package/resources/payout-methods.d.mts +3 -0
  304. package/resources/payout-methods.d.mts.map +1 -1
  305. package/resources/payout-methods.d.ts +3 -0
  306. package/resources/payout-methods.d.ts.map +1 -1
  307. package/resources/payout-methods.js +3 -0
  308. package/resources/payout-methods.js.map +1 -1
  309. package/resources/payout-methods.mjs +3 -0
  310. package/resources/payout-methods.mjs.map +1 -1
  311. package/resources/plans.d.mts +3 -0
  312. package/resources/plans.d.mts.map +1 -1
  313. package/resources/plans.d.ts +3 -0
  314. package/resources/plans.d.ts.map +1 -1
  315. package/resources/plans.js +3 -0
  316. package/resources/plans.js.map +1 -1
  317. package/resources/plans.mjs +3 -0
  318. package/resources/plans.mjs.map +1 -1
  319. package/resources/products.d.mts +4 -29
  320. package/resources/products.d.mts.map +1 -1
  321. package/resources/products.d.ts +4 -29
  322. package/resources/products.d.ts.map +1 -1
  323. package/resources/products.js +3 -0
  324. package/resources/products.js.map +1 -1
  325. package/resources/products.mjs +3 -0
  326. package/resources/products.mjs.map +1 -1
  327. package/resources/promo-codes.d.mts +3 -0
  328. package/resources/promo-codes.d.mts.map +1 -1
  329. package/resources/promo-codes.d.ts +3 -0
  330. package/resources/promo-codes.d.ts.map +1 -1
  331. package/resources/promo-codes.js +3 -0
  332. package/resources/promo-codes.js.map +1 -1
  333. package/resources/promo-codes.mjs +3 -0
  334. package/resources/promo-codes.mjs.map +1 -1
  335. package/resources/reactions.d.mts +3 -0
  336. package/resources/reactions.d.mts.map +1 -1
  337. package/resources/reactions.d.ts +3 -0
  338. package/resources/reactions.d.ts.map +1 -1
  339. package/resources/reactions.js +3 -0
  340. package/resources/reactions.js.map +1 -1
  341. package/resources/reactions.mjs +3 -0
  342. package/resources/reactions.mjs.map +1 -1
  343. package/resources/refunds.d.mts +17 -1
  344. package/resources/refunds.d.mts.map +1 -1
  345. package/resources/refunds.d.ts +17 -1
  346. package/resources/refunds.d.ts.map +1 -1
  347. package/resources/refunds.js +3 -0
  348. package/resources/refunds.js.map +1 -1
  349. package/resources/refunds.mjs +3 -0
  350. package/resources/refunds.mjs.map +1 -1
  351. package/resources/reviews.d.mts +3 -0
  352. package/resources/reviews.d.mts.map +1 -1
  353. package/resources/reviews.d.ts +3 -0
  354. package/resources/reviews.d.ts.map +1 -1
  355. package/resources/reviews.js +3 -0
  356. package/resources/reviews.js.map +1 -1
  357. package/resources/reviews.mjs +3 -0
  358. package/resources/reviews.mjs.map +1 -1
  359. package/resources/setup-intents.d.mts +3 -0
  360. package/resources/setup-intents.d.mts.map +1 -1
  361. package/resources/setup-intents.d.ts +3 -0
  362. package/resources/setup-intents.d.ts.map +1 -1
  363. package/resources/setup-intents.js +3 -0
  364. package/resources/setup-intents.js.map +1 -1
  365. package/resources/setup-intents.mjs +3 -0
  366. package/resources/setup-intents.mjs.map +1 -1
  367. package/resources/shared.d.mts +55 -34
  368. package/resources/shared.d.mts.map +1 -1
  369. package/resources/shared.d.ts +55 -34
  370. package/resources/shared.d.ts.map +1 -1
  371. package/resources/shipments.d.mts +3 -0
  372. package/resources/shipments.d.mts.map +1 -1
  373. package/resources/shipments.d.ts +3 -0
  374. package/resources/shipments.d.ts.map +1 -1
  375. package/resources/shipments.js +3 -0
  376. package/resources/shipments.js.map +1 -1
  377. package/resources/shipments.mjs +3 -0
  378. package/resources/shipments.mjs.map +1 -1
  379. package/resources/support-channels.d.mts +3 -0
  380. package/resources/support-channels.d.mts.map +1 -1
  381. package/resources/support-channels.d.ts +3 -0
  382. package/resources/support-channels.d.ts.map +1 -1
  383. package/resources/support-channels.js +3 -0
  384. package/resources/support-channels.js.map +1 -1
  385. package/resources/support-channels.mjs +3 -0
  386. package/resources/support-channels.mjs.map +1 -1
  387. package/resources/topups.d.mts +3 -0
  388. package/resources/topups.d.mts.map +1 -1
  389. package/resources/topups.d.ts +3 -0
  390. package/resources/topups.d.ts.map +1 -1
  391. package/resources/topups.js +3 -0
  392. package/resources/topups.js.map +1 -1
  393. package/resources/topups.mjs +3 -0
  394. package/resources/topups.mjs.map +1 -1
  395. package/resources/transfers.d.mts +3 -0
  396. package/resources/transfers.d.mts.map +1 -1
  397. package/resources/transfers.d.ts +3 -0
  398. package/resources/transfers.d.ts.map +1 -1
  399. package/resources/transfers.js +3 -0
  400. package/resources/transfers.js.map +1 -1
  401. package/resources/transfers.mjs +3 -0
  402. package/resources/transfers.mjs.map +1 -1
  403. package/resources/users.d.mts +3 -0
  404. package/resources/users.d.mts.map +1 -1
  405. package/resources/users.d.ts +3 -0
  406. package/resources/users.d.ts.map +1 -1
  407. package/resources/users.js +3 -0
  408. package/resources/users.js.map +1 -1
  409. package/resources/users.mjs +3 -0
  410. package/resources/users.mjs.map +1 -1
  411. package/resources/verifications.d.mts +3 -0
  412. package/resources/verifications.d.mts.map +1 -1
  413. package/resources/verifications.d.ts +3 -0
  414. package/resources/verifications.d.ts.map +1 -1
  415. package/resources/verifications.js +3 -0
  416. package/resources/verifications.js.map +1 -1
  417. package/resources/verifications.mjs +3 -0
  418. package/resources/verifications.mjs.map +1 -1
  419. package/resources/webhooks.d.mts +29 -0
  420. package/resources/webhooks.d.mts.map +1 -1
  421. package/resources/webhooks.d.ts +29 -0
  422. package/resources/webhooks.d.ts.map +1 -1
  423. package/resources/webhooks.js +3 -0
  424. package/resources/webhooks.js.map +1 -1
  425. package/resources/webhooks.mjs +3 -0
  426. package/resources/webhooks.mjs.map +1 -1
  427. package/resources/withdrawals.d.mts +3 -0
  428. package/resources/withdrawals.d.mts.map +1 -1
  429. package/resources/withdrawals.d.ts +3 -0
  430. package/resources/withdrawals.d.ts.map +1 -1
  431. package/resources/withdrawals.js +3 -0
  432. package/resources/withdrawals.js.map +1 -1
  433. package/resources/withdrawals.mjs +3 -0
  434. package/resources/withdrawals.mjs.map +1 -1
  435. package/src/client.ts +175 -14
  436. package/src/internal/utils/query.ts +7 -0
  437. package/src/internal/utils.ts +1 -0
  438. package/src/resources/access-tokens.ts +3 -0
  439. package/src/resources/account-links.ts +3 -0
  440. package/src/resources/ai-chats.ts +9 -0
  441. package/src/resources/app-builds.ts +3 -0
  442. package/src/resources/apps.ts +3 -0
  443. package/src/resources/authorized-users.ts +175 -0
  444. package/src/resources/chat-channels.ts +3 -0
  445. package/src/resources/checkout-configurations.ts +3 -16
  446. package/src/resources/companies.ts +72 -41
  447. package/src/resources/company-token-transactions.ts +3 -0
  448. package/src/resources/course-chapters.ts +3 -0
  449. package/src/resources/course-lesson-interactions.ts +3 -0
  450. package/src/resources/course-lessons.ts +3 -0
  451. package/src/resources/course-students.ts +3 -0
  452. package/src/resources/courses.ts +3 -0
  453. package/src/resources/dispute-alerts.ts +3 -0
  454. package/src/resources/disputes.ts +3 -0
  455. package/src/resources/dm-channels.ts +3 -0
  456. package/src/resources/dm-members.ts +3 -0
  457. package/src/resources/entries.ts +3 -0
  458. package/src/resources/experiences.ts +3 -0
  459. package/src/resources/fee-markups.ts +3 -0
  460. package/src/resources/files.ts +3 -0
  461. package/src/resources/forum-posts.ts +44 -0
  462. package/src/resources/forums.ts +22 -0
  463. package/src/resources/index.ts +7 -1
  464. package/src/resources/invoices.ts +162 -9
  465. package/src/resources/leads.ts +3 -0
  466. package/src/resources/ledger-accounts.ts +3 -0
  467. package/src/resources/members.ts +3 -0
  468. package/src/resources/memberships.ts +89 -1
  469. package/src/resources/messages.ts +14 -0
  470. package/src/resources/notifications.ts +3 -0
  471. package/src/resources/payment-methods.ts +3 -0
  472. package/src/resources/payments.ts +22 -16
  473. package/src/resources/payout-methods.ts +3 -0
  474. package/src/resources/plans.ts +3 -0
  475. package/src/resources/products.ts +3 -174
  476. package/src/resources/promo-codes.ts +3 -0
  477. package/src/resources/reactions.ts +3 -0
  478. package/src/resources/refunds.ts +21 -1
  479. package/src/resources/reviews.ts +3 -0
  480. package/src/resources/setup-intents.ts +3 -0
  481. package/src/resources/shared.ts +66 -2011
  482. package/src/resources/shipments.ts +3 -0
  483. package/src/resources/support-channels.ts +3 -0
  484. package/src/resources/topups.ts +3 -0
  485. package/src/resources/transfers.ts +3 -0
  486. package/src/resources/users.ts +3 -0
  487. package/src/resources/verifications.ts +3 -0
  488. package/src/resources/webhooks.ts +35 -0
  489. package/src/resources/withdrawals.ts +3 -0
  490. package/src/version.ts +1 -1
  491. package/version.d.mts +1 -1
  492. package/version.d.ts +1 -1
  493. package/version.js +1 -1
  494. 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,6 +48,10 @@ import {
48
48
  Apps,
49
49
  } from './resources/apps';
50
50
  import {
51
+ AuthorizedUserCreateParams,
52
+ AuthorizedUserCreateResponse,
53
+ AuthorizedUserDeleteParams,
54
+ AuthorizedUserDeleteResponse,
51
55
  AuthorizedUserListParams,
52
56
  AuthorizedUserListResponse,
53
57
  AuthorizedUserListResponsesCursorPage,
@@ -76,6 +80,7 @@ import {
76
80
  CompanyListResponse,
77
81
  CompanyListResponsesCursorPage,
78
82
  CompanyUpdateParams,
83
+ SocialLinkWebsites,
79
84
  } from './resources/companies';
80
85
  import {
81
86
  CompanyTokenTransaction,
@@ -248,6 +253,7 @@ import {
248
253
  } from './resources/members';
249
254
  import {
250
255
  CancelOptions,
256
+ MembershipAddFreeDaysParams,
251
257
  MembershipCancelParams,
252
258
  MembershipListParams,
253
259
  MembershipListResponse,
@@ -291,6 +297,7 @@ import {
291
297
  PaymentMethodTypes,
292
298
  PaymentRefundParams,
293
299
  Payments,
300
+ ReceiptTaxBehavior,
294
301
  } from './resources/payments';
295
302
  import {
296
303
  PayoutDestinationCategory,
@@ -310,7 +317,6 @@ import {
310
317
  Plans,
311
318
  } from './resources/plans';
312
319
  import {
313
- IndustryGroups,
314
320
  ProductCreateParams,
315
321
  ProductDeleteResponse,
316
322
  ProductListParams,
@@ -667,8 +673,8 @@ export class Whop {
667
673
  return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
668
674
  }
669
675
 
670
- protected stringifyQuery(query: Record<string, unknown>): string {
671
- return qs.stringify(query, { arrayFormat: 'brackets' });
676
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
677
+ return stringifyQuery(query);
672
678
  }
673
679
 
674
680
  private getUserAgent(): string {
@@ -700,12 +706,13 @@ export class Whop {
700
706
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
701
707
 
702
708
  const defaultQuery = this.defaultQuery();
703
- if (!isEmptyObj(defaultQuery)) {
704
- query = { ...defaultQuery, ...query };
709
+ const pathQuery = Object.fromEntries(url.searchParams);
710
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
711
+ query = { ...pathQuery, ...defaultQuery, ...query };
705
712
  }
706
713
 
707
714
  if (typeof query === 'object' && query && !Array.isArray(query)) {
708
- url.search = this.stringifyQuery(query as Record<string, unknown>);
715
+ url.search = this.stringifyQuery(query);
709
716
  }
710
717
 
711
718
  return url.toString();
@@ -1034,9 +1041,9 @@ export class Whop {
1034
1041
  }
1035
1042
  }
1036
1043
 
1037
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
1038
- // just do what it says, but otherwise calculate a default
1039
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
1044
+ // If the API asks us to wait a certain amount of time, just do what it
1045
+ // says, but otherwise calculate a default
1046
+ if (timeoutMillis === undefined) {
1040
1047
  const maxRetries = options.maxRetries ?? this.maxRetries;
1041
1048
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
1042
1049
  }
@@ -1169,7 +1176,7 @@ export class Whop {
1169
1176
  ) {
1170
1177
  return {
1171
1178
  bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
1172
- body: this.stringifyQuery(body as Record<string, unknown>),
1179
+ body: this.stringifyQuery(body),
1173
1180
  };
1174
1181
  } else {
1175
1182
  return this.#encoder({ body, headers });
@@ -1197,55 +1204,205 @@ export class Whop {
1197
1204
 
1198
1205
  static toFile = Uploads.toFile;
1199
1206
 
1207
+ /**
1208
+ * Apps
1209
+ */
1200
1210
  apps: API.Apps = new API.Apps(this);
1211
+ /**
1212
+ * Invoices
1213
+ */
1201
1214
  invoices: API.Invoices = new API.Invoices(this);
1215
+ /**
1216
+ * Course lesson interactions
1217
+ */
1202
1218
  courseLessonInteractions: API.CourseLessonInteractions = new API.CourseLessonInteractions(this);
1219
+ /**
1220
+ * Products
1221
+ */
1203
1222
  products: API.Products = new API.Products(this);
1223
+ /**
1224
+ * Companies
1225
+ */
1204
1226
  companies: API.Companies = new API.Companies(this);
1227
+ /**
1228
+ * Webhooks
1229
+ */
1205
1230
  webhooks: API.Webhooks = new API.Webhooks(this);
1231
+ /**
1232
+ * Plans
1233
+ */
1206
1234
  plans: API.Plans = new API.Plans(this);
1235
+ /**
1236
+ * Entries
1237
+ */
1207
1238
  entries: API.Entries = new API.Entries(this);
1239
+ /**
1240
+ * Forum posts
1241
+ */
1208
1242
  forumPosts: API.ForumPosts = new API.ForumPosts(this);
1243
+ /**
1244
+ * Transfers
1245
+ */
1209
1246
  transfers: API.Transfers = new API.Transfers(this);
1247
+ /**
1248
+ * Ledger accounts
1249
+ */
1210
1250
  ledgerAccounts: API.LedgerAccounts = new API.LedgerAccounts(this);
1251
+ /**
1252
+ * Memberships
1253
+ */
1211
1254
  memberships: API.Memberships = new API.Memberships(this);
1255
+ /**
1256
+ * Authorized users
1257
+ */
1212
1258
  authorizedUsers: API.AuthorizedUsers = new API.AuthorizedUsers(this);
1259
+ /**
1260
+ * App builds
1261
+ */
1213
1262
  appBuilds: API.AppBuilds = new API.AppBuilds(this);
1263
+ /**
1264
+ * Shipments
1265
+ */
1214
1266
  shipments: API.Shipments = new API.Shipments(this);
1267
+ /**
1268
+ * Checkout configurations
1269
+ */
1215
1270
  checkoutConfigurations: API.CheckoutConfigurations = new API.CheckoutConfigurations(this);
1271
+ /**
1272
+ * Messages
1273
+ */
1216
1274
  messages: API.Messages = new API.Messages(this);
1275
+ /**
1276
+ * Chat channels
1277
+ */
1217
1278
  chatChannels: API.ChatChannels = new API.ChatChannels(this);
1279
+ /**
1280
+ * Users
1281
+ */
1218
1282
  users: API.Users = new API.Users(this);
1283
+ /**
1284
+ * Payments
1285
+ */
1219
1286
  payments: API.Payments = new API.Payments(this);
1287
+ /**
1288
+ * Support channels
1289
+ */
1220
1290
  supportChannels: API.SupportChannels = new API.SupportChannels(this);
1291
+ /**
1292
+ * Experiences
1293
+ */
1221
1294
  experiences: API.Experiences = new API.Experiences(this);
1295
+ /**
1296
+ * Reactions
1297
+ */
1222
1298
  reactions: API.Reactions = new API.Reactions(this);
1299
+ /**
1300
+ * Members
1301
+ */
1223
1302
  members: API.Members = new API.Members(this);
1303
+ /**
1304
+ * Forums
1305
+ */
1224
1306
  forums: API.Forums = new API.Forums(this);
1307
+ /**
1308
+ * Promo codes
1309
+ */
1225
1310
  promoCodes: API.PromoCodes = new API.PromoCodes(this);
1311
+ /**
1312
+ * Courses
1313
+ */
1226
1314
  courses: API.Courses = new API.Courses(this);
1315
+ /**
1316
+ * Course chapters
1317
+ */
1227
1318
  courseChapters: API.CourseChapters = new API.CourseChapters(this);
1319
+ /**
1320
+ * Course lessons
1321
+ */
1228
1322
  courseLessons: API.CourseLessons = new API.CourseLessons(this);
1323
+ /**
1324
+ * Reviews
1325
+ */
1229
1326
  reviews: API.Reviews = new API.Reviews(this);
1327
+ /**
1328
+ * Course students
1329
+ */
1230
1330
  courseStudents: API.CourseStudents = new API.CourseStudents(this);
1331
+ /**
1332
+ * Access tokens
1333
+ */
1231
1334
  accessTokens: API.AccessTokens = new API.AccessTokens(this);
1335
+ /**
1336
+ * Notifications
1337
+ */
1232
1338
  notifications: API.Notifications = new API.Notifications(this);
1339
+ /**
1340
+ * Disputes
1341
+ */
1233
1342
  disputes: API.Disputes = new API.Disputes(this);
1343
+ /**
1344
+ * Refunds
1345
+ */
1234
1346
  refunds: API.Refunds = new API.Refunds(this);
1347
+ /**
1348
+ * Withdrawals
1349
+ */
1235
1350
  withdrawals: API.Withdrawals = new API.Withdrawals(this);
1351
+ /**
1352
+ * Account links
1353
+ */
1236
1354
  accountLinks: API.AccountLinks = new API.AccountLinks(this);
1355
+ /**
1356
+ * Setup intents
1357
+ */
1237
1358
  setupIntents: API.SetupIntents = new API.SetupIntents(this);
1359
+ /**
1360
+ * Payment methods
1361
+ */
1238
1362
  paymentMethods: API.PaymentMethods = new API.PaymentMethods(this);
1363
+ /**
1364
+ * Fee markups
1365
+ */
1239
1366
  feeMarkups: API.FeeMarkups = new API.FeeMarkups(this);
1367
+ /**
1368
+ * Payout methods
1369
+ */
1240
1370
  payoutMethods: API.PayoutMethods = new API.PayoutMethods(this);
1371
+ /**
1372
+ * Verifications
1373
+ */
1241
1374
  verifications: API.Verifications = new API.Verifications(this);
1375
+ /**
1376
+ * Leads
1377
+ */
1242
1378
  leads: API.Leads = new API.Leads(this);
1379
+ /**
1380
+ * Topups
1381
+ */
1243
1382
  topups: API.Topups = new API.Topups(this);
1383
+ /**
1384
+ * Files
1385
+ */
1244
1386
  files: API.Files = new API.Files(this);
1387
+ /**
1388
+ * Company token transactions
1389
+ */
1245
1390
  companyTokenTransactions: API.CompanyTokenTransactions = new API.CompanyTokenTransactions(this);
1391
+ /**
1392
+ * Dm members
1393
+ */
1246
1394
  dmMembers: API.DmMembers = new API.DmMembers(this);
1395
+ /**
1396
+ * Ai chats
1397
+ */
1247
1398
  aiChats: API.AIChats = new API.AIChats(this);
1399
+ /**
1400
+ * Dm channels
1401
+ */
1248
1402
  dmChannels: API.DmChannels = new API.DmChannels(this);
1403
+ /**
1404
+ * Dispute alerts
1405
+ */
1249
1406
  disputeAlerts: API.DisputeAlerts = new API.DisputeAlerts(this);
1250
1407
  }
1251
1408
 
@@ -1330,7 +1487,6 @@ export declare namespace Whop {
1330
1487
 
1331
1488
  export {
1332
1489
  Products as Products,
1333
- type IndustryGroups as IndustryGroups,
1334
1490
  type ProductDeleteResponse as ProductDeleteResponse,
1335
1491
  type ProductCreateParams as ProductCreateParams,
1336
1492
  type ProductUpdateParams as ProductUpdateParams,
@@ -1339,6 +1495,7 @@ export declare namespace Whop {
1339
1495
 
1340
1496
  export {
1341
1497
  Companies as Companies,
1498
+ type SocialLinkWebsites as SocialLinkWebsites,
1342
1499
  type CompanyListResponse as CompanyListResponse,
1343
1500
  type CompanyListResponsesCursorPage as CompanyListResponsesCursorPage,
1344
1501
  type CompanyCreateParams as CompanyCreateParams,
@@ -1437,16 +1594,21 @@ export declare namespace Whop {
1437
1594
  type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
1438
1595
  type MembershipUpdateParams as MembershipUpdateParams,
1439
1596
  type MembershipListParams as MembershipListParams,
1597
+ type MembershipAddFreeDaysParams as MembershipAddFreeDaysParams,
1440
1598
  type MembershipCancelParams as MembershipCancelParams,
1441
1599
  type MembershipPauseParams as MembershipPauseParams,
1442
1600
  };
1443
1601
 
1444
1602
  export {
1445
1603
  AuthorizedUsers as AuthorizedUsers,
1604
+ type AuthorizedUserCreateResponse as AuthorizedUserCreateResponse,
1446
1605
  type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
1447
1606
  type AuthorizedUserListResponse as AuthorizedUserListResponse,
1607
+ type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
1448
1608
  type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
1609
+ type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
1449
1610
  type AuthorizedUserListParams as AuthorizedUserListParams,
1611
+ type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
1450
1612
  };
1451
1613
 
1452
1614
  export {
@@ -1505,6 +1667,7 @@ export declare namespace Whop {
1505
1667
  type BillingReasons as BillingReasons,
1506
1668
  type CardBrands as CardBrands,
1507
1669
  type PaymentMethodTypes as PaymentMethodTypes,
1670
+ type ReceiptTaxBehavior as ReceiptTaxBehavior,
1508
1671
  type PaymentListResponse as PaymentListResponse,
1509
1672
  type PaymentListFeesResponse as PaymentListFeesResponse,
1510
1673
  type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
@@ -1818,7 +1981,6 @@ export declare namespace Whop {
1818
1981
  export type AppStatuses = API.AppStatuses;
1819
1982
  export type AppViewType = API.AppViewType;
1820
1983
  export type AuthorizedUserRoles = API.AuthorizedUserRoles;
1821
- export type BusinessTypes = API.BusinessTypes;
1822
1984
  export type ChatChannel = API.ChatChannel;
1823
1985
  export type CheckoutConfiguration = API.CheckoutConfiguration;
1824
1986
  export type CollectionMethod = API.CollectionMethod;
@@ -1837,7 +1999,6 @@ export declare namespace Whop {
1837
1999
  export type ForumPost = API.ForumPost;
1838
2000
  export type FriendlyReceiptStatus = API.FriendlyReceiptStatus;
1839
2001
  export type GlobalAffiliateStatus = API.GlobalAffiliateStatus;
1840
- export type IndustryTypes = API.IndustryTypes;
1841
2002
  export type Invoice = API.Invoice;
1842
2003
  export type InvoiceListItem = API.InvoiceListItem;
1843
2004
  export type InvoiceStatus = API.InvoiceStatus;
@@ -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
  */
@@ -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,34 @@ 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(
32
+ body: AuthorizedUserCreateParams,
33
+ options?: RequestOptions,
34
+ ): APIPromise<AuthorizedUserCreateResponse> {
35
+ return this._client.post('/authorized_users', { body, ...options });
36
+ }
37
+
11
38
  /**
12
39
  * Retrieves the details of an existing authorized user.
13
40
  *
@@ -15,6 +42,14 @@ export class AuthorizedUsers extends APIResource {
15
42
  *
16
43
  * - `company:authorized_user:read`
17
44
  * - `member:email:read`
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const authorizedUser =
49
+ * await client.authorizedUsers.retrieve(
50
+ * 'ausr_xxxxxxxxxxxxx',
51
+ * );
52
+ * ```
18
53
  */
19
54
  retrieve(id: string, options?: RequestOptions): APIPromise<AuthorizedUserRetrieveResponse> {
20
55
  return this._client.get(path`/authorized_users/${id}`, options);
@@ -28,6 +63,14 @@ export class AuthorizedUsers extends APIResource {
28
63
  *
29
64
  * - `company:authorized_user:read`
30
65
  * - `member:email:read`
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * // Automatically fetches more pages as needed.
70
+ * for await (const authorizedUserListResponse of client.authorizedUsers.list()) {
71
+ * // ...
72
+ * }
73
+ * ```
31
74
  */
32
75
  list(
33
76
  query: AuthorizedUserListParams | null | undefined = {},
@@ -38,10 +81,102 @@ export class AuthorizedUsers extends APIResource {
38
81
  ...options,
39
82
  });
40
83
  }
84
+
85
+ /**
86
+ * Remove an authorized user from a company.
87
+ *
88
+ * Required permissions:
89
+ *
90
+ * - `authorized_user:delete`
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const authorizedUser = await client.authorizedUsers.delete(
95
+ * 'ausr_xxxxxxxxxxxxx',
96
+ * );
97
+ * ```
98
+ */
99
+ delete(
100
+ id: string,
101
+ params: AuthorizedUserDeleteParams | null | undefined = {},
102
+ options?: RequestOptions,
103
+ ): APIPromise<AuthorizedUserDeleteResponse> {
104
+ const { company_id } = params ?? {};
105
+ return this._client.delete(path`/authorized_users/${id}`, { query: { company_id }, ...options });
106
+ }
41
107
  }
42
108
 
43
109
  export type AuthorizedUserListResponsesCursorPage = CursorPage<AuthorizedUserListResponse>;
44
110
 
111
+ /**
112
+ * A user who has been granted administrative access to manage a company's
113
+ * dashboard and settings.
114
+ */
115
+ export interface AuthorizedUserCreateResponse {
116
+ /**
117
+ * The unique identifier for the authorized user.
118
+ */
119
+ id: string;
120
+
121
+ /**
122
+ * The company this authorized user has access to.
123
+ */
124
+ company: AuthorizedUserCreateResponse.Company;
125
+
126
+ /**
127
+ * The permission role assigned to this authorized user within the company.
128
+ */
129
+ role: Shared.AuthorizedUserRoles;
130
+
131
+ /**
132
+ * The user account linked to this authorized user record.
133
+ */
134
+ user: AuthorizedUserCreateResponse.User;
135
+ }
136
+
137
+ export namespace AuthorizedUserCreateResponse {
138
+ /**
139
+ * The company this authorized user has access to.
140
+ */
141
+ export interface Company {
142
+ /**
143
+ * The unique identifier for the company.
144
+ */
145
+ id: string;
146
+
147
+ /**
148
+ * The display name of the company shown to customers.
149
+ */
150
+ title: string;
151
+ }
152
+
153
+ /**
154
+ * The user account linked to this authorized user record.
155
+ */
156
+ export interface User {
157
+ /**
158
+ * The unique identifier for the user.
159
+ */
160
+ id: string;
161
+
162
+ /**
163
+ * The user's email address. Requires the member:email:read permission to access.
164
+ * Null if not authorized.
165
+ */
166
+ email: string | null;
167
+
168
+ /**
169
+ * The user's display name shown on their public profile.
170
+ */
171
+ name: string | null;
172
+
173
+ /**
174
+ * The user's unique username shown on their public profile.
175
+ */
176
+ username: string;
177
+ }
178
+ }
179
+
45
180
  /**
46
181
  * A user who has been granted administrative access to manage a company's
47
182
  * dashboard and settings.
@@ -180,6 +315,34 @@ export namespace AuthorizedUserListResponse {
180
315
  }
181
316
  }
182
317
 
318
+ /**
319
+ * Represents `true` or `false` values.
320
+ */
321
+ export type AuthorizedUserDeleteResponse = boolean;
322
+
323
+ export interface AuthorizedUserCreateParams {
324
+ /**
325
+ * The ID of the company to add the authorized user to.
326
+ */
327
+ company_id: string;
328
+
329
+ /**
330
+ * The role to assign to the authorized user within the company. Supported roles:
331
+ * 'moderator', 'sales_manager'.
332
+ */
333
+ role: Shared.AuthorizedUserRoles;
334
+
335
+ /**
336
+ * The ID of the user to add as an authorized user.
337
+ */
338
+ user_id: string;
339
+
340
+ /**
341
+ * Whether to send notification emails to the user on creation.
342
+ */
343
+ send_emails?: boolean | null;
344
+ }
345
+
183
346
  export interface AuthorizedUserListParams extends CursorPageParams {
184
347
  /**
185
348
  * Returns the elements in the list that come before the specified cursor.
@@ -223,11 +386,23 @@ export interface AuthorizedUserListParams extends CursorPageParams {
223
386
  user_id?: string | null;
224
387
  }
225
388
 
389
+ export interface AuthorizedUserDeleteParams {
390
+ /**
391
+ * The ID of the company the authorized user belongs to. Optional if the authorized
392
+ * user ID is provided.
393
+ */
394
+ company_id?: string | null;
395
+ }
396
+
226
397
  export declare namespace AuthorizedUsers {
227
398
  export {
399
+ type AuthorizedUserCreateResponse as AuthorizedUserCreateResponse,
228
400
  type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
229
401
  type AuthorizedUserListResponse as AuthorizedUserListResponse,
402
+ type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
230
403
  type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
404
+ type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
231
405
  type AuthorizedUserListParams as AuthorizedUserListParams,
406
+ type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
232
407
  };
233
408
  }
@@ -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.