@whop/sdk 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -99
- package/client.d.mts +161 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +161 -13
- package/client.d.ts.map +1 -1
- package/client.js +158 -7
- package/client.js.map +1 -1
- package/client.mjs +158 -7
- package/client.mjs.map +1 -1
- package/internal/tslib.js +22 -22
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/access-tokens.d.mts +3 -0
- package/resources/access-tokens.d.mts.map +1 -1
- package/resources/access-tokens.d.ts +3 -0
- package/resources/access-tokens.d.ts.map +1 -1
- package/resources/access-tokens.js +3 -0
- package/resources/access-tokens.js.map +1 -1
- package/resources/access-tokens.mjs +3 -0
- package/resources/access-tokens.mjs.map +1 -1
- package/resources/account-links.d.mts +3 -0
- package/resources/account-links.d.mts.map +1 -1
- package/resources/account-links.d.ts +3 -0
- package/resources/account-links.d.ts.map +1 -1
- package/resources/account-links.js +3 -0
- package/resources/account-links.js.map +1 -1
- package/resources/account-links.mjs +3 -0
- package/resources/account-links.mjs.map +1 -1
- package/resources/ai-chats.d.mts +8 -0
- package/resources/ai-chats.d.mts.map +1 -1
- package/resources/ai-chats.d.ts +8 -0
- package/resources/ai-chats.d.ts.map +1 -1
- package/resources/ai-chats.js +3 -0
- package/resources/ai-chats.js.map +1 -1
- package/resources/ai-chats.mjs +3 -0
- package/resources/ai-chats.mjs.map +1 -1
- package/resources/app-builds.d.mts +3 -0
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +3 -0
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +3 -0
- package/resources/app-builds.js.map +1 -1
- package/resources/app-builds.mjs +3 -0
- package/resources/app-builds.mjs.map +1 -1
- package/resources/apps.d.mts +3 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +3 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js +3 -0
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs +3 -0
- package/resources/apps.mjs.map +1 -1
- package/resources/authorized-users.d.mts +142 -1
- package/resources/authorized-users.d.mts.map +1 -1
- package/resources/authorized-users.d.ts +142 -1
- package/resources/authorized-users.d.ts.map +1 -1
- package/resources/authorized-users.js +57 -0
- package/resources/authorized-users.js.map +1 -1
- package/resources/authorized-users.mjs +57 -0
- package/resources/authorized-users.mjs.map +1 -1
- package/resources/chat-channels.d.mts +3 -0
- package/resources/chat-channels.d.mts.map +1 -1
- package/resources/chat-channels.d.ts +3 -0
- package/resources/chat-channels.d.ts.map +1 -1
- package/resources/chat-channels.js +3 -0
- package/resources/chat-channels.js.map +1 -1
- package/resources/chat-channels.mjs +3 -0
- package/resources/chat-channels.mjs.map +1 -1
- package/resources/checkout-configurations.d.mts +3 -13
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +3 -13
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +3 -0
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +3 -0
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +54 -34
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +54 -34
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +3 -0
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +3 -0
- package/resources/companies.mjs.map +1 -1
- package/resources/company-token-transactions.d.mts +3 -0
- package/resources/company-token-transactions.d.mts.map +1 -1
- package/resources/company-token-transactions.d.ts +3 -0
- package/resources/company-token-transactions.d.ts.map +1 -1
- package/resources/company-token-transactions.js +3 -0
- package/resources/company-token-transactions.js.map +1 -1
- package/resources/company-token-transactions.mjs +3 -0
- package/resources/company-token-transactions.mjs.map +1 -1
- package/resources/course-chapters.d.mts +3 -0
- package/resources/course-chapters.d.mts.map +1 -1
- package/resources/course-chapters.d.ts +3 -0
- package/resources/course-chapters.d.ts.map +1 -1
- package/resources/course-chapters.js +3 -0
- package/resources/course-chapters.js.map +1 -1
- package/resources/course-chapters.mjs +3 -0
- package/resources/course-chapters.mjs.map +1 -1
- package/resources/course-lesson-interactions.d.mts +3 -0
- package/resources/course-lesson-interactions.d.mts.map +1 -1
- package/resources/course-lesson-interactions.d.ts +3 -0
- package/resources/course-lesson-interactions.d.ts.map +1 -1
- package/resources/course-lesson-interactions.js +3 -0
- package/resources/course-lesson-interactions.js.map +1 -1
- package/resources/course-lesson-interactions.mjs +3 -0
- package/resources/course-lesson-interactions.mjs.map +1 -1
- package/resources/course-lessons.d.mts +3 -0
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +3 -0
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-lessons.js +3 -0
- package/resources/course-lessons.js.map +1 -1
- package/resources/course-lessons.mjs +3 -0
- package/resources/course-lessons.mjs.map +1 -1
- package/resources/course-students.d.mts +3 -0
- package/resources/course-students.d.mts.map +1 -1
- package/resources/course-students.d.ts +3 -0
- package/resources/course-students.d.ts.map +1 -1
- package/resources/course-students.js +3 -0
- package/resources/course-students.js.map +1 -1
- package/resources/course-students.mjs +3 -0
- package/resources/course-students.mjs.map +1 -1
- package/resources/courses.d.mts +3 -0
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +3 -0
- package/resources/courses.d.ts.map +1 -1
- package/resources/courses.js +3 -0
- package/resources/courses.js.map +1 -1
- package/resources/courses.mjs +3 -0
- package/resources/courses.mjs.map +1 -1
- package/resources/dispute-alerts.d.mts +3 -0
- package/resources/dispute-alerts.d.mts.map +1 -1
- package/resources/dispute-alerts.d.ts +3 -0
- package/resources/dispute-alerts.d.ts.map +1 -1
- package/resources/dispute-alerts.js +3 -0
- package/resources/dispute-alerts.js.map +1 -1
- package/resources/dispute-alerts.mjs +3 -0
- package/resources/dispute-alerts.mjs.map +1 -1
- package/resources/disputes.d.mts +3 -0
- package/resources/disputes.d.mts.map +1 -1
- package/resources/disputes.d.ts +3 -0
- package/resources/disputes.d.ts.map +1 -1
- package/resources/disputes.js +3 -0
- package/resources/disputes.js.map +1 -1
- package/resources/disputes.mjs +3 -0
- package/resources/disputes.mjs.map +1 -1
- package/resources/dm-channels.d.mts +3 -0
- package/resources/dm-channels.d.mts.map +1 -1
- package/resources/dm-channels.d.ts +3 -0
- package/resources/dm-channels.d.ts.map +1 -1
- package/resources/dm-channels.js +3 -0
- package/resources/dm-channels.js.map +1 -1
- package/resources/dm-channels.mjs +3 -0
- package/resources/dm-channels.mjs.map +1 -1
- package/resources/dm-members.d.mts +3 -0
- package/resources/dm-members.d.mts.map +1 -1
- package/resources/dm-members.d.ts +3 -0
- package/resources/dm-members.d.ts.map +1 -1
- package/resources/dm-members.js +3 -0
- package/resources/dm-members.js.map +1 -1
- package/resources/dm-members.mjs +3 -0
- package/resources/dm-members.mjs.map +1 -1
- package/resources/entries.d.mts +3 -0
- package/resources/entries.d.mts.map +1 -1
- package/resources/entries.d.ts +3 -0
- package/resources/entries.d.ts.map +1 -1
- package/resources/entries.js +3 -0
- package/resources/entries.js.map +1 -1
- package/resources/entries.mjs +3 -0
- package/resources/entries.mjs.map +1 -1
- package/resources/experiences.d.mts +3 -0
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +3 -0
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +3 -0
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +3 -0
- package/resources/experiences.mjs.map +1 -1
- package/resources/fee-markups.d.mts +3 -0
- package/resources/fee-markups.d.mts.map +1 -1
- package/resources/fee-markups.d.ts +3 -0
- package/resources/fee-markups.d.ts.map +1 -1
- package/resources/fee-markups.js +3 -0
- package/resources/fee-markups.js.map +1 -1
- package/resources/fee-markups.mjs +3 -0
- package/resources/fee-markups.mjs.map +1 -1
- package/resources/files.d.mts +3 -0
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +3 -0
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +3 -0
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +3 -0
- package/resources/files.mjs.map +1 -1
- package/resources/forum-posts.d.mts +38 -0
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +38 -0
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +3 -0
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +3 -0
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/forums.d.mts +20 -0
- package/resources/forums.d.mts.map +1 -1
- package/resources/forums.d.ts +20 -0
- package/resources/forums.d.ts.map +1 -1
- package/resources/forums.js +3 -0
- package/resources/forums.js.map +1 -1
- package/resources/forums.mjs +3 -0
- package/resources/forums.mjs.map +1 -1
- package/resources/index.d.mts +5 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -5
- 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 +141 -8
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +141 -8
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +4 -4
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +4 -4
- package/resources/invoices.mjs.map +1 -1
- package/resources/leads.d.mts +3 -0
- package/resources/leads.d.mts.map +1 -1
- package/resources/leads.d.ts +3 -0
- package/resources/leads.d.ts.map +1 -1
- package/resources/leads.js +3 -0
- package/resources/leads.js.map +1 -1
- package/resources/leads.mjs +3 -0
- package/resources/leads.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +3 -0
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +3 -0
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js +3 -0
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs +3 -0
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/members.d.mts +3 -0
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +3 -0
- package/resources/members.d.ts.map +1 -1
- package/resources/members.js +3 -0
- package/resources/members.js.map +1 -1
- package/resources/members.mjs +3 -0
- package/resources/members.mjs.map +1 -1
- package/resources/memberships.d.mts +81 -2
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +81 -2
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +75 -1
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +75 -1
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +12 -0
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +12 -0
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +3 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +3 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications.d.mts +3 -0
- package/resources/notifications.d.mts.map +1 -1
- package/resources/notifications.d.ts +3 -0
- package/resources/notifications.d.ts.map +1 -1
- package/resources/notifications.js +3 -0
- package/resources/notifications.js.map +1 -1
- package/resources/notifications.mjs +3 -0
- package/resources/notifications.mjs.map +1 -1
- package/resources/payment-methods.d.mts +3 -0
- package/resources/payment-methods.d.mts.map +1 -1
- package/resources/payment-methods.d.ts +3 -0
- package/resources/payment-methods.d.ts.map +1 -1
- package/resources/payment-methods.js +3 -0
- package/resources/payment-methods.js.map +1 -1
- package/resources/payment-methods.mjs +3 -0
- package/resources/payment-methods.mjs.map +1 -1
- package/resources/payments.d.mts +19 -15
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +19 -15
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +3 -0
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +3 -0
- package/resources/payments.mjs.map +1 -1
- package/resources/payout-methods.d.mts +3 -0
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +3 -0
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js +3 -0
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs +3 -0
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/plans.d.mts +3 -0
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +3 -0
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js +3 -0
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs +3 -0
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +4 -29
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +4 -29
- package/resources/products.d.ts.map +1 -1
- package/resources/products.js +3 -0
- package/resources/products.js.map +1 -1
- package/resources/products.mjs +3 -0
- package/resources/products.mjs.map +1 -1
- package/resources/promo-codes.d.mts +3 -0
- package/resources/promo-codes.d.mts.map +1 -1
- package/resources/promo-codes.d.ts +3 -0
- package/resources/promo-codes.d.ts.map +1 -1
- package/resources/promo-codes.js +3 -0
- package/resources/promo-codes.js.map +1 -1
- package/resources/promo-codes.mjs +3 -0
- package/resources/promo-codes.mjs.map +1 -1
- package/resources/reactions.d.mts +3 -0
- package/resources/reactions.d.mts.map +1 -1
- package/resources/reactions.d.ts +3 -0
- package/resources/reactions.d.ts.map +1 -1
- package/resources/reactions.js +3 -0
- package/resources/reactions.js.map +1 -1
- package/resources/reactions.mjs +3 -0
- package/resources/reactions.mjs.map +1 -1
- package/resources/refunds.d.mts +17 -1
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +17 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js +3 -0
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs +3 -0
- package/resources/refunds.mjs.map +1 -1
- package/resources/reviews.d.mts +3 -0
- package/resources/reviews.d.mts.map +1 -1
- package/resources/reviews.d.ts +3 -0
- package/resources/reviews.d.ts.map +1 -1
- package/resources/reviews.js +3 -0
- package/resources/reviews.js.map +1 -1
- package/resources/reviews.mjs +3 -0
- package/resources/reviews.mjs.map +1 -1
- package/resources/setup-intents.d.mts +3 -0
- package/resources/setup-intents.d.mts.map +1 -1
- package/resources/setup-intents.d.ts +3 -0
- package/resources/setup-intents.d.ts.map +1 -1
- package/resources/setup-intents.js +3 -0
- package/resources/setup-intents.js.map +1 -1
- package/resources/setup-intents.mjs +3 -0
- package/resources/setup-intents.mjs.map +1 -1
- package/resources/shared.d.mts +55 -34
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +55 -34
- package/resources/shared.d.ts.map +1 -1
- package/resources/shipments.d.mts +3 -0
- package/resources/shipments.d.mts.map +1 -1
- package/resources/shipments.d.ts +3 -0
- package/resources/shipments.d.ts.map +1 -1
- package/resources/shipments.js +3 -0
- package/resources/shipments.js.map +1 -1
- package/resources/shipments.mjs +3 -0
- package/resources/shipments.mjs.map +1 -1
- package/resources/support-channels.d.mts +3 -0
- package/resources/support-channels.d.mts.map +1 -1
- package/resources/support-channels.d.ts +3 -0
- package/resources/support-channels.d.ts.map +1 -1
- package/resources/support-channels.js +3 -0
- package/resources/support-channels.js.map +1 -1
- package/resources/support-channels.mjs +3 -0
- package/resources/support-channels.mjs.map +1 -1
- package/resources/topups.d.mts +3 -0
- package/resources/topups.d.mts.map +1 -1
- package/resources/topups.d.ts +3 -0
- package/resources/topups.d.ts.map +1 -1
- package/resources/topups.js +3 -0
- package/resources/topups.js.map +1 -1
- package/resources/topups.mjs +3 -0
- package/resources/topups.mjs.map +1 -1
- package/resources/transfers.d.mts +3 -0
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +3 -0
- package/resources/transfers.d.ts.map +1 -1
- package/resources/transfers.js +3 -0
- package/resources/transfers.js.map +1 -1
- package/resources/transfers.mjs +3 -0
- package/resources/transfers.mjs.map +1 -1
- package/resources/users.d.mts +3 -0
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +3 -0
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +3 -0
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -1
- package/resources/verifications.d.mts +3 -0
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +3 -0
- package/resources/verifications.d.ts.map +1 -1
- package/resources/verifications.js +3 -0
- package/resources/verifications.js.map +1 -1
- package/resources/verifications.mjs +3 -0
- package/resources/verifications.mjs.map +1 -1
- package/resources/webhooks.d.mts +29 -0
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +29 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +3 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +3 -0
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +3 -0
- package/resources/withdrawals.d.mts.map +1 -1
- package/resources/withdrawals.d.ts +3 -0
- package/resources/withdrawals.d.ts.map +1 -1
- package/resources/withdrawals.js +3 -0
- package/resources/withdrawals.js.map +1 -1
- package/resources/withdrawals.mjs +3 -0
- package/resources/withdrawals.mjs.map +1 -1
- package/src/client.ts +175 -14
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/access-tokens.ts +3 -0
- package/src/resources/account-links.ts +3 -0
- package/src/resources/ai-chats.ts +9 -0
- package/src/resources/app-builds.ts +3 -0
- package/src/resources/apps.ts +3 -0
- package/src/resources/authorized-users.ts +175 -0
- package/src/resources/chat-channels.ts +3 -0
- package/src/resources/checkout-configurations.ts +3 -16
- package/src/resources/companies.ts +72 -41
- package/src/resources/company-token-transactions.ts +3 -0
- package/src/resources/course-chapters.ts +3 -0
- package/src/resources/course-lesson-interactions.ts +3 -0
- package/src/resources/course-lessons.ts +3 -0
- package/src/resources/course-students.ts +3 -0
- package/src/resources/courses.ts +3 -0
- package/src/resources/dispute-alerts.ts +3 -0
- package/src/resources/disputes.ts +3 -0
- package/src/resources/dm-channels.ts +3 -0
- package/src/resources/dm-members.ts +3 -0
- package/src/resources/entries.ts +3 -0
- package/src/resources/experiences.ts +3 -0
- package/src/resources/fee-markups.ts +3 -0
- package/src/resources/files.ts +3 -0
- package/src/resources/forum-posts.ts +44 -0
- package/src/resources/forums.ts +22 -0
- package/src/resources/index.ts +7 -1
- package/src/resources/invoices.ts +162 -9
- package/src/resources/leads.ts +3 -0
- package/src/resources/ledger-accounts.ts +3 -0
- package/src/resources/members.ts +3 -0
- package/src/resources/memberships.ts +89 -1
- package/src/resources/messages.ts +14 -0
- package/src/resources/notifications.ts +3 -0
- package/src/resources/payment-methods.ts +3 -0
- package/src/resources/payments.ts +22 -16
- package/src/resources/payout-methods.ts +3 -0
- package/src/resources/plans.ts +3 -0
- package/src/resources/products.ts +3 -174
- package/src/resources/promo-codes.ts +3 -0
- package/src/resources/reactions.ts +3 -0
- package/src/resources/refunds.ts +21 -1
- package/src/resources/reviews.ts +3 -0
- package/src/resources/setup-intents.ts +3 -0
- package/src/resources/shared.ts +66 -2011
- package/src/resources/shipments.ts +3 -0
- package/src/resources/support-channels.ts +3 -0
- package/src/resources/topups.ts +3 -0
- package/src/resources/transfers.ts +3 -0
- package/src/resources/users.ts +3 -0
- package/src/resources/verifications.ts +3 -0
- package/src/resources/webhooks.ts +35 -0
- package/src/resources/withdrawals.ts +3 -0
- 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
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
-
import
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
17
|
import * as Pagination from './core/pagination';
|
|
@@ -48,6 +48,10 @@ import {
|
|
|
48
48
|
Apps,
|
|
49
49
|
} from './resources/apps';
|
|
50
50
|
import {
|
|
51
|
+
AuthorizedUserCreateParams,
|
|
52
|
+
AuthorizedUserCreateResponse,
|
|
53
|
+
AuthorizedUserDeleteParams,
|
|
54
|
+
AuthorizedUserDeleteResponse,
|
|
51
55
|
AuthorizedUserListParams,
|
|
52
56
|
AuthorizedUserListResponse,
|
|
53
57
|
AuthorizedUserListResponsesCursorPage,
|
|
@@ -76,6 +80,7 @@ import {
|
|
|
76
80
|
CompanyListResponse,
|
|
77
81
|
CompanyListResponsesCursorPage,
|
|
78
82
|
CompanyUpdateParams,
|
|
83
|
+
SocialLinkWebsites,
|
|
79
84
|
} from './resources/companies';
|
|
80
85
|
import {
|
|
81
86
|
CompanyTokenTransaction,
|
|
@@ -248,6 +253,7 @@ import {
|
|
|
248
253
|
} from './resources/members';
|
|
249
254
|
import {
|
|
250
255
|
CancelOptions,
|
|
256
|
+
MembershipAddFreeDaysParams,
|
|
251
257
|
MembershipCancelParams,
|
|
252
258
|
MembershipListParams,
|
|
253
259
|
MembershipListResponse,
|
|
@@ -291,6 +297,7 @@ import {
|
|
|
291
297
|
PaymentMethodTypes,
|
|
292
298
|
PaymentRefundParams,
|
|
293
299
|
Payments,
|
|
300
|
+
ReceiptTaxBehavior,
|
|
294
301
|
} from './resources/payments';
|
|
295
302
|
import {
|
|
296
303
|
PayoutDestinationCategory,
|
|
@@ -310,7 +317,6 @@ import {
|
|
|
310
317
|
Plans,
|
|
311
318
|
} from './resources/plans';
|
|
312
319
|
import {
|
|
313
|
-
IndustryGroups,
|
|
314
320
|
ProductCreateParams,
|
|
315
321
|
ProductDeleteResponse,
|
|
316
322
|
ProductListParams,
|
|
@@ -667,8 +673,8 @@ export class Whop {
|
|
|
667
673
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
668
674
|
}
|
|
669
675
|
|
|
670
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
671
|
-
return
|
|
676
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
677
|
+
return stringifyQuery(query);
|
|
672
678
|
}
|
|
673
679
|
|
|
674
680
|
private getUserAgent(): string {
|
|
@@ -700,12 +706,13 @@ export class Whop {
|
|
|
700
706
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
701
707
|
|
|
702
708
|
const defaultQuery = this.defaultQuery();
|
|
703
|
-
|
|
704
|
-
|
|
709
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
710
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
711
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
705
712
|
}
|
|
706
713
|
|
|
707
714
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
708
|
-
url.search = this.stringifyQuery(query
|
|
715
|
+
url.search = this.stringifyQuery(query);
|
|
709
716
|
}
|
|
710
717
|
|
|
711
718
|
return url.toString();
|
|
@@ -1034,9 +1041,9 @@ export class Whop {
|
|
|
1034
1041
|
}
|
|
1035
1042
|
}
|
|
1036
1043
|
|
|
1037
|
-
// If the API asks us to wait a certain amount of time
|
|
1038
|
-
//
|
|
1039
|
-
if (
|
|
1044
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
1045
|
+
// says, but otherwise calculate a default
|
|
1046
|
+
if (timeoutMillis === undefined) {
|
|
1040
1047
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
1041
1048
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
1042
1049
|
}
|
|
@@ -1169,7 +1176,7 @@ export class Whop {
|
|
|
1169
1176
|
) {
|
|
1170
1177
|
return {
|
|
1171
1178
|
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
1172
|
-
body: this.stringifyQuery(body
|
|
1179
|
+
body: this.stringifyQuery(body),
|
|
1173
1180
|
};
|
|
1174
1181
|
} else {
|
|
1175
1182
|
return this.#encoder({ body, headers });
|
|
@@ -1197,55 +1204,205 @@ export class Whop {
|
|
|
1197
1204
|
|
|
1198
1205
|
static toFile = Uploads.toFile;
|
|
1199
1206
|
|
|
1207
|
+
/**
|
|
1208
|
+
* Apps
|
|
1209
|
+
*/
|
|
1200
1210
|
apps: API.Apps = new API.Apps(this);
|
|
1211
|
+
/**
|
|
1212
|
+
* Invoices
|
|
1213
|
+
*/
|
|
1201
1214
|
invoices: API.Invoices = new API.Invoices(this);
|
|
1215
|
+
/**
|
|
1216
|
+
* Course lesson interactions
|
|
1217
|
+
*/
|
|
1202
1218
|
courseLessonInteractions: API.CourseLessonInteractions = new API.CourseLessonInteractions(this);
|
|
1219
|
+
/**
|
|
1220
|
+
* Products
|
|
1221
|
+
*/
|
|
1203
1222
|
products: API.Products = new API.Products(this);
|
|
1223
|
+
/**
|
|
1224
|
+
* Companies
|
|
1225
|
+
*/
|
|
1204
1226
|
companies: API.Companies = new API.Companies(this);
|
|
1227
|
+
/**
|
|
1228
|
+
* Webhooks
|
|
1229
|
+
*/
|
|
1205
1230
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
1231
|
+
/**
|
|
1232
|
+
* Plans
|
|
1233
|
+
*/
|
|
1206
1234
|
plans: API.Plans = new API.Plans(this);
|
|
1235
|
+
/**
|
|
1236
|
+
* Entries
|
|
1237
|
+
*/
|
|
1207
1238
|
entries: API.Entries = new API.Entries(this);
|
|
1239
|
+
/**
|
|
1240
|
+
* Forum posts
|
|
1241
|
+
*/
|
|
1208
1242
|
forumPosts: API.ForumPosts = new API.ForumPosts(this);
|
|
1243
|
+
/**
|
|
1244
|
+
* Transfers
|
|
1245
|
+
*/
|
|
1209
1246
|
transfers: API.Transfers = new API.Transfers(this);
|
|
1247
|
+
/**
|
|
1248
|
+
* Ledger accounts
|
|
1249
|
+
*/
|
|
1210
1250
|
ledgerAccounts: API.LedgerAccounts = new API.LedgerAccounts(this);
|
|
1251
|
+
/**
|
|
1252
|
+
* Memberships
|
|
1253
|
+
*/
|
|
1211
1254
|
memberships: API.Memberships = new API.Memberships(this);
|
|
1255
|
+
/**
|
|
1256
|
+
* Authorized users
|
|
1257
|
+
*/
|
|
1212
1258
|
authorizedUsers: API.AuthorizedUsers = new API.AuthorizedUsers(this);
|
|
1259
|
+
/**
|
|
1260
|
+
* App builds
|
|
1261
|
+
*/
|
|
1213
1262
|
appBuilds: API.AppBuilds = new API.AppBuilds(this);
|
|
1263
|
+
/**
|
|
1264
|
+
* Shipments
|
|
1265
|
+
*/
|
|
1214
1266
|
shipments: API.Shipments = new API.Shipments(this);
|
|
1267
|
+
/**
|
|
1268
|
+
* Checkout configurations
|
|
1269
|
+
*/
|
|
1215
1270
|
checkoutConfigurations: API.CheckoutConfigurations = new API.CheckoutConfigurations(this);
|
|
1271
|
+
/**
|
|
1272
|
+
* Messages
|
|
1273
|
+
*/
|
|
1216
1274
|
messages: API.Messages = new API.Messages(this);
|
|
1275
|
+
/**
|
|
1276
|
+
* Chat channels
|
|
1277
|
+
*/
|
|
1217
1278
|
chatChannels: API.ChatChannels = new API.ChatChannels(this);
|
|
1279
|
+
/**
|
|
1280
|
+
* Users
|
|
1281
|
+
*/
|
|
1218
1282
|
users: API.Users = new API.Users(this);
|
|
1283
|
+
/**
|
|
1284
|
+
* Payments
|
|
1285
|
+
*/
|
|
1219
1286
|
payments: API.Payments = new API.Payments(this);
|
|
1287
|
+
/**
|
|
1288
|
+
* Support channels
|
|
1289
|
+
*/
|
|
1220
1290
|
supportChannels: API.SupportChannels = new API.SupportChannels(this);
|
|
1291
|
+
/**
|
|
1292
|
+
* Experiences
|
|
1293
|
+
*/
|
|
1221
1294
|
experiences: API.Experiences = new API.Experiences(this);
|
|
1295
|
+
/**
|
|
1296
|
+
* Reactions
|
|
1297
|
+
*/
|
|
1222
1298
|
reactions: API.Reactions = new API.Reactions(this);
|
|
1299
|
+
/**
|
|
1300
|
+
* Members
|
|
1301
|
+
*/
|
|
1223
1302
|
members: API.Members = new API.Members(this);
|
|
1303
|
+
/**
|
|
1304
|
+
* Forums
|
|
1305
|
+
*/
|
|
1224
1306
|
forums: API.Forums = new API.Forums(this);
|
|
1307
|
+
/**
|
|
1308
|
+
* Promo codes
|
|
1309
|
+
*/
|
|
1225
1310
|
promoCodes: API.PromoCodes = new API.PromoCodes(this);
|
|
1311
|
+
/**
|
|
1312
|
+
* Courses
|
|
1313
|
+
*/
|
|
1226
1314
|
courses: API.Courses = new API.Courses(this);
|
|
1315
|
+
/**
|
|
1316
|
+
* Course chapters
|
|
1317
|
+
*/
|
|
1227
1318
|
courseChapters: API.CourseChapters = new API.CourseChapters(this);
|
|
1319
|
+
/**
|
|
1320
|
+
* Course lessons
|
|
1321
|
+
*/
|
|
1228
1322
|
courseLessons: API.CourseLessons = new API.CourseLessons(this);
|
|
1323
|
+
/**
|
|
1324
|
+
* Reviews
|
|
1325
|
+
*/
|
|
1229
1326
|
reviews: API.Reviews = new API.Reviews(this);
|
|
1327
|
+
/**
|
|
1328
|
+
* Course students
|
|
1329
|
+
*/
|
|
1230
1330
|
courseStudents: API.CourseStudents = new API.CourseStudents(this);
|
|
1331
|
+
/**
|
|
1332
|
+
* Access tokens
|
|
1333
|
+
*/
|
|
1231
1334
|
accessTokens: API.AccessTokens = new API.AccessTokens(this);
|
|
1335
|
+
/**
|
|
1336
|
+
* Notifications
|
|
1337
|
+
*/
|
|
1232
1338
|
notifications: API.Notifications = new API.Notifications(this);
|
|
1339
|
+
/**
|
|
1340
|
+
* Disputes
|
|
1341
|
+
*/
|
|
1233
1342
|
disputes: API.Disputes = new API.Disputes(this);
|
|
1343
|
+
/**
|
|
1344
|
+
* Refunds
|
|
1345
|
+
*/
|
|
1234
1346
|
refunds: API.Refunds = new API.Refunds(this);
|
|
1347
|
+
/**
|
|
1348
|
+
* Withdrawals
|
|
1349
|
+
*/
|
|
1235
1350
|
withdrawals: API.Withdrawals = new API.Withdrawals(this);
|
|
1351
|
+
/**
|
|
1352
|
+
* Account links
|
|
1353
|
+
*/
|
|
1236
1354
|
accountLinks: API.AccountLinks = new API.AccountLinks(this);
|
|
1355
|
+
/**
|
|
1356
|
+
* Setup intents
|
|
1357
|
+
*/
|
|
1237
1358
|
setupIntents: API.SetupIntents = new API.SetupIntents(this);
|
|
1359
|
+
/**
|
|
1360
|
+
* Payment methods
|
|
1361
|
+
*/
|
|
1238
1362
|
paymentMethods: API.PaymentMethods = new API.PaymentMethods(this);
|
|
1363
|
+
/**
|
|
1364
|
+
* Fee markups
|
|
1365
|
+
*/
|
|
1239
1366
|
feeMarkups: API.FeeMarkups = new API.FeeMarkups(this);
|
|
1367
|
+
/**
|
|
1368
|
+
* Payout methods
|
|
1369
|
+
*/
|
|
1240
1370
|
payoutMethods: API.PayoutMethods = new API.PayoutMethods(this);
|
|
1371
|
+
/**
|
|
1372
|
+
* Verifications
|
|
1373
|
+
*/
|
|
1241
1374
|
verifications: API.Verifications = new API.Verifications(this);
|
|
1375
|
+
/**
|
|
1376
|
+
* Leads
|
|
1377
|
+
*/
|
|
1242
1378
|
leads: API.Leads = new API.Leads(this);
|
|
1379
|
+
/**
|
|
1380
|
+
* Topups
|
|
1381
|
+
*/
|
|
1243
1382
|
topups: API.Topups = new API.Topups(this);
|
|
1383
|
+
/**
|
|
1384
|
+
* Files
|
|
1385
|
+
*/
|
|
1244
1386
|
files: API.Files = new API.Files(this);
|
|
1387
|
+
/**
|
|
1388
|
+
* Company token transactions
|
|
1389
|
+
*/
|
|
1245
1390
|
companyTokenTransactions: API.CompanyTokenTransactions = new API.CompanyTokenTransactions(this);
|
|
1391
|
+
/**
|
|
1392
|
+
* Dm members
|
|
1393
|
+
*/
|
|
1246
1394
|
dmMembers: API.DmMembers = new API.DmMembers(this);
|
|
1395
|
+
/**
|
|
1396
|
+
* Ai chats
|
|
1397
|
+
*/
|
|
1247
1398
|
aiChats: API.AIChats = new API.AIChats(this);
|
|
1399
|
+
/**
|
|
1400
|
+
* Dm channels
|
|
1401
|
+
*/
|
|
1248
1402
|
dmChannels: API.DmChannels = new API.DmChannels(this);
|
|
1403
|
+
/**
|
|
1404
|
+
* Dispute alerts
|
|
1405
|
+
*/
|
|
1249
1406
|
disputeAlerts: API.DisputeAlerts = new API.DisputeAlerts(this);
|
|
1250
1407
|
}
|
|
1251
1408
|
|
|
@@ -1330,7 +1487,6 @@ export declare namespace Whop {
|
|
|
1330
1487
|
|
|
1331
1488
|
export {
|
|
1332
1489
|
Products as Products,
|
|
1333
|
-
type IndustryGroups as IndustryGroups,
|
|
1334
1490
|
type ProductDeleteResponse as ProductDeleteResponse,
|
|
1335
1491
|
type ProductCreateParams as ProductCreateParams,
|
|
1336
1492
|
type ProductUpdateParams as ProductUpdateParams,
|
|
@@ -1339,6 +1495,7 @@ export declare namespace Whop {
|
|
|
1339
1495
|
|
|
1340
1496
|
export {
|
|
1341
1497
|
Companies as Companies,
|
|
1498
|
+
type SocialLinkWebsites as SocialLinkWebsites,
|
|
1342
1499
|
type CompanyListResponse as CompanyListResponse,
|
|
1343
1500
|
type CompanyListResponsesCursorPage as CompanyListResponsesCursorPage,
|
|
1344
1501
|
type CompanyCreateParams as CompanyCreateParams,
|
|
@@ -1437,16 +1594,21 @@ export declare namespace Whop {
|
|
|
1437
1594
|
type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
|
|
1438
1595
|
type MembershipUpdateParams as MembershipUpdateParams,
|
|
1439
1596
|
type MembershipListParams as MembershipListParams,
|
|
1597
|
+
type MembershipAddFreeDaysParams as MembershipAddFreeDaysParams,
|
|
1440
1598
|
type MembershipCancelParams as MembershipCancelParams,
|
|
1441
1599
|
type MembershipPauseParams as MembershipPauseParams,
|
|
1442
1600
|
};
|
|
1443
1601
|
|
|
1444
1602
|
export {
|
|
1445
1603
|
AuthorizedUsers as AuthorizedUsers,
|
|
1604
|
+
type AuthorizedUserCreateResponse as AuthorizedUserCreateResponse,
|
|
1446
1605
|
type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
|
|
1447
1606
|
type AuthorizedUserListResponse as AuthorizedUserListResponse,
|
|
1607
|
+
type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
|
|
1448
1608
|
type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
|
|
1609
|
+
type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
|
|
1449
1610
|
type AuthorizedUserListParams as AuthorizedUserListParams,
|
|
1611
|
+
type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
|
|
1450
1612
|
};
|
|
1451
1613
|
|
|
1452
1614
|
export {
|
|
@@ -1505,6 +1667,7 @@ export declare namespace Whop {
|
|
|
1505
1667
|
type BillingReasons as BillingReasons,
|
|
1506
1668
|
type CardBrands as CardBrands,
|
|
1507
1669
|
type PaymentMethodTypes as PaymentMethodTypes,
|
|
1670
|
+
type ReceiptTaxBehavior as ReceiptTaxBehavior,
|
|
1508
1671
|
type PaymentListResponse as PaymentListResponse,
|
|
1509
1672
|
type PaymentListFeesResponse as PaymentListFeesResponse,
|
|
1510
1673
|
type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
|
|
@@ -1818,7 +1981,6 @@ export declare namespace Whop {
|
|
|
1818
1981
|
export type AppStatuses = API.AppStatuses;
|
|
1819
1982
|
export type AppViewType = API.AppViewType;
|
|
1820
1983
|
export type AuthorizedUserRoles = API.AuthorizedUserRoles;
|
|
1821
|
-
export type BusinessTypes = API.BusinessTypes;
|
|
1822
1984
|
export type ChatChannel = API.ChatChannel;
|
|
1823
1985
|
export type CheckoutConfiguration = API.CheckoutConfiguration;
|
|
1824
1986
|
export type CollectionMethod = API.CollectionMethod;
|
|
@@ -1837,7 +1999,6 @@ export declare namespace Whop {
|
|
|
1837
1999
|
export type ForumPost = API.ForumPost;
|
|
1838
2000
|
export type FriendlyReceiptStatus = API.FriendlyReceiptStatus;
|
|
1839
2001
|
export type GlobalAffiliateStatus = API.GlobalAffiliateStatus;
|
|
1840
|
-
export type IndustryTypes = API.IndustryTypes;
|
|
1841
2002
|
export type Invoice = API.Invoice;
|
|
1842
2003
|
export type InvoiceListItem = API.InvoiceListItem;
|
|
1843
2004
|
export type InvoiceStatus = API.InvoiceStatus;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as qs from '../qs/stringify';
|
|
4
|
+
|
|
5
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
6
|
+
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
7
|
+
}
|
package/src/internal/utils.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { APIResource } from '../core/resource';
|
|
|
4
4
|
import { APIPromise } from '../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Access tokens
|
|
9
|
+
*/
|
|
7
10
|
export class AccessTokens extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* Create a short-lived access token for authenticating API requests. When using
|
|
@@ -4,6 +4,9 @@ import { APIResource } from '../core/resource';
|
|
|
4
4
|
import { APIPromise } from '../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Account links
|
|
9
|
+
*/
|
|
7
10
|
export class AccountLinks extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* Generate a URL that directs a sub-merchant to their account portal, such as the
|
|
@@ -6,6 +6,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
6
6
|
import { RequestOptions } from '../internal/request-options';
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Ai chats
|
|
11
|
+
*/
|
|
9
12
|
export class AIChats extends APIResource {
|
|
10
13
|
/**
|
|
11
14
|
* Create a new AI chat thread and send the first message to the AI agent.
|
|
@@ -212,6 +215,12 @@ export interface AIChatCreateParams {
|
|
|
212
215
|
*/
|
|
213
216
|
message_source?: 'manual' | 'suggestion' | 'link' | null;
|
|
214
217
|
|
|
218
|
+
/**
|
|
219
|
+
* The type of suggestion prompt that was clicked, when message_source is
|
|
220
|
+
* 'suggestion'.
|
|
221
|
+
*/
|
|
222
|
+
suggestion_type?: string | null;
|
|
223
|
+
|
|
215
224
|
/**
|
|
216
225
|
* An optional display title for the AI chat thread (e.g., "Help with billing").
|
|
217
226
|
*/
|
|
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
7
7
|
import { RequestOptions } from '../internal/request-options';
|
|
8
8
|
import { path } from '../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* App builds
|
|
12
|
+
*/
|
|
10
13
|
export class AppBuilds extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Upload a new build artifact for an app. The build must include a compiled code
|
package/src/resources/apps.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
7
7
|
import { RequestOptions } from '../internal/request-options';
|
|
8
8
|
import { path } from '../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Apps
|
|
12
|
+
*/
|
|
10
13
|
export class Apps extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Register a new app on the Whop developer platform. Apps provide custom
|
|
@@ -7,7 +7,34 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
7
7
|
import { RequestOptions } from '../internal/request-options';
|
|
8
8
|
import { path } from '../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Authorized users
|
|
12
|
+
*/
|
|
10
13
|
export class AuthorizedUsers extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Add a new authorized user to a company.
|
|
16
|
+
*
|
|
17
|
+
* Required permissions:
|
|
18
|
+
*
|
|
19
|
+
* - `authorized_user:create`
|
|
20
|
+
* - `member:email:read`
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const authorizedUser = await client.authorizedUsers.create({
|
|
25
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
26
|
+
* role: 'owner',
|
|
27
|
+
* user_id: 'user_xxxxxxxxxxxxx',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
create(
|
|
32
|
+
body: AuthorizedUserCreateParams,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<AuthorizedUserCreateResponse> {
|
|
35
|
+
return this._client.post('/authorized_users', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
|
|
11
38
|
/**
|
|
12
39
|
* Retrieves the details of an existing authorized user.
|
|
13
40
|
*
|
|
@@ -15,6 +42,14 @@ export class AuthorizedUsers extends APIResource {
|
|
|
15
42
|
*
|
|
16
43
|
* - `company:authorized_user:read`
|
|
17
44
|
* - `member:email:read`
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const authorizedUser =
|
|
49
|
+
* await client.authorizedUsers.retrieve(
|
|
50
|
+
* 'ausr_xxxxxxxxxxxxx',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
18
53
|
*/
|
|
19
54
|
retrieve(id: string, options?: RequestOptions): APIPromise<AuthorizedUserRetrieveResponse> {
|
|
20
55
|
return this._client.get(path`/authorized_users/${id}`, options);
|
|
@@ -28,6 +63,14 @@ export class AuthorizedUsers extends APIResource {
|
|
|
28
63
|
*
|
|
29
64
|
* - `company:authorized_user:read`
|
|
30
65
|
* - `member:email:read`
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Automatically fetches more pages as needed.
|
|
70
|
+
* for await (const authorizedUserListResponse of client.authorizedUsers.list()) {
|
|
71
|
+
* // ...
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
31
74
|
*/
|
|
32
75
|
list(
|
|
33
76
|
query: AuthorizedUserListParams | null | undefined = {},
|
|
@@ -38,10 +81,102 @@ export class AuthorizedUsers extends APIResource {
|
|
|
38
81
|
...options,
|
|
39
82
|
});
|
|
40
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Remove an authorized user from a company.
|
|
87
|
+
*
|
|
88
|
+
* Required permissions:
|
|
89
|
+
*
|
|
90
|
+
* - `authorized_user:delete`
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const authorizedUser = await client.authorizedUsers.delete(
|
|
95
|
+
* 'ausr_xxxxxxxxxxxxx',
|
|
96
|
+
* );
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
delete(
|
|
100
|
+
id: string,
|
|
101
|
+
params: AuthorizedUserDeleteParams | null | undefined = {},
|
|
102
|
+
options?: RequestOptions,
|
|
103
|
+
): APIPromise<AuthorizedUserDeleteResponse> {
|
|
104
|
+
const { company_id } = params ?? {};
|
|
105
|
+
return this._client.delete(path`/authorized_users/${id}`, { query: { company_id }, ...options });
|
|
106
|
+
}
|
|
41
107
|
}
|
|
42
108
|
|
|
43
109
|
export type AuthorizedUserListResponsesCursorPage = CursorPage<AuthorizedUserListResponse>;
|
|
44
110
|
|
|
111
|
+
/**
|
|
112
|
+
* A user who has been granted administrative access to manage a company's
|
|
113
|
+
* dashboard and settings.
|
|
114
|
+
*/
|
|
115
|
+
export interface AuthorizedUserCreateResponse {
|
|
116
|
+
/**
|
|
117
|
+
* The unique identifier for the authorized user.
|
|
118
|
+
*/
|
|
119
|
+
id: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The company this authorized user has access to.
|
|
123
|
+
*/
|
|
124
|
+
company: AuthorizedUserCreateResponse.Company;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The permission role assigned to this authorized user within the company.
|
|
128
|
+
*/
|
|
129
|
+
role: Shared.AuthorizedUserRoles;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The user account linked to this authorized user record.
|
|
133
|
+
*/
|
|
134
|
+
user: AuthorizedUserCreateResponse.User;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export namespace AuthorizedUserCreateResponse {
|
|
138
|
+
/**
|
|
139
|
+
* The company this authorized user has access to.
|
|
140
|
+
*/
|
|
141
|
+
export interface Company {
|
|
142
|
+
/**
|
|
143
|
+
* The unique identifier for the company.
|
|
144
|
+
*/
|
|
145
|
+
id: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The display name of the company shown to customers.
|
|
149
|
+
*/
|
|
150
|
+
title: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The user account linked to this authorized user record.
|
|
155
|
+
*/
|
|
156
|
+
export interface User {
|
|
157
|
+
/**
|
|
158
|
+
* The unique identifier for the user.
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The user's email address. Requires the member:email:read permission to access.
|
|
164
|
+
* Null if not authorized.
|
|
165
|
+
*/
|
|
166
|
+
email: string | null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The user's display name shown on their public profile.
|
|
170
|
+
*/
|
|
171
|
+
name: string | null;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The user's unique username shown on their public profile.
|
|
175
|
+
*/
|
|
176
|
+
username: string;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
45
180
|
/**
|
|
46
181
|
* A user who has been granted administrative access to manage a company's
|
|
47
182
|
* dashboard and settings.
|
|
@@ -180,6 +315,34 @@ export namespace AuthorizedUserListResponse {
|
|
|
180
315
|
}
|
|
181
316
|
}
|
|
182
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Represents `true` or `false` values.
|
|
320
|
+
*/
|
|
321
|
+
export type AuthorizedUserDeleteResponse = boolean;
|
|
322
|
+
|
|
323
|
+
export interface AuthorizedUserCreateParams {
|
|
324
|
+
/**
|
|
325
|
+
* The ID of the company to add the authorized user to.
|
|
326
|
+
*/
|
|
327
|
+
company_id: string;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The role to assign to the authorized user within the company. Supported roles:
|
|
331
|
+
* 'moderator', 'sales_manager'.
|
|
332
|
+
*/
|
|
333
|
+
role: Shared.AuthorizedUserRoles;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The ID of the user to add as an authorized user.
|
|
337
|
+
*/
|
|
338
|
+
user_id: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Whether to send notification emails to the user on creation.
|
|
342
|
+
*/
|
|
343
|
+
send_emails?: boolean | null;
|
|
344
|
+
}
|
|
345
|
+
|
|
183
346
|
export interface AuthorizedUserListParams extends CursorPageParams {
|
|
184
347
|
/**
|
|
185
348
|
* Returns the elements in the list that come before the specified cursor.
|
|
@@ -223,11 +386,23 @@ export interface AuthorizedUserListParams extends CursorPageParams {
|
|
|
223
386
|
user_id?: string | null;
|
|
224
387
|
}
|
|
225
388
|
|
|
389
|
+
export interface AuthorizedUserDeleteParams {
|
|
390
|
+
/**
|
|
391
|
+
* The ID of the company the authorized user belongs to. Optional if the authorized
|
|
392
|
+
* user ID is provided.
|
|
393
|
+
*/
|
|
394
|
+
company_id?: string | null;
|
|
395
|
+
}
|
|
396
|
+
|
|
226
397
|
export declare namespace AuthorizedUsers {
|
|
227
398
|
export {
|
|
399
|
+
type AuthorizedUserCreateResponse as AuthorizedUserCreateResponse,
|
|
228
400
|
type AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse,
|
|
229
401
|
type AuthorizedUserListResponse as AuthorizedUserListResponse,
|
|
402
|
+
type AuthorizedUserDeleteResponse as AuthorizedUserDeleteResponse,
|
|
230
403
|
type AuthorizedUserListResponsesCursorPage as AuthorizedUserListResponsesCursorPage,
|
|
404
|
+
type AuthorizedUserCreateParams as AuthorizedUserCreateParams,
|
|
231
405
|
type AuthorizedUserListParams as AuthorizedUserListParams,
|
|
406
|
+
type AuthorizedUserDeleteParams as AuthorizedUserDeleteParams,
|
|
232
407
|
};
|
|
233
408
|
}
|
|
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
|
|
|
7
7
|
import { RequestOptions } from '../internal/request-options';
|
|
8
8
|
import { path } from '../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Chat channels
|
|
12
|
+
*/
|
|
10
13
|
export class ChatChannels extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Retrieves the details of an existing chat channel.
|