@whop/sdk 0.0.25 → 0.0.27

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 (271) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/client.d.mts +29 -25
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +29 -25
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +16 -5
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +3 -3
  17. package/resources/access-tokens.d.mts +32 -51
  18. package/resources/access-tokens.d.mts.map +1 -1
  19. package/resources/access-tokens.d.ts +32 -51
  20. package/resources/access-tokens.d.ts.map +1 -1
  21. package/resources/access-tokens.js +6 -8
  22. package/resources/access-tokens.js.map +1 -1
  23. package/resources/access-tokens.mjs +6 -8
  24. package/resources/access-tokens.mjs.map +1 -1
  25. package/resources/ai-chats.d.mts +36 -104
  26. package/resources/ai-chats.d.mts.map +1 -1
  27. package/resources/ai-chats.d.ts +36 -104
  28. package/resources/ai-chats.d.ts.map +1 -1
  29. package/resources/ai-chats.js +1 -1
  30. package/resources/ai-chats.js.map +1 -1
  31. package/resources/ai-chats.mjs +1 -1
  32. package/resources/ai-chats.mjs.map +1 -1
  33. package/resources/app-builds.d.mts +2 -2
  34. package/resources/app-builds.d.ts +2 -2
  35. package/resources/apps.d.mts +5 -4
  36. package/resources/apps.d.mts.map +1 -1
  37. package/resources/apps.d.ts +5 -4
  38. package/resources/apps.d.ts.map +1 -1
  39. package/resources/authorized-users.d.mts +43 -9
  40. package/resources/authorized-users.d.mts.map +1 -1
  41. package/resources/authorized-users.d.ts +43 -9
  42. package/resources/authorized-users.d.ts.map +1 -1
  43. package/resources/authorized-users.js +1 -1
  44. package/resources/authorized-users.js.map +1 -1
  45. package/resources/authorized-users.mjs +1 -1
  46. package/resources/authorized-users.mjs.map +1 -1
  47. package/resources/chat-channels.d.mts +1 -1
  48. package/resources/chat-channels.d.ts +1 -1
  49. package/resources/checkout-configurations.d.mts +24 -16
  50. package/resources/checkout-configurations.d.mts.map +1 -1
  51. package/resources/checkout-configurations.d.ts +24 -16
  52. package/resources/checkout-configurations.d.ts.map +1 -1
  53. package/resources/companies.d.mts +38 -25
  54. package/resources/companies.d.mts.map +1 -1
  55. package/resources/companies.d.ts +38 -25
  56. package/resources/companies.d.ts.map +1 -1
  57. package/resources/companies.js +7 -4
  58. package/resources/companies.js.map +1 -1
  59. package/resources/companies.mjs +7 -4
  60. package/resources/companies.mjs.map +1 -1
  61. package/resources/company-token-transactions.d.mts +23 -109
  62. package/resources/company-token-transactions.d.mts.map +1 -1
  63. package/resources/company-token-transactions.d.ts +23 -109
  64. package/resources/company-token-transactions.d.ts.map +1 -1
  65. package/resources/course-chapters.d.mts +3 -3
  66. package/resources/course-chapters.d.ts +3 -3
  67. package/resources/course-lessons.d.mts +15 -15
  68. package/resources/course-lessons.d.ts +15 -15
  69. package/resources/course-students.d.mts +6 -6
  70. package/resources/course-students.d.ts +6 -6
  71. package/resources/courses.d.mts +8 -8
  72. package/resources/courses.d.ts +8 -8
  73. package/resources/disputes.d.mts +20 -18
  74. package/resources/disputes.d.mts.map +1 -1
  75. package/resources/disputes.d.ts +20 -18
  76. package/resources/disputes.d.ts.map +1 -1
  77. package/resources/dm-channels.d.mts +161 -0
  78. package/resources/dm-channels.d.mts.map +1 -0
  79. package/resources/dm-channels.d.ts +161 -0
  80. package/resources/dm-channels.d.ts.map +1 -0
  81. package/resources/dm-channels.js +87 -0
  82. package/resources/dm-channels.js.map +1 -0
  83. package/resources/dm-channels.mjs +83 -0
  84. package/resources/dm-channels.mjs.map +1 -0
  85. package/resources/dm-members.d.mts +14 -66
  86. package/resources/dm-members.d.mts.map +1 -1
  87. package/resources/dm-members.d.ts +14 -66
  88. package/resources/dm-members.d.ts.map +1 -1
  89. package/resources/entries.d.mts +6 -6
  90. package/resources/entries.d.ts +6 -6
  91. package/resources/experiences.d.mts +6 -5
  92. package/resources/experiences.d.mts.map +1 -1
  93. package/resources/experiences.d.ts +6 -5
  94. package/resources/experiences.d.ts.map +1 -1
  95. package/resources/fee-markups.d.mts +6 -6
  96. package/resources/fee-markups.d.ts +6 -6
  97. package/resources/files.d.mts +9 -5
  98. package/resources/files.d.mts.map +1 -1
  99. package/resources/files.d.ts +9 -5
  100. package/resources/files.d.ts.map +1 -1
  101. package/resources/forum-posts.d.mts +8 -4
  102. package/resources/forum-posts.d.mts.map +1 -1
  103. package/resources/forum-posts.d.ts +8 -4
  104. package/resources/forum-posts.d.ts.map +1 -1
  105. package/resources/forums.d.mts +1 -1
  106. package/resources/forums.d.ts +1 -1
  107. package/resources/index.d.mts +12 -11
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +12 -11
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +3 -1
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +3 -2
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/invoices.d.mts +28 -20
  116. package/resources/invoices.d.mts.map +1 -1
  117. package/resources/invoices.d.ts +28 -20
  118. package/resources/invoices.d.ts.map +1 -1
  119. package/resources/leads.d.mts +21 -189
  120. package/resources/leads.d.mts.map +1 -1
  121. package/resources/leads.d.ts +21 -189
  122. package/resources/leads.d.ts.map +1 -1
  123. package/resources/ledger-accounts.d.mts +12 -9
  124. package/resources/ledger-accounts.d.mts.map +1 -1
  125. package/resources/ledger-accounts.d.ts +12 -9
  126. package/resources/ledger-accounts.d.ts.map +1 -1
  127. package/resources/ledger-accounts.js.map +1 -1
  128. package/resources/ledger-accounts.mjs.map +1 -1
  129. package/resources/members.d.mts +14 -14
  130. package/resources/members.d.mts.map +1 -1
  131. package/resources/members.d.ts +14 -14
  132. package/resources/members.d.ts.map +1 -1
  133. package/resources/members.js +1 -1
  134. package/resources/members.js.map +1 -1
  135. package/resources/members.mjs +1 -1
  136. package/resources/members.mjs.map +1 -1
  137. package/resources/memberships.d.mts +25 -15
  138. package/resources/memberships.d.mts.map +1 -1
  139. package/resources/memberships.d.ts +25 -15
  140. package/resources/memberships.d.ts.map +1 -1
  141. package/resources/messages.d.mts +7 -3
  142. package/resources/messages.d.mts.map +1 -1
  143. package/resources/messages.d.ts +7 -3
  144. package/resources/messages.d.ts.map +1 -1
  145. package/resources/payments.d.mts +59 -19
  146. package/resources/payments.d.mts.map +1 -1
  147. package/resources/payments.d.ts +59 -19
  148. package/resources/payments.d.ts.map +1 -1
  149. package/resources/payout-methods.d.mts +14 -9
  150. package/resources/payout-methods.d.mts.map +1 -1
  151. package/resources/payout-methods.d.ts +14 -9
  152. package/resources/payout-methods.d.ts.map +1 -1
  153. package/resources/payout-methods.js.map +1 -1
  154. package/resources/payout-methods.mjs.map +1 -1
  155. package/resources/plans.d.mts +34 -24
  156. package/resources/plans.d.mts.map +1 -1
  157. package/resources/plans.d.ts +34 -24
  158. package/resources/plans.d.ts.map +1 -1
  159. package/resources/products.d.mts +4 -2
  160. package/resources/products.d.mts.map +1 -1
  161. package/resources/products.d.ts +4 -2
  162. package/resources/products.d.ts.map +1 -1
  163. package/resources/promo-codes.d.mts +22 -12
  164. package/resources/promo-codes.d.mts.map +1 -1
  165. package/resources/promo-codes.d.ts +22 -12
  166. package/resources/promo-codes.d.ts.map +1 -1
  167. package/resources/reactions.d.mts +1 -1
  168. package/resources/reactions.d.ts +1 -1
  169. package/resources/refunds.d.mts +19 -15
  170. package/resources/refunds.d.mts.map +1 -1
  171. package/resources/refunds.d.ts +19 -15
  172. package/resources/refunds.d.ts.map +1 -1
  173. package/resources/reviews.d.mts +10 -10
  174. package/resources/reviews.d.ts +10 -10
  175. package/resources/setup-intents.d.mts +18 -20
  176. package/resources/setup-intents.d.mts.map +1 -1
  177. package/resources/setup-intents.d.ts +18 -20
  178. package/resources/setup-intents.d.ts.map +1 -1
  179. package/resources/shared.d.mts +209 -137
  180. package/resources/shared.d.mts.map +1 -1
  181. package/resources/shared.d.ts +209 -137
  182. package/resources/shared.d.ts.map +1 -1
  183. package/resources/shipments.d.mts +4 -4
  184. package/resources/shipments.d.ts +4 -4
  185. package/resources/support-channels.d.mts +1 -1
  186. package/resources/support-channels.d.ts +1 -1
  187. package/resources/topups.d.mts +6 -4
  188. package/resources/topups.d.mts.map +1 -1
  189. package/resources/topups.d.ts +6 -4
  190. package/resources/topups.d.ts.map +1 -1
  191. package/resources/transfers.d.mts +8 -5
  192. package/resources/transfers.d.mts.map +1 -1
  193. package/resources/transfers.d.ts +8 -5
  194. package/resources/transfers.d.ts.map +1 -1
  195. package/resources/users.d.mts +46 -8
  196. package/resources/users.d.mts.map +1 -1
  197. package/resources/users.d.ts +46 -8
  198. package/resources/users.d.ts.map +1 -1
  199. package/resources/users.js +10 -0
  200. package/resources/users.js.map +1 -1
  201. package/resources/users.mjs +10 -0
  202. package/resources/users.mjs.map +1 -1
  203. package/resources/verifications.d.mts +12 -4
  204. package/resources/verifications.d.mts.map +1 -1
  205. package/resources/verifications.d.ts +12 -4
  206. package/resources/verifications.d.ts.map +1 -1
  207. package/resources/webhooks.d.mts +105 -350
  208. package/resources/webhooks.d.mts.map +1 -1
  209. package/resources/webhooks.d.ts +105 -350
  210. package/resources/webhooks.d.ts.map +1 -1
  211. package/resources/webhooks.js.map +1 -1
  212. package/resources/webhooks.mjs +2 -2
  213. package/resources/webhooks.mjs.map +1 -1
  214. package/resources/withdrawals.d.mts +32 -139
  215. package/resources/withdrawals.d.mts.map +1 -1
  216. package/resources/withdrawals.d.ts +32 -139
  217. package/resources/withdrawals.d.ts.map +1 -1
  218. package/src/client.ts +87 -41
  219. package/src/internal/parse.ts +6 -0
  220. package/src/resources/access-tokens.ts +35 -56
  221. package/src/resources/ai-chats.ts +36 -122
  222. package/src/resources/app-builds.ts +2 -2
  223. package/src/resources/apps.ts +5 -4
  224. package/src/resources/authorized-users.ts +49 -9
  225. package/src/resources/chat-channels.ts +1 -1
  226. package/src/resources/checkout-configurations.ts +24 -16
  227. package/src/resources/companies.ts +41 -26
  228. package/src/resources/company-token-transactions.ts +24 -126
  229. package/src/resources/course-chapters.ts +3 -3
  230. package/src/resources/course-lessons.ts +15 -15
  231. package/src/resources/course-students.ts +6 -6
  232. package/src/resources/courses.ts +8 -8
  233. package/src/resources/disputes.ts +20 -18
  234. package/src/resources/dm-channels.ts +212 -0
  235. package/src/resources/dm-members.ts +16 -78
  236. package/src/resources/entries.ts +6 -6
  237. package/src/resources/experiences.ts +6 -5
  238. package/src/resources/fee-markups.ts +6 -6
  239. package/src/resources/files.ts +10 -4
  240. package/src/resources/forum-posts.ts +8 -4
  241. package/src/resources/forums.ts +1 -1
  242. package/src/resources/index.ts +38 -18
  243. package/src/resources/invoices.ts +28 -20
  244. package/src/resources/leads.ts +21 -217
  245. package/src/resources/ledger-accounts.ts +12 -42
  246. package/src/resources/members.ts +15 -15
  247. package/src/resources/memberships.ts +34 -30
  248. package/src/resources/messages.ts +7 -3
  249. package/src/resources/payments.ts +67 -17
  250. package/src/resources/payout-methods.ts +21 -8
  251. package/src/resources/plans.ts +34 -24
  252. package/src/resources/products.ts +4 -2
  253. package/src/resources/promo-codes.ts +22 -12
  254. package/src/resources/reactions.ts +1 -1
  255. package/src/resources/refunds.ts +20 -15
  256. package/src/resources/reviews.ts +10 -10
  257. package/src/resources/setup-intents.ts +18 -20
  258. package/src/resources/shared.ts +217 -145
  259. package/src/resources/shipments.ts +4 -4
  260. package/src/resources/support-channels.ts +1 -1
  261. package/src/resources/topups.ts +6 -4
  262. package/src/resources/transfers.ts +8 -5
  263. package/src/resources/users.ts +58 -8
  264. package/src/resources/verifications.ts +50 -37
  265. package/src/resources/webhooks.ts +138 -785
  266. package/src/resources/withdrawals.ts +39 -216
  267. package/src/version.ts +1 -1
  268. package/version.d.mts +1 -1
  269. package/version.d.ts +1 -1
  270. package/version.js +1 -1
  271. package/version.mjs +1 -1
