@whop/sdk 0.0.24 → 0.0.26

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 (181) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +30 -18
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +30 -18
  6. package/client.d.ts.map +1 -1
  7. package/client.js +15 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +17 -4
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/ai-chats.d.mts +169 -0
  19. package/resources/ai-chats.d.mts.map +1 -0
  20. package/resources/ai-chats.d.ts +169 -0
  21. package/resources/ai-chats.d.ts.map +1 -0
  22. package/resources/ai-chats.js +53 -0
  23. package/resources/ai-chats.js.map +1 -0
  24. package/resources/ai-chats.mjs +49 -0
  25. package/resources/ai-chats.mjs.map +1 -0
  26. package/resources/apps.d.mts +1 -1
  27. package/resources/apps.d.mts.map +1 -1
  28. package/resources/apps.d.ts +1 -1
  29. package/resources/apps.d.ts.map +1 -1
  30. package/resources/authorized-users.d.mts +39 -5
  31. package/resources/authorized-users.d.mts.map +1 -1
  32. package/resources/authorized-users.d.ts +39 -5
  33. package/resources/authorized-users.d.ts.map +1 -1
  34. package/resources/authorized-users.js +1 -1
  35. package/resources/authorized-users.js.map +1 -1
  36. package/resources/authorized-users.mjs +1 -1
  37. package/resources/authorized-users.mjs.map +1 -1
  38. package/resources/checkout-configurations.d.mts +12 -0
  39. package/resources/checkout-configurations.d.mts.map +1 -1
  40. package/resources/checkout-configurations.d.ts +12 -0
  41. package/resources/checkout-configurations.d.ts.map +1 -1
  42. package/resources/company-token-transactions.d.mts +339 -0
  43. package/resources/company-token-transactions.d.mts.map +1 -0
  44. package/resources/company-token-transactions.d.ts +339 -0
  45. package/resources/company-token-transactions.d.ts.map +1 -0
  46. package/resources/company-token-transactions.js +59 -0
  47. package/resources/company-token-transactions.js.map +1 -0
  48. package/resources/company-token-transactions.mjs +55 -0
  49. package/resources/company-token-transactions.mjs.map +1 -0
  50. package/resources/dm-channels.d.mts +161 -0
  51. package/resources/dm-channels.d.mts.map +1 -0
  52. package/resources/dm-channels.d.ts +161 -0
  53. package/resources/dm-channels.d.ts.map +1 -0
  54. package/resources/dm-channels.js +87 -0
  55. package/resources/dm-channels.js.map +1 -0
  56. package/resources/dm-channels.mjs +83 -0
  57. package/resources/dm-channels.mjs.map +1 -0
  58. package/resources/dm-members.d.mts +190 -0
  59. package/resources/dm-members.d.mts.map +1 -0
  60. package/resources/dm-members.d.ts +190 -0
  61. package/resources/dm-members.d.ts.map +1 -0
  62. package/resources/dm-members.js +94 -0
  63. package/resources/dm-members.js.map +1 -0
  64. package/resources/dm-members.mjs +90 -0
  65. package/resources/dm-members.mjs.map +1 -0
  66. package/resources/files.d.mts +7 -3
  67. package/resources/files.d.mts.map +1 -1
  68. package/resources/files.d.ts +7 -3
  69. package/resources/files.d.ts.map +1 -1
  70. package/resources/index.d.mts +13 -9
  71. package/resources/index.d.mts.map +1 -1
  72. package/resources/index.d.ts +13 -9
  73. package/resources/index.d.ts.map +1 -1
  74. package/resources/index.js +9 -1
  75. package/resources/index.js.map +1 -1
  76. package/resources/index.mjs +6 -2
  77. package/resources/index.mjs.map +1 -1
  78. package/resources/leads.d.mts +9 -177
  79. package/resources/leads.d.mts.map +1 -1
  80. package/resources/leads.d.ts +9 -177
  81. package/resources/leads.d.ts.map +1 -1
  82. package/resources/ledger-accounts.d.mts +3 -2
  83. package/resources/ledger-accounts.d.mts.map +1 -1
  84. package/resources/ledger-accounts.d.ts +3 -2
  85. package/resources/ledger-accounts.d.ts.map +1 -1
  86. package/resources/ledger-accounts.js.map +1 -1
  87. package/resources/ledger-accounts.mjs.map +1 -1
  88. package/resources/members.d.mts +13 -5
  89. package/resources/members.d.mts.map +1 -1
  90. package/resources/members.d.ts +13 -5
  91. package/resources/members.d.ts.map +1 -1
  92. package/resources/members.js +1 -1
  93. package/resources/members.js.map +1 -1
  94. package/resources/members.mjs +1 -1
  95. package/resources/members.mjs.map +1 -1
  96. package/resources/memberships.d.mts +32 -2
  97. package/resources/memberships.d.mts.map +1 -1
  98. package/resources/memberships.d.ts +32 -2
  99. package/resources/memberships.d.ts.map +1 -1
  100. package/resources/memberships.js +18 -0
  101. package/resources/memberships.js.map +1 -1
  102. package/resources/memberships.mjs +18 -0
  103. package/resources/memberships.mjs.map +1 -1
  104. package/resources/messages.d.mts +17 -1
  105. package/resources/messages.d.mts.map +1 -1
  106. package/resources/messages.d.ts +17 -1
  107. package/resources/messages.d.ts.map +1 -1
  108. package/resources/messages.js +10 -0
  109. package/resources/messages.js.map +1 -1
  110. package/resources/messages.mjs +10 -0
  111. package/resources/messages.mjs.map +1 -1
  112. package/resources/payments.d.mts +42 -1
  113. package/resources/payments.d.mts.map +1 -1
  114. package/resources/payments.d.ts +42 -1
  115. package/resources/payments.d.ts.map +1 -1
  116. package/resources/payout-methods.d.mts +26 -3
  117. package/resources/payout-methods.d.mts.map +1 -1
  118. package/resources/payout-methods.d.ts +26 -3
  119. package/resources/payout-methods.d.ts.map +1 -1
  120. package/resources/payout-methods.js.map +1 -1
  121. package/resources/payout-methods.mjs.map +1 -1
  122. package/resources/reactions.d.mts +24 -1
  123. package/resources/reactions.d.mts.map +1 -1
  124. package/resources/reactions.d.ts +24 -1
  125. package/resources/reactions.d.ts.map +1 -1
  126. package/resources/reactions.js +11 -0
  127. package/resources/reactions.js.map +1 -1
  128. package/resources/reactions.mjs +11 -0
  129. package/resources/reactions.mjs.map +1 -1
  130. package/resources/refunds.d.mts +1 -1
  131. package/resources/refunds.d.mts.map +1 -1
  132. package/resources/refunds.d.ts +1 -1
  133. package/resources/refunds.d.ts.map +1 -1
  134. package/resources/shared.d.mts +73 -1
  135. package/resources/shared.d.mts.map +1 -1
  136. package/resources/shared.d.ts +73 -1
  137. package/resources/shared.d.ts.map +1 -1
  138. package/resources/verifications.d.mts +11 -3
  139. package/resources/verifications.d.mts.map +1 -1
  140. package/resources/verifications.d.ts +11 -3
  141. package/resources/verifications.d.ts.map +1 -1
  142. package/resources/webhooks.d.mts +43 -293
  143. package/resources/webhooks.d.mts.map +1 -1
  144. package/resources/webhooks.d.ts +43 -293
  145. package/resources/webhooks.d.ts.map +1 -1
  146. package/resources/webhooks.js.map +1 -1
  147. package/resources/webhooks.mjs +2 -2
  148. package/resources/webhooks.mjs.map +1 -1
  149. package/resources/withdrawals.d.mts +21 -128
  150. package/resources/withdrawals.d.mts.map +1 -1
  151. package/resources/withdrawals.d.ts +21 -128
  152. package/resources/withdrawals.d.ts.map +1 -1
  153. package/src/client.ts +133 -18
  154. package/src/internal/parse.ts +6 -0
  155. package/src/resources/ai-chats.ts +227 -0
  156. package/src/resources/apps.ts +6 -0
  157. package/src/resources/authorized-users.ts +45 -5
  158. package/src/resources/checkout-configurations.ts +15 -0
  159. package/src/resources/company-token-transactions.ts +433 -0
  160. package/src/resources/dm-channels.ts +212 -0
  161. package/src/resources/dm-members.ts +248 -0
  162. package/src/resources/files.ts +8 -2
  163. package/src/resources/index.ts +64 -9
  164. package/src/resources/leads.ts +9 -205
  165. package/src/resources/ledger-accounts.ts +3 -35
  166. package/src/resources/members.ts +16 -6
  167. package/src/resources/memberships.ts +45 -9
  168. package/src/resources/messages.ts +22 -0
  169. package/src/resources/payments.ts +109 -57
  170. package/src/resources/payout-methods.ts +37 -2
  171. package/src/resources/reactions.ts +36 -0
  172. package/src/resources/refunds.ts +2 -1
  173. package/src/resources/shared.ts +110 -11
  174. package/src/resources/verifications.ts +49 -36
  175. package/src/resources/webhooks.ts +78 -728
  176. package/src/resources/withdrawals.ts +29 -205
  177. package/src/version.ts +1 -1
  178. package/version.d.mts +1 -1
  179. package/version.d.ts +1 -1
  180. package/version.js +1 -1
  181. package/version.mjs +1 -1
