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