@@ -21,7 +21,7 @@ export declare class Withdrawals extends APIResource {
21
21
  * });
22
22
  * ```
23
23
  */
24
- create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<WithdrawalCreateResponse>;
24
+ create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<Withdrawal>;
25
25
  /**
26
26
  * Retrieves a withdrawal by ID
27
27
  *
@@ -37,7 +37,7 @@ export declare class Withdrawals extends APIResource {
37
37
  * );
38
38
  * ```
39
39
  */
40
- retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse>;
40
+ retrieve(id: string, options?: RequestOptions): APIPromise<Withdrawal>;
41
41
  /**
42
42
  * Lists withdrawals
43
43
  *
@@ -59,31 +59,21 @@ export declare class Withdrawals extends APIResource {
59
59
  }
60
60
  export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
61
61
  /**
62
- * The different fee types for a withdrawal.
63
- */
64
- export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
65
- /**
66
- * The different speeds of withdrawals
62
+ * A withdrawal represents a request to transfer funds from a company's ledger
63
+ * account to an external payout method.
67
64
  */
68
- export type WithdrawalSpeeds = 'standard' | 'instant';
69
- /**
70
- * The status of a withdrawal request
71
- */
72
- export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
73
- /**
74
- * A withdrawal request.
75
- */
76
- export interface WithdrawalCreateResponse {
65
+ export interface Withdrawal {
77
66
  /**
78
- * Internal ID of the withdrawal request.
67
+ * The unique identifier for the withdrawal.
79
68
  */
80
69
  id: string;
81
70
  /**
82
- * How much money was attempted to be withdrawn, in a float type.
71
+ * The withdrawal amount. Provided as a number in the specified currency. Eg:
72
+ * 100.00 for $100.00 USD.
83
73
  */
84
74
  amount: number;
85
75
  /**
86
- * When the withdrawal request was created.
76
+ * The datetime the withdrawal was created.
87
77
  */
88
78
  created_at: string;
89
79
  /**
@@ -114,7 +104,7 @@ export interface WithdrawalCreateResponse {
114
104
  /**
115
105
  * The ledger account associated with the withdrawal.
116
106
  */
117
- ledger_account: WithdrawalCreateResponse.LedgerAccount;
107
+ ledger_account: Withdrawal.LedgerAccount;
118
108
  /**
119
109
  * The markup fee that was charged for the withdrawal. This is in the same currency
120
110
  * as the withdrawal amount. This only applies to platform accounts using Whop
@@ -124,7 +114,7 @@ export interface WithdrawalCreateResponse {
124
114
  /**
125
115
  * The payout token used for the withdrawal, if applicable.
126
116
  */
127
- payout_token: WithdrawalCreateResponse.PayoutToken | null;
117
+ payout_token: Withdrawal.PayoutToken | null;
128
118
  /**
129
119
  * The speed of the withdrawal.
130
120
  */
@@ -139,13 +129,13 @@ export interface WithdrawalCreateResponse {
139
129
  */
140
130
  trace_code: string | null;
141
131
  }
142
- export declare namespace WithdrawalCreateResponse {
132
+ export declare namespace Withdrawal {
143
133
  /**
144
134
  * The ledger account associated with the withdrawal.
145
135
  */
146
136
  interface LedgerAccount {
147
137
  /**
148
- * The ID of the LedgerAccount.
138
+ * The unique identifier for the ledger account.
149
139
  */
150
140
  id: string;
151
141
  /**
@@ -158,11 +148,11 @@ export declare namespace WithdrawalCreateResponse {
158
148
  */
159
149
  interface PayoutToken {
160
150
  /**
161
- * The ID of the payout token
151
+ * The unique identifier for the payout token.
162
152
  */
163
153
  id: string;
164
154
  /**
165
- * The date and time the payout token was created
155
+ * The datetime the payout token was created.
166
156
  */
167
157
  created_at: string;
168
158
  /**
@@ -182,130 +172,33 @@ export declare namespace WithdrawalCreateResponse {
182
172
  }
183
173
  }
184
174
  /**
185
- * A withdrawal request.
175
+ * The different fee types for a withdrawal.
186
176
  */
187
- export interface WithdrawalRetrieveResponse {
188
- /**
189
- * Internal ID of the withdrawal request.
190
- */
191
- id: string;
192
- /**
193
- * How much money was attempted to be withdrawn, in a float type.
194
- */
195
- amount: number;
196
- /**
197
- * When the withdrawal request was created.
198
- */
199
- created_at: string;
200
- /**
201
- * The currency of the withdrawal request.
202
- */
203
- currency: Shared.Currency;
204
- /**
205
- * The different error codes a payout can be in.
206
- */
207
- error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_mailing_address' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
208
- /**
209
- * The error message for the withdrawal, if any.
210
- */
211
- error_message: string | null;
212
- /**
213
- * The estimated availability date for the withdrawal, if any.
214
- */
215
- estimated_availability: string | null;
216
- /**
217
- * The fee amount that was charged for the withdrawal. This is in the same currency
218
- * as the withdrawal amount.
219
- */
220
- fee_amount: number;
221
- /**
222
- * The different fee types for a withdrawal.
223
- */
224
- fee_type: WithdrawalFeeTypes | null;
225
- /**
226
- * The ledger account associated with the withdrawal.
227
- */
228
- ledger_account: WithdrawalRetrieveResponse.LedgerAccount;
229
- /**
230
- * The markup fee that was charged for the withdrawal. This is in the same currency
231
- * as the withdrawal amount. This only applies to platform accounts using Whop
232
- * Rails.
233
- */
234
- markup_fee: number;
235
- /**
236
- * The payout token used for the withdrawal, if applicable.
237
- */
238
- payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
239
- /**
240
- * The speed of the withdrawal.
241
- */
242
- speed: WithdrawalSpeeds;
243
- /**
244
- * Status of the withdrawal.
245
- */
246
- status: WithdrawalStatus;
247
- /**
248
- * The trace code for the payout, if applicable. Provided on ACH transactions when
249
- * available.
250
- */
251
- trace_code: string | null;
252
- }
253
- export declare namespace WithdrawalRetrieveResponse {
254
- /**
255
- * The ledger account associated with the withdrawal.
256
- */
257
- interface LedgerAccount {
258
- /**
259
- * The ID of the LedgerAccount.
260
- */
261
- id: string;
262
- /**
263
- * The ID of the company associated with this ledger account.
264
- */
265
- company_id: string | null;
266
- }
267
- /**
268
- * The payout token used for the withdrawal, if applicable.
269
- */
270
- interface PayoutToken {
271
- /**
272
- * The ID of the payout token
273
- */
274
- id: string;
275
- /**
276
- * The date and time the payout token was created
277
- */
278
- created_at: string;
279
- /**
280
- * The currency code of the payout destination. This is the currency that payouts
281
- * will be made in for this token.
282
- */
283
- destination_currency_code: string;
284
- /**
285
- * An optional nickname for the payout token to help the user identify it. This is
286
- * not used by the provider and is only for the user's reference.
287
- */
288
- nickname: string | null;
289
- /**
290
- * The name of the payer associated with the payout token.
291
- */
292
- payer_name: string | null;
293
- }
294
- }
177
+ export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
178
+ /**
179
+ * The different speeds of withdrawals
180
+ */
181
+ export type WithdrawalSpeeds = 'standard' | 'instant';
182
+ /**
183
+ * The status of a withdrawal request
184
+ */
185
+ export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
295
186
  /**
296
- * A withdrawal request.
187
+ * A withdrawal represents a request to transfer funds from a company's ledger
188
+ * account to an external payout method.
297
189
  */
298
190
  export interface WithdrawalListResponse {
299
191
  /**
300
- * Internal ID of the withdrawal request.
192
+ * The unique identifier for the withdrawal.
301
193
  */
302
194
  id: string;
303
195
  /**
304
- * How much money was attempted to be withdrawn, in a float type.
196
+ * The withdrawal amount. Provided as a number in the specified currency. Eg:
197
+ * 100.00 for $100.00 USD.
305
198
  */
306
199
  amount: number;
307
200
  /**
308
- * When the withdrawal request was created.
201
+ * The datetime the withdrawal was created.
309
202
  */
310
203
  created_at: string;
311
204
  /**
@@ -394,6 +287,6 @@ export interface WithdrawalListParams extends CursorPageParams {
394
287
  last?: number | null;
395
288
  }
396
289
  export declare namespace Withdrawals {
397
- export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalCreateResponse as WithdrawalCreateResponse, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalCreateParams as WithdrawalCreateParams, type WithdrawalListParams as WithdrawalListParams, };
290
+ export { type Withdrawal as Withdrawal, type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalCreateParams as WithdrawalCreateParams, type WithdrawalListParams as WithdrawalListParams, };
398
291
  }
399
292
  //# sourceMappingURL=withdrawals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;;;;;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;CACtC;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
package/src/client.ts CHANGED
@@ -22,15 +22,13 @@ import { APIPromise } from './core/api-promise';
22
22
  import { AccessTokenCreateParams, AccessTokenCreateResponse, AccessTokens } from './resources/access-tokens';
23
23
  import { AccountLinkCreateParams, AccountLinkCreateResponse, AccountLinks } from './resources/account-links';
24
24
  import {
25
+ AIChat,
25
26
  AIChatCreateParams,
26
- AIChatCreateResponse,
27
27
  AIChatDeleteResponse,
28
28
  AIChatListParams,
29
29
  AIChatListResponse,
30
30
  AIChatListResponsesCursorPage,
31
- AIChatRetrieveResponse,
32
31
  AIChatUpdateParams,
33
- AIChatUpdateResponse,
34
32
  AIChats,
35
33
  } from './resources/ai-chats';
36
34
  import {
@@ -80,12 +78,12 @@ import {
80
78
  CompanyUpdateParams,
81
79
  } from './resources/companies';
82
80
  import {
81
+ BotTokenTransactionTypes,
82
+ CompanyTokenTransaction,
83
83
  CompanyTokenTransactionCreateParams,
84
- CompanyTokenTransactionCreateResponse,
85
84
  CompanyTokenTransactionListParams,
86
85
  CompanyTokenTransactionListResponse,
87
86
  CompanyTokenTransactionListResponsesCursorPage,
88
- CompanyTokenTransactionRetrieveResponse,
89
87
  CompanyTokenTransactions,
90
88
  } from './resources/company-token-transactions';
91
89
  import {
@@ -149,15 +147,25 @@ import {
149
147
  Disputes,
150
148
  } from './resources/disputes';
151
149
  import {
150
+ DmChannel,
151
+ DmChannelCreateParams,
152
+ DmChannelDeleteResponse,
153
+ DmChannelListParams,
154
+ DmChannelListResponse,
155
+ DmChannelListResponsesCursorPage,
156
+ DmChannelUpdateParams,
157
+ DmChannels,
158
+ } from './resources/dm-channels';
159
+ import {
160
+ DmFeedMemberNotificationPreferences,
161
+ DmFeedMemberStatuses,
162
+ DmMember,
152
163
  DmMemberCreateParams,
153
- DmMemberCreateResponse,
154
164
  DmMemberDeleteResponse,
155
165
  DmMemberListParams,
156
166
  DmMemberListResponse,
157
167
  DmMemberListResponsesCursorPage,
158
- DmMemberRetrieveResponse,
159
168
  DmMemberUpdateParams,
160
- DmMemberUpdateResponse,
161
169
  DmMembers,
162
170
  } from './resources/dm-members';
163
171
  import {
@@ -189,7 +197,13 @@ import {
189
197
  FeeMarkupType,
190
198
  FeeMarkups,
191
199
  } from './resources/fee-markups';
192
- import { FileCreateParams, FileCreateResponse, FileRetrieveResponse, Files } from './resources/files';
200
+ import {
201
+ FileCreateParams,
202
+ FileCreateResponse,
203
+ FileRetrieveResponse,
204
+ Files,
205
+ UploadStatus,
206
+ } from './resources/files';
193
207
  import {
194
208
  ForumPostCreateParams,
195
209
  ForumPostListParams,
@@ -208,14 +222,12 @@ import {
208
222
  } from './resources/forums';
209
223
  import { InvoiceCreateParams, InvoiceListParams, InvoiceVoidResponse, Invoices } from './resources/invoices';
210
224
  import {
225
+ Lead,
211
226
  LeadCreateParams,
212
- LeadCreateResponse,
213
227
  LeadListParams,
214
228
  LeadListResponse,
215
229
  LeadListResponsesCursorPage,
216
- LeadRetrieveResponse,
217
230
  LeadUpdateParams,
218
- LeadUpdateResponse,
219
231
  Leads,
220
232
  } from './resources/leads';
221
233
  import { LedgerAccountRetrieveResponse, LedgerAccounts } from './resources/ledger-accounts';
@@ -227,6 +239,7 @@ import {
227
239
  Members,
228
240
  } from './resources/members';
229
241
  import {
242
+ CancelOptions,
230
243
  MembershipCancelParams,
231
244
  MembershipListParams,
232
245
  MembershipListResponse,
@@ -272,6 +285,7 @@ import {
272
285
  Payments,
273
286
  } from './resources/payments';
274
287
  import {
288
+ PayoutDestinationCategory,
275
289
  PayoutMethodListParams,
276
290
  PayoutMethodListResponse,
277
291
  PayoutMethodListResponsesCursorPage,
@@ -364,13 +378,20 @@ import {
364
378
  Transfers,
365
379
  } from './resources/transfers';
366
380
  import {
381
+ User,
367
382
  UserCheckAccessParams,
368
383
  UserCheckAccessResponse,
369
- UserRetrieveResponse,
384
+ UserUpdateProfileParams,
370
385
  Users,
371
386
  } from './resources/users';
372
- import { VerificationRetrieveResponse, Verifications } from './resources/verifications';
373
387
  import {
388
+ VerificationErrorCode,
389
+ VerificationRetrieveResponse,
390
+ VerificationStatus,
391
+ Verifications,
392
+ } from './resources/verifications';
393
+ import {
394
+ APIVersion,
374
395
  CourseLessonInteractionCompletedWebhookEvent,
375
396
  DisputeCreatedWebhookEvent,
376
397
  DisputeUpdatedWebhookEvent,
@@ -397,27 +418,26 @@ import {
397
418
  SetupIntentSucceededWebhookEvent,
398
419
  UnwrapWebhookEvent,
399
420
  VerificationSucceededWebhookEvent,
421
+ Webhook,
400
422
  WebhookCreateParams,
401
423
  WebhookCreateResponse,
402
424
  WebhookDeleteResponse,
425
+ WebhookEvent,
403
426
  WebhookListParams,
404
427
  WebhookListResponse,
405
428
  WebhookListResponsesCursorPage,
406
- WebhookRetrieveResponse,
407
429
  WebhookUpdateParams,
408
- WebhookUpdateResponse,
409
430
  Webhooks,
410
431
  WithdrawalCreatedWebhookEvent,
411
432
  WithdrawalUpdatedWebhookEvent,
412
433
  } from './resources/webhooks';
413
434
  import {
435
+ Withdrawal,
414
436
  WithdrawalCreateParams,
415
- WithdrawalCreateResponse,
416
437
  WithdrawalFeeTypes,
417
438
  WithdrawalListParams,
418
439
  WithdrawalListResponse,
419
440
  WithdrawalListResponsesCursorPage,
420
- WithdrawalRetrieveResponse,
421
441
  WithdrawalSpeeds,
422
442
  WithdrawalStatus,
423
443
  Withdrawals,
@@ -438,7 +458,7 @@ import { makeUserTokenVerifierFromSdk } from './lib/verify-user-token';
438
458
 
439
459
  export interface ClientOptions {
440
460
  /**
441
- * The app API key from an app from the /dashboard/developer page
461
+ * A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like `Bearer ***************************`
442
462
  */
443
463
  apiKey?: string | undefined;
444
464
 
@@ -528,7 +548,6 @@ export class Whop {
528
548
  apiKey: string;
529
549
  webhookKey: string | null;
530
550
  appID: string | null;
531
-
532
551
  baseURL: string;
533
552
  maxRetries: number;
534
553
  timeout: number;
@@ -897,9 +916,14 @@ export class Whop {
897
916
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
898
917
  path: string,
899
918
  Page: new (...args: any[]) => PageClass,
900
- opts?: RequestOptions,
919
+ opts?: PromiseOrValue<RequestOptions>,
901
920
  ): Pagination.PagePromise<PageClass, Item> {
902
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
921
+ return this.requestAPIList(
922
+ Page,
923
+ opts && 'then' in opts ?
924
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
925
+ : { method: 'get', path, ...opts },
926
+ );
903
927
  }
904
928
 
905
929
  requestAPIList<
@@ -907,7 +931,7 @@ export class Whop {
907
931
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
908
932
  >(
909
933
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
910
- options: FinalRequestOptions,
934
+ options: PromiseOrValue<FinalRequestOptions>,
911
935
  ): Pagination.PagePromise<PageClass, Item> {
912
936
  const request = this.makeRequest(options, null, undefined);
913
937
  return new Pagination.PagePromise<PageClass, Item>(this as any as Whop, request, Page);
@@ -920,9 +944,10 @@ export class Whop {
920
944
  controller: AbortController,
921
945
  ): Promise<Response> {
922
946
  const { signal, method, ...options } = init || {};
923
- if (signal) signal.addEventListener('abort', () => controller.abort());
947
+ const abort = this._makeAbort(controller);
948
+ if (signal) signal.addEventListener('abort', abort, { once: true });
924
949
 
925
- const timeout = setTimeout(() => controller.abort(), ms);
950
+ const timeout = setTimeout(abort, ms);
926
951
 
927
952
  const isReadableBody =
928
953
  ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
@@ -1090,6 +1115,12 @@ export class Whop {
1090
1115
  return headers.values;
1091
1116
  }
1092
1117
 
1118
+ private _makeAbort(controller: AbortController) {
1119
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
1120
+ // would capture all request options, and cause a memory leak.
1121
+ return () => controller.abort();
1122
+ }
1123
+
1093
1124
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
1094
1125
  bodyHeaders: HeadersLike;
1095
1126
  body: BodyInit | undefined;
@@ -1196,6 +1227,7 @@ export class Whop {
1196
1227
  companyTokenTransactions: API.CompanyTokenTransactions = new API.CompanyTokenTransactions(this);
1197
1228
  dmMembers: API.DmMembers = new API.DmMembers(this);
1198
1229
  aiChats: API.AIChats = new API.AIChats(this);
1230
+ dmChannels: API.DmChannels = new API.DmChannels(this);
1199
1231
  }
1200
1232
 
1201
1233
  Whop.Apps = Apps;
@@ -1246,6 +1278,7 @@ Whop.Files = Files;
1246
1278
  Whop.CompanyTokenTransactions = CompanyTokenTransactions;
1247
1279
  Whop.DmMembers = DmMembers;
1248
1280
  Whop.AIChats = AIChats;
1281
+ Whop.DmChannels = DmChannels;
1249
1282
 
1250
1283
  export declare namespace Whop {
1251
1284
  export type RequestOptions = Opts.RequestOptions;
@@ -1294,9 +1327,10 @@ export declare namespace Whop {
1294
1327
 
1295
1328
  export {
1296
1329
  Webhooks as Webhooks,
1330
+ type APIVersion as APIVersion,
1331
+ type Webhook as Webhook,
1332
+ type WebhookEvent as WebhookEvent,
1297
1333
  type WebhookCreateResponse as WebhookCreateResponse,
1298
- type WebhookRetrieveResponse as WebhookRetrieveResponse,
1299
- type WebhookUpdateResponse as WebhookUpdateResponse,
1300
1334
  type WebhookListResponse as WebhookListResponse,
1301
1335
  type WebhookDeleteResponse as WebhookDeleteResponse,
1302
1336
  type InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent,
@@ -1376,6 +1410,7 @@ export declare namespace Whop {
1376
1410
 
1377
1411
  export {
1378
1412
  Memberships as Memberships,
1413
+ type CancelOptions as CancelOptions,
1379
1414
  type MembershipListResponse as MembershipListResponse,
1380
1415
  type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
1381
1416
  type MembershipUpdateParams as MembershipUpdateParams,
@@ -1437,9 +1472,10 @@ export declare namespace Whop {
1437
1472
 
1438
1473
  export {
1439
1474
  Users as Users,
1440
- type UserRetrieveResponse as UserRetrieveResponse,
1475
+ type User as User,
1441
1476
  type UserCheckAccessResponse as UserCheckAccessResponse,
1442
1477
  type UserCheckAccessParams as UserCheckAccessParams,
1478
+ type UserUpdateProfileParams as UserUpdateProfileParams,
1443
1479
  };
1444
1480
 
1445
1481
  export {
@@ -1612,11 +1648,10 @@ export declare namespace Whop {
1612
1648
 
1613
1649
  export {
1614
1650
  Withdrawals as Withdrawals,
1651
+ type Withdrawal as Withdrawal,
1615
1652
  type WithdrawalFeeTypes as WithdrawalFeeTypes,
1616
1653
  type WithdrawalSpeeds as WithdrawalSpeeds,
1617
1654
  type WithdrawalStatus as WithdrawalStatus,
1618
- type WithdrawalCreateResponse as WithdrawalCreateResponse,
1619
- type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
1620
1655
  type WithdrawalListResponse as WithdrawalListResponse,
1621
1656
  type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
1622
1657
  type WithdrawalCreateParams as WithdrawalCreateParams,
@@ -1660,6 +1695,7 @@ export declare namespace Whop {
1660
1695
 
1661
1696
  export {
1662
1697
  PayoutMethods as PayoutMethods,
1698
+ type PayoutDestinationCategory as PayoutDestinationCategory,
1663
1699
  type PayoutMethodRetrieveResponse as PayoutMethodRetrieveResponse,
1664
1700
  type PayoutMethodListResponse as PayoutMethodListResponse,
1665
1701
  type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,
@@ -1668,14 +1704,14 @@ export declare namespace Whop {
1668
1704
 
1669
1705
  export {
1670
1706
  Verifications as Verifications,
1707
+ type VerificationErrorCode as VerificationErrorCode,
1708
+ type VerificationStatus as VerificationStatus,
1671
1709
  type VerificationRetrieveResponse as VerificationRetrieveResponse,
1672
1710
  };
1673
1711
 
1674
1712
  export {
1675
1713
  Leads as Leads,
1676
- type LeadCreateResponse as LeadCreateResponse,
1677
- type LeadRetrieveResponse as LeadRetrieveResponse,
1678
- type LeadUpdateResponse as LeadUpdateResponse,
1714
+ type Lead as Lead,
1679
1715
  type LeadListResponse as LeadListResponse,
1680
1716
  type LeadListResponsesCursorPage as LeadListResponsesCursorPage,
1681
1717
  type LeadCreateParams as LeadCreateParams,
@@ -1691,6 +1727,7 @@ export declare namespace Whop {
1691
1727
 
1692
1728
  export {
1693
1729
  Files as Files,
1730
+ type UploadStatus as UploadStatus,
1694
1731
  type FileCreateResponse as FileCreateResponse,
1695
1732
  type FileRetrieveResponse as FileRetrieveResponse,
1696
1733
  type FileCreateParams as FileCreateParams,
@@ -1698,8 +1735,8 @@ export declare namespace Whop {
1698
1735
 
1699
1736
  export {
1700
1737
  CompanyTokenTransactions as CompanyTokenTransactions,
1701
- type CompanyTokenTransactionCreateResponse as CompanyTokenTransactionCreateResponse,
1702
- type CompanyTokenTransactionRetrieveResponse as CompanyTokenTransactionRetrieveResponse,
1738
+ type BotTokenTransactionTypes as BotTokenTransactionTypes,
1739
+ type CompanyTokenTransaction as CompanyTokenTransaction,
1703
1740
  type CompanyTokenTransactionListResponse as CompanyTokenTransactionListResponse,
1704
1741
  type CompanyTokenTransactionListResponsesCursorPage as CompanyTokenTransactionListResponsesCursorPage,
1705
1742
  type CompanyTokenTransactionCreateParams as CompanyTokenTransactionCreateParams,
@@ -1708,9 +1745,9 @@ export declare namespace Whop {
1708
1745
 
1709
1746
  export {
1710
1747
  DmMembers as DmMembers,
1711
- type DmMemberCreateResponse as DmMemberCreateResponse,
1712
- type DmMemberRetrieveResponse as DmMemberRetrieveResponse,
1713
- type DmMemberUpdateResponse as DmMemberUpdateResponse,
1748
+ type DmFeedMemberNotificationPreferences as DmFeedMemberNotificationPreferences,
1749
+ type DmFeedMemberStatuses as DmFeedMemberStatuses,
1750
+ type DmMember as DmMember,
1714
1751
  type DmMemberListResponse as DmMemberListResponse,
1715
1752
  type DmMemberDeleteResponse as DmMemberDeleteResponse,
1716
1753
  type DmMemberListResponsesCursorPage as DmMemberListResponsesCursorPage,
@@ -1721,9 +1758,7 @@ export declare namespace Whop {
1721
1758
 
1722
1759
  export {
1723
1760
  AIChats as AIChats,
1724
- type AIChatCreateResponse as AIChatCreateResponse,
1725
- type AIChatRetrieveResponse as AIChatRetrieveResponse,
1726
- type AIChatUpdateResponse as AIChatUpdateResponse,
1761
+ type AIChat as AIChat,
1727
1762
  type AIChatListResponse as AIChatListResponse,
1728
1763
  type AIChatDeleteResponse as AIChatDeleteResponse,
1729
1764
  type AIChatListResponsesCursorPage as AIChatListResponsesCursorPage,
@@ -1732,6 +1767,17 @@ export declare namespace Whop {
1732
1767
  type AIChatListParams as AIChatListParams,
1733
1768
  };
1734
1769
 
1770
+ export {
1771
+ DmChannels as DmChannels,
1772
+ type DmChannel as DmChannel,
1773
+ type DmChannelListResponse as DmChannelListResponse,
1774
+ type DmChannelDeleteResponse as DmChannelDeleteResponse,
1775
+ type DmChannelListResponsesCursorPage as DmChannelListResponsesCursorPage,
1776
+ type DmChannelCreateParams as DmChannelCreateParams,
1777
+ type DmChannelUpdateParams as DmChannelUpdateParams,
1778
+ type DmChannelListParams as DmChannelListParams,
1779
+ };
1780
+
1735
1781
  export type AccessLevel = API.AccessLevel;
1736
1782
  export type AccessPassType = API.AccessPassType;
1737
1783
  export type App = API.App;
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Whop, props: APIResponsePr
29
29
  const mediaType = contentType?.split(';')[0]?.trim();
30
30
  const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
31
31
  if (isJSON) {
32
+ const contentLength = response.headers.get('content-length');
33
+ if (contentLength === '0') {
34
+ // if there is no content we can't do anything
35
+ return undefined as T;
36
+ }
37
+
32
38
  const json = await response.json();
33
39
  return json as T;
34
40
  }