@@ -25,7 +25,7 @@ export class Withdrawals extends APIResource {
25
25
  * });
26
26
  * ```
27
27
  */
28
- create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<WithdrawalCreateResponse> {
28
+ create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<Withdrawal> {
29
29
  return this._client.post('/withdrawals', { body, ...options });
30
30
  }
31
31
 
@@ -44,7 +44,7 @@ export class Withdrawals extends APIResource {
44
44
  * );
45
45
  * ```
46
46
  */
47
- retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse> {
47
+ retrieve(id: string, options?: RequestOptions): APIPromise<Withdrawal> {
48
48
  return this._client.get(path`/withdrawals/${id}`, options);
49
49
  }
50
50
 
@@ -75,32 +75,10 @@ export class Withdrawals extends APIResource {
75
75
 
76
76
  export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
77
77
 
78
- /**
79
- * The different fee types for a withdrawal.
80
- */
81
- export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
82
-
83
- /**
84
- * The different speeds of withdrawals
85
- */
86
- export type WithdrawalSpeeds = 'standard' | 'instant';
87
-
88
- /**
89
- * The status of a withdrawal request
90
- */
91
- export type WithdrawalStatus =
92
- | 'requested'
93
- | 'awaiting_payment'
94
- | 'in_transit'
95
- | 'completed'
96
- | 'failed'
97
- | 'canceled'
98
- | 'denied';
99
-
100
78
  /**
101
79
  * A withdrawal request.
102
80
  */
103
- export interface WithdrawalCreateResponse {
81
+ export interface Withdrawal {
104
82
  /**
105
83
  * Internal ID of the withdrawal request.
106
84
  */
@@ -197,7 +175,7 @@ export interface WithdrawalCreateResponse {
197
175
  /**
198
176
  * The ledger account associated with the withdrawal.
199
177
  */
200
- ledger_account: WithdrawalCreateResponse.LedgerAccount;
178
+ ledger_account: Withdrawal.LedgerAccount;
201
179
 
202
180
  /**
203
181
  * The markup fee that was charged for the withdrawal. This is in the same currency
@@ -209,7 +187,7 @@ export interface WithdrawalCreateResponse {
209
187
  /**
210
188
  * The payout token used for the withdrawal, if applicable.
211
189
  */
212
- payout_token: WithdrawalCreateResponse.PayoutToken | null;
190
+ payout_token: Withdrawal.PayoutToken | null;
213
191
 
214
192
  /**
215
193
  * The speed of the withdrawal.
@@ -228,7 +206,7 @@ export interface WithdrawalCreateResponse {
228
206
  trace_code: string | null;
229
207
  }
230
208
 
231
- export namespace WithdrawalCreateResponse {
209
+ export namespace Withdrawal {
232
210
  /**
233
211
  * The ledger account associated with the withdrawal.
234
212
  */
@@ -278,184 +256,26 @@ export namespace WithdrawalCreateResponse {
278
256
  }
279
257
 
280
258
  /**
281
- * A withdrawal request.
259
+ * The different fee types for a withdrawal.
282
260
  */
283
- export interface WithdrawalRetrieveResponse {
284
- /**
285
- * Internal ID of the withdrawal request.
286
- */
287
- id: string;
288
-
289
- /**
290
- * How much money was attempted to be withdrawn, in a float type.
291
- */
292
- amount: number;
293
-
294
- /**
295
- * When the withdrawal request was created.
296
- */
297
- created_at: string;
298
-
299
- /**
300
- * The currency of the withdrawal request.
301
- */
302
- currency: Shared.Currency;
303
-
304
- /**
305
- * The different error codes a payout can be in.
306
- */
307
- error_code:
308
- | 'account_closed'
309
- | 'account_does_not_exist'
310
- | 'account_information_invalid'
311
- | 'account_number_invalid_region'
312
- | 'account_frozen'
313
- | 'account_lookup_failed'
314
- | 'account_not_found'
315
- | 'amount_out_of_bounds'
316
- | 'attributes_not_validated'
317
- | 'b2b_payments_prohibited'
318
- | 'bank_statement_required'
319
- | 'compliance_review'
320
- | 'currency_not_supported'
321
- | 'deposit_canceled'
322
- | 'deposit_failed'
323
- | 'deposit_rejected'
324
- | 'destination_unavailable'
325
- | 'exceeded_account_limit'
326
- | 'expired_quote'
327
- | 'generic_payout_error'
328
- | 'technical_problem'
329
- | 'identification_number_invalid'
330
- | 'invalid_account_number'
331
- | 'invalid_bank_code'
332
- | 'invalid_beneficiary'
333
- | 'invalid_mailing_address'
334
- | 'invalid_branch_number'
335
- | 'invalid_branch_code'
336
- | 'invalid_phone_number'
337
- | 'invalid_routing_number'
338
- | 'invalid_swift_code'
339
- | 'invalid_company_details'
340
- | 'manual_cancelation'
341
- | 'misc_error'
342
- | 'missing_city_and_country'
343
- | 'missing_phone_number'
344
- | 'missing_remittance_info'
345
- | 'payee_name_invalid'
346
- | 'receiving_account_locked'
347
- | 'rejected_by_compliance'
348
- | 'rtp_not_supported'
349
- | 'non_transaction_account'
350
- | 'source_token_insufficient_funds'
351
- | 'ssn_invalid'
352
- | 'wallet_screenshot_required'
353
- | 'unsupported_region'
354
- | null;
355
-
356
- /**
357
- * The error message for the withdrawal, if any.
358
- */
359
- error_message: string | null;
360
-
361
- /**
362
- * The estimated availability date for the withdrawal, if any.
363
- */
364
- estimated_availability: string | null;
365
-
366
- /**
367
- * The fee amount that was charged for the withdrawal. This is in the same currency
368
- * as the withdrawal amount.
369
- */
370
- fee_amount: number;
371
-
372
- /**
373
- * The different fee types for a withdrawal.
374
- */
375
- fee_type: WithdrawalFeeTypes | null;
376
-
377
- /**
378
- * The ledger account associated with the withdrawal.
379
- */
380
- ledger_account: WithdrawalRetrieveResponse.LedgerAccount;
381
-
382
- /**
383
- * The markup fee that was charged for the withdrawal. This is in the same currency
384
- * as the withdrawal amount. This only applies to platform accounts using Whop
385
- * Rails.
386
- */
387
- markup_fee: number;
388
-
389
- /**
390
- * The payout token used for the withdrawal, if applicable.
391
- */
392
- payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
393
-
394
- /**
395
- * The speed of the withdrawal.
396
- */
397
- speed: WithdrawalSpeeds;
398
-
399
- /**
400
- * Status of the withdrawal.
401
- */
402
- status: WithdrawalStatus;
403
-
404
- /**
405
- * The trace code for the payout, if applicable. Provided on ACH transactions when
406
- * available.
407
- */
408
- trace_code: string | null;
409
- }
410
-
411
- export namespace WithdrawalRetrieveResponse {
412
- /**
413
- * The ledger account associated with the withdrawal.
414
- */
415
- export interface LedgerAccount {
416
- /**
417
- * The ID of the LedgerAccount.
418
- */
419
- id: string;
420
-
421
- /**
422
- * The ID of the company associated with this ledger account.
423
- */
424
- company_id: string | null;
425
- }
426
-
427
- /**
428
- * The payout token used for the withdrawal, if applicable.
429
- */
430
- export interface PayoutToken {
431
- /**
432
- * The ID of the payout token
433
- */
434
- id: string;
435
-
436
- /**
437
- * The date and time the payout token was created
438
- */
439
- created_at: string;
440
-
441
- /**
442
- * The currency code of the payout destination. This is the currency that payouts
443
- * will be made in for this token.
444
- */
445
- destination_currency_code: string;
261
+ export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
446
262
 
447
- /**
448
- * An optional nickname for the payout token to help the user identify it. This is
449
- * not used by the provider and is only for the user's reference.
450
- */
451
- nickname: string | null;
263
+ /**
264
+ * The different speeds of withdrawals
265
+ */
266
+ export type WithdrawalSpeeds = 'standard' | 'instant';
452
267
 
453
- /**
454
- * The name of the payer associated with the payout token.
455
- */
456
- payer_name: string | null;
457
- }
458
- }
268
+ /**
269
+ * The status of a withdrawal request
270
+ */
271
+ export type WithdrawalStatus =
272
+ | 'requested'
273
+ | 'awaiting_payment'
274
+ | 'in_transit'
275
+ | 'completed'
276
+ | 'failed'
277
+ | 'canceled'
278
+ | 'denied';
459
279
 
460
280
  /**
461
281
  * A withdrawal request.
@@ -531,6 +351,11 @@ export interface WithdrawalCreateParams {
531
351
  */
532
352
  payout_method_id?: string | null;
533
353
 
354
+ /**
355
+ * Whether the platform covers the payout fees instead of the connected account.
356
+ */
357
+ platform_covers_fees?: boolean | null;
358
+
534
359
  /**
535
360
  * Custom statement descriptor for the withdrawal. Must be between 5 and 22
536
361
  * characters and contain only alphanumeric characters.
@@ -577,11 +402,10 @@ export interface WithdrawalListParams extends CursorPageParams {
577
402
 
578
403
  export declare namespace Withdrawals {
579
404
  export {
405
+ type Withdrawal as Withdrawal,
580
406
  type WithdrawalFeeTypes as WithdrawalFeeTypes,
581
407
  type WithdrawalSpeeds as WithdrawalSpeeds,
582
408
  type WithdrawalStatus as WithdrawalStatus,
583
- type WithdrawalCreateResponse as WithdrawalCreateResponse,
584
- type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
585
409
  type WithdrawalListResponse as WithdrawalListResponse,
586
410
  type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
587
411
  type WithdrawalCreateParams as WithdrawalCreateParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.24'; // x-release-please-version
1
+ export const VERSION = '0.0.26'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.24";
1
+ export declare const VERSION = "0.0.26";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.24";
1
+ export declare const VERSION = "0.0.26";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.24'; // x-release-please-version
4
+ exports.VERSION = '0.0.26'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.24'; // x-release-please-version
1
+ export const VERSION = '0.0.26'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map