@polar-sh/sdk 1.0.0-alpha.20 → 1.0.0-alpha.21
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/dist/2026-04/index.cjs +4 -4
- package/dist/2026-04/index.cjs.map +1 -1
- package/dist/2026-04/index.d.cts +2 -2
- package/dist/2026-04/index.d.mts +2 -2
- package/dist/2026-04/index.mjs +4 -4
- package/dist/2026-04/index.mjs.map +1 -1
- package/dist/2026-04/services/benefit_grants.cjs +1 -1
- package/dist/2026-04/services/benefit_grants.d.cts +1 -1
- package/dist/2026-04/services/benefit_grants.d.mts +1 -1
- package/dist/2026-04/services/benefit_grants.mjs +1 -1
- package/dist/2026-04/services/benefits.cjs +1 -1
- package/dist/2026-04/services/benefits.d.cts +1 -1
- package/dist/2026-04/services/benefits.d.mts +1 -1
- package/dist/2026-04/services/benefits.mjs +1 -1
- package/dist/2026-04/services/checkout_links.cjs +1 -1
- package/dist/2026-04/services/checkout_links.d.cts +1 -1
- package/dist/2026-04/services/checkout_links.d.mts +1 -1
- package/dist/2026-04/services/checkout_links.mjs +1 -1
- package/dist/2026-04/services/checkouts.cjs +1 -1
- package/dist/2026-04/services/checkouts.d.cts +1 -1
- package/dist/2026-04/services/checkouts.d.mts +1 -1
- package/dist/2026-04/services/checkouts.mjs +1 -1
- package/dist/2026-04/services/custom_fields.cjs +1 -1
- package/dist/2026-04/services/custom_fields.d.cts +1 -1
- package/dist/2026-04/services/custom_fields.d.mts +1 -1
- package/dist/2026-04/services/custom_fields.mjs +1 -1
- package/dist/2026-04/services/customer_meters.cjs +1 -1
- package/dist/2026-04/services/customer_meters.d.cts +1 -1
- package/dist/2026-04/services/customer_meters.d.mts +1 -1
- package/dist/2026-04/services/customer_meters.mjs +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.cjs +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.mjs +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.cjs +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.mjs +1 -1
- package/dist/2026-04/services/customer_portal/customer_session.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/customer_session.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/customers.cjs +1 -1
- package/dist/2026-04/services/customer_portal/customers.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/customers.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/customers.mjs +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.cjs +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.mjs +1 -1
- package/dist/2026-04/services/customer_portal/index.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/index.d.cts.map +1 -1
- package/dist/2026-04/services/customer_portal/index.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/index.d.mts.map +1 -1
- package/dist/2026-04/services/customer_portal/license_keys.cjs +1 -1
- package/dist/2026-04/services/customer_portal/license_keys.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/license_keys.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/license_keys.mjs +1 -1
- package/dist/2026-04/services/customer_portal/members.cjs +1 -1
- package/dist/2026-04/services/customer_portal/members.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/members.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/members.mjs +1 -1
- package/dist/2026-04/services/customer_portal/orders.cjs +1 -1
- package/dist/2026-04/services/customer_portal/orders.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/orders.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/orders.mjs +1 -1
- package/dist/2026-04/services/customer_portal/organizations.cjs +1 -1
- package/dist/2026-04/services/customer_portal/organizations.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/organizations.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/organizations.mjs +1 -1
- package/dist/2026-04/services/customer_portal/seats.cjs +5 -5
- package/dist/2026-04/services/customer_portal/seats.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/seats.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/seats.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/seats.mjs +5 -5
- package/dist/2026-04/services/customer_portal/seats.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.cjs +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.mjs +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/wallets.cjs +1 -1
- package/dist/2026-04/services/customer_portal/wallets.d.cts +1 -1
- package/dist/2026-04/services/customer_portal/wallets.d.mts +1 -1
- package/dist/2026-04/services/customer_portal/wallets.mjs +1 -1
- package/dist/2026-04/services/customer_seats.cjs +5 -5
- package/dist/2026-04/services/customer_seats.cjs.map +1 -1
- package/dist/2026-04/services/customer_seats.d.cts +1 -1
- package/dist/2026-04/services/customer_seats.d.mts +1 -1
- package/dist/2026-04/services/customer_seats.mjs +5 -5
- package/dist/2026-04/services/customer_seats.mjs.map +1 -1
- package/dist/2026-04/services/customer_sessions.cjs +1 -1
- package/dist/2026-04/services/customer_sessions.d.cts +1 -1
- package/dist/2026-04/services/customer_sessions.d.mts +1 -1
- package/dist/2026-04/services/customer_sessions.mjs +1 -1
- package/dist/2026-04/services/customers/index.cjs +1 -1
- package/dist/2026-04/services/customers/index.d.cts +1 -1
- package/dist/2026-04/services/customers/index.d.mts +1 -1
- package/dist/2026-04/services/customers/index.mjs +1 -1
- package/dist/2026-04/services/customers/members.cjs +1 -1
- package/dist/2026-04/services/customers/members.d.cts +1 -1
- package/dist/2026-04/services/customers/members.d.mts +1 -1
- package/dist/2026-04/services/customers/members.mjs +1 -1
- package/dist/2026-04/services/discounts.cjs +1 -1
- package/dist/2026-04/services/discounts.d.cts +1 -1
- package/dist/2026-04/services/discounts.d.mts +1 -1
- package/dist/2026-04/services/discounts.mjs +1 -1
- package/dist/2026-04/services/disputes.cjs +1 -1
- package/dist/2026-04/services/disputes.d.cts +1 -1
- package/dist/2026-04/services/disputes.d.mts +1 -1
- package/dist/2026-04/services/disputes.mjs +1 -1
- package/dist/2026-04/services/event_types.cjs +1 -1
- package/dist/2026-04/services/event_types.d.cts +1 -1
- package/dist/2026-04/services/event_types.d.mts +1 -1
- package/dist/2026-04/services/event_types.mjs +1 -1
- package/dist/2026-04/services/events.cjs +1 -1
- package/dist/2026-04/services/events.d.cts +1 -1
- package/dist/2026-04/services/events.d.mts +1 -1
- package/dist/2026-04/services/events.mjs +1 -1
- package/dist/2026-04/services/files.cjs +1 -1
- package/dist/2026-04/services/files.d.cts +1 -1
- package/dist/2026-04/services/files.d.mts +1 -1
- package/dist/2026-04/services/files.mjs +1 -1
- package/dist/2026-04/services/license_keys.cjs +1 -1
- package/dist/2026-04/services/license_keys.d.cts +1 -1
- package/dist/2026-04/services/license_keys.d.mts +1 -1
- package/dist/2026-04/services/license_keys.mjs +1 -1
- package/dist/2026-04/services/meters.cjs +1 -1
- package/dist/2026-04/services/meters.d.cts +1 -1
- package/dist/2026-04/services/meters.d.mts +1 -1
- package/dist/2026-04/services/meters.mjs +1 -1
- package/dist/2026-04/services/metrics.cjs +1 -1
- package/dist/2026-04/services/metrics.d.cts +1 -1
- package/dist/2026-04/services/metrics.d.mts +1 -1
- package/dist/2026-04/services/metrics.mjs +1 -1
- package/dist/2026-04/services/oauth2/clients/index.d.cts +1 -1
- package/dist/2026-04/services/oauth2/clients/index.d.mts +1 -1
- package/dist/2026-04/services/oauth2/clients/oauth2.cjs +1 -1
- package/dist/2026-04/services/oauth2/clients/oauth2.d.cts +1 -1
- package/dist/2026-04/services/oauth2/clients/oauth2.d.mts +1 -1
- package/dist/2026-04/services/oauth2/clients/oauth2.mjs +1 -1
- package/dist/2026-04/services/oauth2/index.d.cts +1 -1
- package/dist/2026-04/services/oauth2/index.d.mts +1 -1
- package/dist/2026-04/services/orders.cjs +1 -1
- package/dist/2026-04/services/orders.d.cts +1 -1
- package/dist/2026-04/services/orders.d.mts +1 -1
- package/dist/2026-04/services/orders.mjs +1 -1
- package/dist/2026-04/services/organizations.cjs +1 -1
- package/dist/2026-04/services/organizations.d.cts +1 -1
- package/dist/2026-04/services/organizations.d.mts +1 -1
- package/dist/2026-04/services/organizations.mjs +1 -1
- package/dist/2026-04/services/payments.cjs +1 -1
- package/dist/2026-04/services/payments.d.cts +1 -1
- package/dist/2026-04/services/payments.d.mts +1 -1
- package/dist/2026-04/services/payments.mjs +1 -1
- package/dist/2026-04/services/products.cjs +1 -1
- package/dist/2026-04/services/products.d.cts +1 -1
- package/dist/2026-04/services/products.d.mts +1 -1
- package/dist/2026-04/services/products.mjs +1 -1
- package/dist/2026-04/services/refunds.cjs +1 -1
- package/dist/2026-04/services/refunds.d.cts +1 -1
- package/dist/2026-04/services/refunds.d.mts +1 -1
- package/dist/2026-04/services/refunds.mjs +1 -1
- package/dist/2026-04/services/subscriptions.cjs +3 -3
- package/dist/2026-04/services/subscriptions.cjs.map +1 -1
- package/dist/2026-04/services/subscriptions.d.cts +1 -1
- package/dist/2026-04/services/subscriptions.d.cts.map +1 -1
- package/dist/2026-04/services/subscriptions.d.mts +1 -1
- package/dist/2026-04/services/subscriptions.d.mts.map +1 -1
- package/dist/2026-04/services/subscriptions.mjs +3 -3
- package/dist/2026-04/services/subscriptions.mjs.map +1 -1
- package/dist/2026-04/services/webhooks.cjs +1 -1
- package/dist/2026-04/services/webhooks.d.cts +1 -1
- package/dist/2026-04/services/webhooks.d.mts +1 -1
- package/dist/2026-04/services/webhooks.mjs +1 -1
- package/dist/2026-10/index.cjs +4 -4
- package/dist/2026-10/index.cjs.map +1 -1
- package/dist/2026-10/index.d.cts +2 -2
- package/dist/2026-10/index.d.mts +2 -2
- package/dist/2026-10/index.mjs +4 -4
- package/dist/2026-10/index.mjs.map +1 -1
- package/dist/2026-10/services/benefit_grants.cjs +1 -1
- package/dist/2026-10/services/benefit_grants.d.cts +1 -1
- package/dist/2026-10/services/benefit_grants.d.mts +1 -1
- package/dist/2026-10/services/benefit_grants.mjs +1 -1
- package/dist/2026-10/services/benefits.cjs +1 -1
- package/dist/2026-10/services/benefits.d.cts +1 -1
- package/dist/2026-10/services/benefits.d.mts +1 -1
- package/dist/2026-10/services/benefits.mjs +1 -1
- package/dist/2026-10/services/checkout_links.cjs +1 -1
- package/dist/2026-10/services/checkout_links.d.cts +1 -1
- package/dist/2026-10/services/checkout_links.d.mts +1 -1
- package/dist/2026-10/services/checkout_links.mjs +1 -1
- package/dist/2026-10/services/checkouts.cjs +1 -1
- package/dist/2026-10/services/checkouts.d.cts +1 -1
- package/dist/2026-10/services/checkouts.d.mts +1 -1
- package/dist/2026-10/services/checkouts.mjs +1 -1
- package/dist/2026-10/services/custom_fields.cjs +1 -1
- package/dist/2026-10/services/custom_fields.d.cts +1 -1
- package/dist/2026-10/services/custom_fields.d.mts +1 -1
- package/dist/2026-10/services/custom_fields.mjs +1 -1
- package/dist/2026-10/services/customer_meters.cjs +1 -1
- package/dist/2026-10/services/customer_meters.d.cts +1 -1
- package/dist/2026-10/services/customer_meters.d.mts +1 -1
- package/dist/2026-10/services/customer_meters.mjs +1 -1
- package/dist/2026-10/services/customer_portal/benefit_grants.cjs +1 -1
- package/dist/2026-10/services/customer_portal/benefit_grants.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/benefit_grants.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/benefit_grants.mjs +1 -1
- package/dist/2026-10/services/customer_portal/customer_meters.cjs +1 -1
- package/dist/2026-10/services/customer_portal/customer_meters.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/customer_meters.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/customer_meters.mjs +1 -1
- package/dist/2026-10/services/customer_portal/customer_session.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/customer_session.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/customers.cjs +1 -1
- package/dist/2026-10/services/customer_portal/customers.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/customers.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/customers.mjs +1 -1
- package/dist/2026-10/services/customer_portal/downloadables.cjs +1 -1
- package/dist/2026-10/services/customer_portal/downloadables.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/downloadables.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/downloadables.mjs +1 -1
- package/dist/2026-10/services/customer_portal/index.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/index.d.cts.map +1 -1
- package/dist/2026-10/services/customer_portal/index.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/index.d.mts.map +1 -1
- package/dist/2026-10/services/customer_portal/license_keys.cjs +1 -1
- package/dist/2026-10/services/customer_portal/license_keys.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/license_keys.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/license_keys.mjs +1 -1
- package/dist/2026-10/services/customer_portal/members.cjs +1 -1
- package/dist/2026-10/services/customer_portal/members.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/members.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/members.mjs +1 -1
- package/dist/2026-10/services/customer_portal/orders.cjs +1 -1
- package/dist/2026-10/services/customer_portal/orders.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/orders.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/orders.mjs +1 -1
- package/dist/2026-10/services/customer_portal/organizations.cjs +1 -1
- package/dist/2026-10/services/customer_portal/organizations.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/organizations.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/organizations.mjs +1 -1
- package/dist/2026-10/services/customer_portal/seats.cjs +5 -5
- package/dist/2026-10/services/customer_portal/seats.cjs.map +1 -1
- package/dist/2026-10/services/customer_portal/seats.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/seats.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/seats.mjs +5 -5
- package/dist/2026-10/services/customer_portal/seats.mjs.map +1 -1
- package/dist/2026-10/services/customer_portal/subscriptions.cjs +3 -3
- package/dist/2026-10/services/customer_portal/subscriptions.cjs.map +1 -1
- package/dist/2026-10/services/customer_portal/subscriptions.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/subscriptions.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/subscriptions.mjs +3 -3
- package/dist/2026-10/services/customer_portal/subscriptions.mjs.map +1 -1
- package/dist/2026-10/services/customer_portal/wallets.cjs +1 -1
- package/dist/2026-10/services/customer_portal/wallets.d.cts +1 -1
- package/dist/2026-10/services/customer_portal/wallets.d.mts +1 -1
- package/dist/2026-10/services/customer_portal/wallets.mjs +1 -1
- package/dist/2026-10/services/customer_seats.cjs +5 -5
- package/dist/2026-10/services/customer_seats.cjs.map +1 -1
- package/dist/2026-10/services/customer_seats.d.cts +1 -1
- package/dist/2026-10/services/customer_seats.d.mts +1 -1
- package/dist/2026-10/services/customer_seats.mjs +5 -5
- package/dist/2026-10/services/customer_seats.mjs.map +1 -1
- package/dist/2026-10/services/customer_sessions.cjs +1 -1
- package/dist/2026-10/services/customer_sessions.d.cts +1 -1
- package/dist/2026-10/services/customer_sessions.d.mts +1 -1
- package/dist/2026-10/services/customer_sessions.mjs +1 -1
- package/dist/2026-10/services/customers/index.cjs +1 -1
- package/dist/2026-10/services/customers/index.d.cts +1 -1
- package/dist/2026-10/services/customers/index.d.mts +1 -1
- package/dist/2026-10/services/customers/index.mjs +1 -1
- package/dist/2026-10/services/customers/members.cjs +1 -1
- package/dist/2026-10/services/customers/members.d.cts +1 -1
- package/dist/2026-10/services/customers/members.d.mts +1 -1
- package/dist/2026-10/services/customers/members.mjs +1 -1
- package/dist/2026-10/services/discounts.cjs +1 -1
- package/dist/2026-10/services/discounts.d.cts +1 -1
- package/dist/2026-10/services/discounts.d.mts +1 -1
- package/dist/2026-10/services/discounts.mjs +1 -1
- package/dist/2026-10/services/disputes.cjs +1 -1
- package/dist/2026-10/services/disputes.d.cts +1 -1
- package/dist/2026-10/services/disputes.d.mts +1 -1
- package/dist/2026-10/services/disputes.mjs +1 -1
- package/dist/2026-10/services/event_types.cjs +1 -1
- package/dist/2026-10/services/event_types.d.cts +1 -1
- package/dist/2026-10/services/event_types.d.mts +1 -1
- package/dist/2026-10/services/event_types.mjs +1 -1
- package/dist/2026-10/services/events.cjs +1 -1
- package/dist/2026-10/services/events.d.cts +1 -1
- package/dist/2026-10/services/events.d.mts +1 -1
- package/dist/2026-10/services/events.mjs +1 -1
- package/dist/2026-10/services/files.cjs +1 -1
- package/dist/2026-10/services/files.d.cts +1 -1
- package/dist/2026-10/services/files.d.mts +1 -1
- package/dist/2026-10/services/files.mjs +1 -1
- package/dist/2026-10/services/license_keys.cjs +1 -1
- package/dist/2026-10/services/license_keys.d.cts +1 -1
- package/dist/2026-10/services/license_keys.d.mts +1 -1
- package/dist/2026-10/services/license_keys.mjs +1 -1
- package/dist/2026-10/services/meters.cjs +1 -1
- package/dist/2026-10/services/meters.d.cts +1 -1
- package/dist/2026-10/services/meters.d.mts +1 -1
- package/dist/2026-10/services/meters.mjs +1 -1
- package/dist/2026-10/services/metrics.cjs +1 -1
- package/dist/2026-10/services/metrics.d.cts +1 -1
- package/dist/2026-10/services/metrics.d.mts +1 -1
- package/dist/2026-10/services/metrics.mjs +1 -1
- package/dist/2026-10/services/oauth2/clients/index.d.cts +1 -1
- package/dist/2026-10/services/oauth2/clients/index.d.mts +1 -1
- package/dist/2026-10/services/oauth2/clients/oauth2.cjs +1 -1
- package/dist/2026-10/services/oauth2/clients/oauth2.d.cts +1 -1
- package/dist/2026-10/services/oauth2/clients/oauth2.d.mts +1 -1
- package/dist/2026-10/services/oauth2/clients/oauth2.mjs +1 -1
- package/dist/2026-10/services/oauth2/index.d.cts +1 -1
- package/dist/2026-10/services/oauth2/index.d.mts +1 -1
- package/dist/2026-10/services/orders.cjs +1 -1
- package/dist/2026-10/services/orders.d.cts +1 -1
- package/dist/2026-10/services/orders.d.mts +1 -1
- package/dist/2026-10/services/orders.mjs +1 -1
- package/dist/2026-10/services/organizations.cjs +1 -1
- package/dist/2026-10/services/organizations.d.cts +1 -1
- package/dist/2026-10/services/organizations.d.mts +1 -1
- package/dist/2026-10/services/organizations.mjs +1 -1
- package/dist/2026-10/services/payments.cjs +1 -1
- package/dist/2026-10/services/payments.d.cts +1 -1
- package/dist/2026-10/services/payments.d.mts +1 -1
- package/dist/2026-10/services/payments.mjs +1 -1
- package/dist/2026-10/services/products.cjs +1 -1
- package/dist/2026-10/services/products.d.cts +1 -1
- package/dist/2026-10/services/products.d.mts +1 -1
- package/dist/2026-10/services/products.mjs +1 -1
- package/dist/2026-10/services/refunds.cjs +1 -1
- package/dist/2026-10/services/refunds.d.cts +1 -1
- package/dist/2026-10/services/refunds.d.mts +1 -1
- package/dist/2026-10/services/refunds.mjs +1 -1
- package/dist/2026-10/services/subscriptions.cjs +3 -3
- package/dist/2026-10/services/subscriptions.cjs.map +1 -1
- package/dist/2026-10/services/subscriptions.d.cts +1 -1
- package/dist/2026-10/services/subscriptions.d.cts.map +1 -1
- package/dist/2026-10/services/subscriptions.d.mts +1 -1
- package/dist/2026-10/services/subscriptions.d.mts.map +1 -1
- package/dist/2026-10/services/subscriptions.mjs +3 -3
- package/dist/2026-10/services/subscriptions.mjs.map +1 -1
- package/dist/2026-10/services/webhooks.cjs +1 -1
- package/dist/2026-10/services/webhooks.d.cts +1 -1
- package/dist/2026-10/services/webhooks.d.mts +1 -1
- package/dist/2026-10/services/webhooks.mjs +1 -1
- package/dist/{base-BX1i41Uz.mjs → base-CpxoQZCZ.mjs} +5 -1
- package/dist/{base-BX1i41Uz.mjs.map → base-CpxoQZCZ.mjs.map} +1 -1
- package/dist/{base-LHtsGbZ7.cjs → base-D83CMR-Q.cjs} +5 -1
- package/dist/{base-LHtsGbZ7.cjs.map → base-D83CMR-Q.cjs.map} +1 -1
- package/dist/{errors-lnKTvpMw.cjs → errors-BfEghQ77.cjs} +40 -20
- package/dist/errors-BfEghQ77.cjs.map +1 -0
- package/dist/{errors-B0dJ1d8y.cjs → errors-CPJ329AT.cjs} +40 -20
- package/dist/errors-CPJ329AT.cjs.map +1 -0
- package/dist/{errors-CfRMvcYh.mjs → errors-D1yM2ZQm.mjs} +29 -15
- package/dist/errors-D1yM2ZQm.mjs.map +1 -0
- package/dist/{errors-CtjU-gr2.mjs → errors-hhbDe5ap.mjs} +29 -15
- package/dist/errors-hhbDe5ap.mjs.map +1 -0
- package/dist/{index-DVJDoRIH.d.cts → index-BDWUg8uj.d.cts} +190 -19
- package/dist/index-BDWUg8uj.d.cts.map +1 -0
- package/dist/{index-BQ53k3_P.d.cts → index-BamOUZl1.d.cts} +190 -19
- package/dist/index-BamOUZl1.d.cts.map +1 -0
- package/dist/{index-Yn92Yswm.d.mts → index-BkTZ8a-R.d.mts} +190 -19
- package/dist/index-BkTZ8a-R.d.mts.map +1 -0
- package/dist/{index-CTfoWhh0.d.mts → index-JEL0D7T4.d.mts} +190 -19
- package/dist/index-JEL0D7T4.d.mts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{models-Os3Vmw3y.d.cts → models-D3N1jo2G.d.cts} +79 -15
- package/dist/models-D3N1jo2G.d.cts.map +1 -0
- package/dist/{models-Os3Vmw3y.d.mts → models-D3N1jo2G.d.mts} +79 -15
- package/dist/models-D3N1jo2G.d.mts.map +1 -0
- package/dist/{models-Buz84sI2.d.cts → models-f2_talp6.d.cts} +79 -15
- package/dist/models-f2_talp6.d.cts.map +1 -0
- package/dist/{models-Buz84sI2.d.mts → models-f2_talp6.d.mts} +79 -15
- package/dist/models-f2_talp6.d.mts.map +1 -0
- package/dist/{webhooks-CnlzepVp.cjs → webhooks-CJ5fgGEO.cjs} +2 -2
- package/dist/{webhooks-CnlzepVp.cjs.map → webhooks-CJ5fgGEO.cjs.map} +1 -1
- package/dist/{webhooks-ClB7QSjG.mjs → webhooks-lgh0ADeT.mjs} +2 -2
- package/dist/{webhooks-ClB7QSjG.mjs.map → webhooks-lgh0ADeT.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/errors-B0dJ1d8y.cjs.map +0 -1
- package/dist/errors-CfRMvcYh.mjs.map +0 -1
- package/dist/errors-CtjU-gr2.mjs.map +0 -1
- package/dist/errors-lnKTvpMw.cjs.map +0 -1
- package/dist/index-BQ53k3_P.d.cts.map +0 -1
- package/dist/index-CTfoWhh0.d.mts.map +0 -1
- package/dist/index-DVJDoRIH.d.cts.map +0 -1
- package/dist/index-Yn92Yswm.d.mts.map +0 -1
- package/dist/models-Buz84sI2.d.cts.map +0 -1
- package/dist/models-Buz84sI2.d.mts.map +0 -1
- package/dist/models-Os3Vmw3y.d.cts.map +0 -1
- package/dist/models-Os3Vmw3y.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seats.cjs","names":["CustomerPortalSeatsListSeats401Error","CustomerPortalSeatsListSeats403Error","CustomerPortalSeatsListSeats404Error","HTTPValidationError","CustomerPortalSeatsAssignSeat400Error","CustomerPortalSeatsAssignSeat401Error","CustomerPortalSeatsAssignSeat403Error","CustomerPortalSeatsAssignSeat404Error","CustomerPortalSeatsRevokeSeat401Error","CustomerPortalSeatsRevokeSeat403Error","CustomerPortalSeatsRevokeSeat404Error","CustomerPortalSeatsResendInvitation400Error","CustomerPortalSeatsResendInvitation401Error","CustomerPortalSeatsResendInvitation403Error","CustomerPortalSeatsResendInvitation404Error","CustomerPortalSeatsListClaimedSubscriptions401Error"],"sources":["../../../../src/2026-04/services/customer_portal/seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatAssign,\n CustomerSubscription,\n ListResourceCustomerSubscription,\n SeatsList,\n} from \"../../models\";\n\nimport {\n CustomerPortalSeatsAssignSeat400Error,\n CustomerPortalSeatsAssignSeat401Error,\n CustomerPortalSeatsAssignSeat403Error,\n CustomerPortalSeatsAssignSeat404Error,\n CustomerPortalSeatsListClaimedSubscriptions401Error,\n CustomerPortalSeatsListSeats401Error,\n CustomerPortalSeatsListSeats403Error,\n CustomerPortalSeatsListSeats404Error,\n CustomerPortalSeatsResendInvitation400Error,\n CustomerPortalSeatsResendInvitation401Error,\n CustomerPortalSeatsResendInvitation403Error,\n CustomerPortalSeatsResendInvitation404Error,\n CustomerPortalSeatsRevokeSeat401Error,\n CustomerPortalSeatsRevokeSeat403Error,\n CustomerPortalSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../../errors\";\n\nexport const listSeatsSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListSeats401Error} Authentication required\n * @throws {CustomerPortalSeatsListSeats403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerPortalSeatsListSeats401Error,\n 403: CustomerPortalSeatsListSeats403Error,\n 404: CustomerPortalSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerPortalSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: CustomerSeatAssign,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsAssignSeat400Error,\n 401: CustomerPortalSeatsAssignSeat401Error,\n 403: CustomerPortalSeatsAssignSeat403Error,\n 404: CustomerPortalSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerPortalSeatsRevokeSeat401Error,\n 403: CustomerPortalSeatsRevokeSeat403Error,\n 404: CustomerPortalSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerPortalSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsResendInvitation400Error,\n 401: CustomerPortalSeatsResendInvitation401Error,\n 403: CustomerPortalSeatsResendInvitation403Error,\n 404: CustomerPortalSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listClaimedSubscriptionsSeats = (client: ClientBase) => {\n /**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats/subscriptions\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 401: CustomerPortalSeatsListClaimedSubscriptions401Error,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListClaimedSubscriptionsSeats = (client: ClientBase) => {\n return async function* (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listClaimedSubscriptionsSeats(client)(\n { ...query, page, limit },\n requestOptions,\n );\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsSeats(client),\n assignSeat: assignSeatSeats(client),\n revokeSeat: revokeSeatSeats(client),\n resendInvitation: resendInvitationSeats(client),\n listClaimedSubscriptions: listClaimedSubscriptionsSeats(client),\n iterListClaimedSubscriptions: iterListClaimedSubscriptionsSeats(client),\n };\n}\n\nexport type Seats = ReturnType<typeof createSeatsService>;\n"],"mappings":";;;AA4BA,MAAa,kBAAkB,WAAuB;;;;;;;;;;;;;;;CAepD,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,6BACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAyB,UAAU,QAAQ;GACvD,KAAKA,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,mBAAmB,WAAuB;;;;;;;;;;;;;;;CAerD,OAAO,OACL,MACA,mBAC0B;EAG1B,MAAM,UAAU,OAAO,aACrB,QACA,6BACA,CAAS,GACT,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAA4B,UAAU,QAAQ;GAC1D,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKJ,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,mBAAmB,WAAuB;;;;;;;;;;;;;;CAcrD,OAAO,OAAO,SAAiB,mBAA2D;EACxF,MAAM,aAAa,EACR,QACX;EAEA,MAAM,UAAU,OAAO,aACrB,UACA,uCACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MA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AM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAoB;CACrD,OAAO;EACL,WAAW,eAAe,MAAM;EAChC,YAAY,gBAAgB,MAAM;EAClC,YAAY,gBAAgB,MAAM;EAClC,kBAAkB,sBAAsB,MAAM;EAC9C,0BAA0B,8BAA8B,MAAM;EAC9D,8BAA8B,kCAAkC,MAAM;CACxE;AACF"}
|
|
1
|
+
{"version":3,"file":"seats.cjs","names":["CustomerPortalSeatsListSeats401Error","CustomerPortalSeatsListSeats403Error","CustomerPortalSeatsListSeats404Error","HTTPValidationError","CustomerPortalSeatsAssignSeat400Error","CustomerPortalSeatsAssignSeat401Error","CustomerPortalSeatsAssignSeat403Error","CustomerPortalSeatsAssignSeat404Error","CustomerPortalSeatsRevokeSeat401Error","CustomerPortalSeatsRevokeSeat403Error","CustomerPortalSeatsRevokeSeat404Error","CustomerPortalSeatsResendInvitation400Error","CustomerPortalSeatsResendInvitation401Error","CustomerPortalSeatsResendInvitation403Error","CustomerPortalSeatsResendInvitation404Error","CustomerPortalSeatsListClaimedSubscriptions401Error"],"sources":["../../../../src/2026-04/services/customer_portal/seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatAssign,\n CustomerSubscription,\n ListResourceCustomerSubscription,\n SeatsList,\n} from \"../../models\";\n\nimport {\n CustomerPortalSeatsAssignSeat400Error,\n CustomerPortalSeatsAssignSeat401Error,\n CustomerPortalSeatsAssignSeat403Error,\n CustomerPortalSeatsAssignSeat404Error,\n CustomerPortalSeatsListClaimedSubscriptions401Error,\n CustomerPortalSeatsListSeats401Error,\n CustomerPortalSeatsListSeats403Error,\n CustomerPortalSeatsListSeats404Error,\n CustomerPortalSeatsResendInvitation400Error,\n CustomerPortalSeatsResendInvitation401Error,\n CustomerPortalSeatsResendInvitation403Error,\n CustomerPortalSeatsResendInvitation404Error,\n CustomerPortalSeatsRevokeSeat401Error,\n CustomerPortalSeatsRevokeSeat403Error,\n CustomerPortalSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../../errors\";\n\nexport const listSeatsSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListSeats401Error} Authentication required\n * @throws {CustomerPortalSeatsListSeats403Error} Not permitted\n * @throws {CustomerPortalSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerPortalSeatsListSeats401Error,\n 403: CustomerPortalSeatsListSeats403Error,\n 404: CustomerPortalSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerPortalSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted\n * @throws {CustomerPortalSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: CustomerSeatAssign,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsAssignSeat400Error,\n 401: CustomerPortalSeatsAssignSeat401Error,\n 403: CustomerPortalSeatsAssignSeat403Error,\n 404: CustomerPortalSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted\n * @throws {CustomerPortalSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerPortalSeatsRevokeSeat401Error,\n 403: CustomerPortalSeatsRevokeSeat403Error,\n 404: CustomerPortalSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerPortalSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted\n * @throws {CustomerPortalSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsResendInvitation400Error,\n 401: CustomerPortalSeatsResendInvitation401Error,\n 403: CustomerPortalSeatsResendInvitation403Error,\n 404: CustomerPortalSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listClaimedSubscriptionsSeats = (client: ClientBase) => {\n /**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats/subscriptions\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 401: CustomerPortalSeatsListClaimedSubscriptions401Error,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListClaimedSubscriptionsSeats = (client: ClientBase) => {\n return async function* (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listClaimedSubscriptionsSeats(client)(\n { ...query, page, limit },\n requestOptions,\n );\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsSeats(client),\n assignSeat: assignSeatSeats(client),\n revokeSeat: revokeSeatSeats(client),\n resendInvitation: resendInvitationSeats(client),\n listClaimedSubscriptions: listClaimedSubscriptionsSeats(client),\n iterListClaimedSubscriptions: iterListClaimedSubscriptionsSeats(client),\n };\n}\n\nexport type Seats = ReturnType<typeof createSeatsService>;\n"],"mappings":";;;AA4BA,MAAa,kBAAkB,WAAuB;;;;;;;;;;;;;;;CAepD,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,6BACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,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MAAa,iCAAiC,WAAuB;;;;;;;;;;;;;;;CAenE,OAAO,OACL,OAIA,mBAC8C;EAC9C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;EACzB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,2CACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAgD,UAAU,QAAQ;GAC9E,KAAKY,eAAAA;GACL,KAAKZ,eAAAA;EACP,CAAC;CACH;AACF;;;;;;;;;;;;;;;AAeA,MAAa,qCAAqC,WAAuB;CACvE,OAAO,iBACL,OAIA,gBACsC;EACtC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,8BAA8B,MAAM,CAAC,CAC1D;IAAE,GAAG;IAAO;IAAM;GAAM,GACxB,cACF;GACA,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAoB;CACrD,OAAO;EACL,WAAW,eAAe,MAAM;EAChC,YAAY,gBAAgB,MAAM;EAClC,YAAY,gBAAgB,MAAM;EAClC,kBAAkB,sBAAsB,MAAM;EAC9C,0BAA0B,8BAA8B,MAAM;EAC9D,8BAA8B,kCAAkC,MAAM;CACxE;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nn as ListResourceCustomerSubscription, St as CustomerSeatAssign, _i as SeatsList, kt as CustomerSubscription, xt as CustomerSeat } from "../../../models-
|
|
1
|
+
import { Nn as ListResourceCustomerSubscription, St as CustomerSeatAssign, _i as SeatsList, kt as CustomerSubscription, xt as CustomerSeat } from "../../../models-D3N1jo2G.cjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.cjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/seats.d.ts
|
|
4
4
|
declare const listSeatsSeats: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nn as ListResourceCustomerSubscription, St as CustomerSeatAssign, _i as SeatsList, kt as CustomerSubscription, xt as CustomerSeat } from "../../../models-
|
|
1
|
+
import { Nn as ListResourceCustomerSubscription, St as CustomerSeatAssign, _i as SeatsList, kt as CustomerSubscription, xt as CustomerSeat } from "../../../models-D3N1jo2G.mjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.mjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/seats.d.ts
|
|
4
4
|
declare const listSeatsSeats: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as CustomerPortalSeatsListSeats403Error, D as CustomerPortalSeatsAssignSeat404Error, E as CustomerPortalSeatsAssignSeat403Error, F as CustomerPortalSeatsResendInvitation404Error, I as CustomerPortalSeatsRevokeSeat401Error, L as CustomerPortalSeatsRevokeSeat403Error, M as CustomerPortalSeatsResendInvitation400Error, N as CustomerPortalSeatsResendInvitation401Error, O as CustomerPortalSeatsListClaimedSubscriptions401Error, P as CustomerPortalSeatsResendInvitation403Error, R as CustomerPortalSeatsRevokeSeat404Error, T as CustomerPortalSeatsAssignSeat401Error,
|
|
1
|
+
import { A as CustomerPortalSeatsListSeats403Error, D as CustomerPortalSeatsAssignSeat404Error, E as CustomerPortalSeatsAssignSeat403Error, F as CustomerPortalSeatsResendInvitation404Error, I as CustomerPortalSeatsRevokeSeat401Error, L as CustomerPortalSeatsRevokeSeat403Error, M as CustomerPortalSeatsResendInvitation400Error, N as CustomerPortalSeatsResendInvitation401Error, O as CustomerPortalSeatsListClaimedSubscriptions401Error, P as CustomerPortalSeatsResendInvitation403Error, R as CustomerPortalSeatsRevokeSeat404Error, T as CustomerPortalSeatsAssignSeat401Error, j as CustomerPortalSeatsListSeats404Error, k as CustomerPortalSeatsListSeats401Error, lt as HTTPValidationError, w as CustomerPortalSeatsAssignSeat400Error } from "../../../errors-D1yM2ZQm.mjs";
|
|
2
2
|
//#region src/2026-04/services/customer_portal/seats.ts
|
|
3
3
|
const listSeatsSeats = (client) => {
|
|
4
4
|
/**
|
|
@@ -11,7 +11,7 @@ const listSeatsSeats = (client) => {
|
|
|
11
11
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
12
12
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
13
13
|
* @throws {CustomerPortalSeatsListSeats401Error} Authentication required
|
|
14
|
-
* @throws {CustomerPortalSeatsListSeats403Error} Not permitted
|
|
14
|
+
* @throws {CustomerPortalSeatsListSeats403Error} Not permitted
|
|
15
15
|
* @throws {CustomerPortalSeatsListSeats404Error} Subscription or order not found
|
|
16
16
|
* @throws {HTTPValidationError} Validation Error
|
|
17
17
|
*/
|
|
@@ -42,7 +42,7 @@ const assignSeatSeats = (client) => {
|
|
|
42
42
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
43
43
|
* @throws {CustomerPortalSeatsAssignSeat400Error} No available seats or customer already has a seat
|
|
44
44
|
* @throws {CustomerPortalSeatsAssignSeat401Error} Authentication required
|
|
45
|
-
* @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted
|
|
45
|
+
* @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted
|
|
46
46
|
* @throws {CustomerPortalSeatsAssignSeat404Error} Subscription, order, or customer not found
|
|
47
47
|
* @throws {HTTPValidationError} Validation Error
|
|
48
48
|
*/
|
|
@@ -68,7 +68,7 @@ const revokeSeatSeats = (client) => {
|
|
|
68
68
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
69
69
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
70
70
|
* @throws {CustomerPortalSeatsRevokeSeat401Error} Authentication required
|
|
71
|
-
* @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted
|
|
71
|
+
* @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted
|
|
72
72
|
* @throws {CustomerPortalSeatsRevokeSeat404Error} Seat not found
|
|
73
73
|
* @throws {HTTPValidationError} Validation Error
|
|
74
74
|
*/
|
|
@@ -95,7 +95,7 @@ const resendInvitationSeats = (client) => {
|
|
|
95
95
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
96
96
|
* @throws {CustomerPortalSeatsResendInvitation400Error} Seat is not pending or already claimed
|
|
97
97
|
* @throws {CustomerPortalSeatsResendInvitation401Error} Authentication required
|
|
98
|
-
* @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted
|
|
98
|
+
* @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted
|
|
99
99
|
* @throws {CustomerPortalSeatsResendInvitation404Error} Seat not found
|
|
100
100
|
* @throws {HTTPValidationError} Validation Error
|
|
101
101
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seats.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatAssign,\n CustomerSubscription,\n ListResourceCustomerSubscription,\n SeatsList,\n} from \"../../models\";\n\nimport {\n CustomerPortalSeatsAssignSeat400Error,\n CustomerPortalSeatsAssignSeat401Error,\n CustomerPortalSeatsAssignSeat403Error,\n CustomerPortalSeatsAssignSeat404Error,\n CustomerPortalSeatsListClaimedSubscriptions401Error,\n CustomerPortalSeatsListSeats401Error,\n CustomerPortalSeatsListSeats403Error,\n CustomerPortalSeatsListSeats404Error,\n CustomerPortalSeatsResendInvitation400Error,\n CustomerPortalSeatsResendInvitation401Error,\n CustomerPortalSeatsResendInvitation403Error,\n CustomerPortalSeatsResendInvitation404Error,\n CustomerPortalSeatsRevokeSeat401Error,\n CustomerPortalSeatsRevokeSeat403Error,\n CustomerPortalSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../../errors\";\n\nexport const listSeatsSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListSeats401Error} Authentication required\n * @throws {CustomerPortalSeatsListSeats403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerPortalSeatsListSeats401Error,\n 403: CustomerPortalSeatsListSeats403Error,\n 404: CustomerPortalSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerPortalSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: CustomerSeatAssign,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsAssignSeat400Error,\n 401: CustomerPortalSeatsAssignSeat401Error,\n 403: CustomerPortalSeatsAssignSeat403Error,\n 404: CustomerPortalSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerPortalSeatsRevokeSeat401Error,\n 403: CustomerPortalSeatsRevokeSeat403Error,\n 404: CustomerPortalSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerPortalSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerPortalSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsResendInvitation400Error,\n 401: CustomerPortalSeatsResendInvitation401Error,\n 403: CustomerPortalSeatsResendInvitation403Error,\n 404: CustomerPortalSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listClaimedSubscriptionsSeats = (client: ClientBase) => {\n /**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats/subscriptions\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 401: CustomerPortalSeatsListClaimedSubscriptions401Error,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListClaimedSubscriptionsSeats = (client: ClientBase) => {\n return async function* (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listClaimedSubscriptionsSeats(client)(\n { ...query, page, limit },\n requestOptions,\n );\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsSeats(client),\n assignSeat: assignSeatSeats(client),\n revokeSeat: revokeSeatSeats(client),\n resendInvitation: resendInvitationSeats(client),\n listClaimedSubscriptions: listClaimedSubscriptionsSeats(client),\n iterListClaimedSubscriptions: iterListClaimedSubscriptionsSeats(client),\n };\n}\n\nexport type Seats = ReturnType<typeof createSeatsService>;\n"],"mappings":";;AA4BA,MAAa,kBAAkB,WAAuB;;;;;;;;;;;;;;;CAepD,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,6BACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAyB,UAAU,Q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ACrB,OACA,2CACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAgD,UAAU,QAAQ;GAC9E,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;;;;;;;;;;;;;;;AAeA,MAAa,qCAAqC,WAAuB;CACvE,OAAO,iBACL,OAIA,gBACsC;EACtC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,8BAA8B,MAAM,CAAC,CAC1D;IAAE,GAAG;IAAO;IAAM;GAAM,GACxB,cACF;GACA,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAoB;CACrD,OAAO;EACL,WAAW,eAAe,MAAM;EAChC,YAAY,gBAAgB,MAAM;EAClC,YAAY,gBAAgB,MAAM;EAClC,kBAAkB,sBAAsB,MAAM;EAC9C,0BAA0B,8BAA8B,MAAM;EAC9D,8BAA8B,kCAAkC,MAAM;CACxE;AACF"}
|
|
1
|
+
{"version":3,"file":"seats.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatAssign,\n CustomerSubscription,\n ListResourceCustomerSubscription,\n SeatsList,\n} from \"../../models\";\n\nimport {\n CustomerPortalSeatsAssignSeat400Error,\n CustomerPortalSeatsAssignSeat401Error,\n CustomerPortalSeatsAssignSeat403Error,\n CustomerPortalSeatsAssignSeat404Error,\n CustomerPortalSeatsListClaimedSubscriptions401Error,\n CustomerPortalSeatsListSeats401Error,\n CustomerPortalSeatsListSeats403Error,\n CustomerPortalSeatsListSeats404Error,\n CustomerPortalSeatsResendInvitation400Error,\n CustomerPortalSeatsResendInvitation401Error,\n CustomerPortalSeatsResendInvitation403Error,\n CustomerPortalSeatsResendInvitation404Error,\n CustomerPortalSeatsRevokeSeat401Error,\n CustomerPortalSeatsRevokeSeat403Error,\n CustomerPortalSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../../errors\";\n\nexport const listSeatsSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListSeats401Error} Authentication required\n * @throws {CustomerPortalSeatsListSeats403Error} Not permitted\n * @throws {CustomerPortalSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerPortalSeatsListSeats401Error,\n 403: CustomerPortalSeatsListSeats403Error,\n 404: CustomerPortalSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerPortalSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsAssignSeat403Error} Not permitted\n * @throws {CustomerPortalSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: CustomerSeatAssign,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsAssignSeat400Error,\n 401: CustomerPortalSeatsAssignSeat401Error,\n 403: CustomerPortalSeatsAssignSeat403Error,\n 404: CustomerPortalSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerPortalSeatsRevokeSeat403Error} Not permitted\n * @throws {CustomerPortalSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerPortalSeatsRevokeSeat401Error,\n 403: CustomerPortalSeatsRevokeSeat403Error,\n 404: CustomerPortalSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationSeats = (client: ClientBase) => {\n /**\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerPortalSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerPortalSeatsResendInvitation403Error} Not permitted\n * @throws {CustomerPortalSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-portal/seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerPortalSeatsResendInvitation400Error,\n 401: CustomerPortalSeatsResendInvitation401Error,\n 403: CustomerPortalSeatsResendInvitation403Error,\n 404: CustomerPortalSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listClaimedSubscriptionsSeats = (client: ClientBase) => {\n /**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/seats/subscriptions\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 401: CustomerPortalSeatsListClaimedSubscriptions401Error,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List all subscriptions where the authenticated customer has claimed a seat.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerPortalSeatsListClaimedSubscriptions401Error} Authentication required\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListClaimedSubscriptionsSeats = (client: ClientBase) => {\n return async function* (\n query?: {\n page?: number;\n limit?: number;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listClaimedSubscriptionsSeats(client)(\n { ...query, page, limit },\n requestOptions,\n );\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsSeats(client),\n assignSeat: assignSeatSeats(client),\n revokeSeat: revokeSeatSeats(client),\n resendInvitation: resendInvitationSeats(client),\n listClaimedSubscriptions: listClaimedSubscriptionsSeats(client),\n iterListClaimedSubscriptions: iterListClaimedSubscriptionsSeats(client),\n };\n}\n\nexport type Seats = ReturnType<typeof createSeatsService>;\n"],"mappings":";;AA4BA,MAAa,kBAAkB,WAAuB;;;;;;;;;;;;;;;CAepD,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,6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,CAAC;EACpB,MAAM,cAAc;GAClB,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;EACzB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,2CACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAgD,UAAU,QAAQ;GAC9E,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;;;;;;;;;;;;;;;AAeA,MAAa,qCAAqC,WAAuB;CACvE,OAAO,iBACL,OAIA,gBACsC;EACtC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,8BAA8B,MAAM,CAAC,CAC1D;IAAE,GAAG;IAAO;IAAM;GAAM,GACxB,cACF;GACA,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,mBAAmB,QAAoB;CACrD,OAAO;EACL,WAAW,eAAe,MAAM;EAChC,YAAY,gBAAgB,MAAM;EAClC,YAAY,gBAAgB,MAAM;EAClC,kBAAkB,sBAAsB,MAAM;EAC9C,0BAA0B,8BAA8B,MAAM;EAC9D,8BAA8B,kCAAkC,MAAM;CACxE;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("../../../errors-
|
|
2
|
+
const require_errors = require("../../../errors-CPJ329AT.cjs");
|
|
3
3
|
//#region src/2026-04/services/customer_portal/subscriptions.ts
|
|
4
4
|
const listSubscriptions = (client) => {
|
|
5
5
|
/**
|
|
@@ -125,7 +125,7 @@ const updateSubscriptions = (client) => {
|
|
|
125
125
|
* @throws {PaymentFailed} Payment required to apply the subscription update.
|
|
126
126
|
* @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.
|
|
127
127
|
* @throws {ResourceNotFound} Customer subscription was not found.
|
|
128
|
-
* @throws {
|
|
128
|
+
* @throws {CustomerPortalSubscriptionsUpdate409Error} The subscription has no payment method to charge, or is not scheduled to be canceled.
|
|
129
129
|
* @throws {HTTPValidationError} Validation Error
|
|
130
130
|
*/
|
|
131
131
|
return async (id, body, requestOptions) => {
|
|
@@ -136,7 +136,7 @@ const updateSubscriptions = (client) => {
|
|
|
136
136
|
402: require_errors.PaymentFailed,
|
|
137
137
|
403: require_errors.CustomerPortalSubscriptionsUpdate403Error,
|
|
138
138
|
404: require_errors.ResourceNotFound,
|
|
139
|
-
409: require_errors.
|
|
139
|
+
409: require_errors.CustomerPortalSubscriptionsUpdate409Error,
|
|
140
140
|
422: require_errors.HTTPValidationError
|
|
141
141
|
});
|
|
142
142
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.cjs","names":["HTTPValidationError","ResourceNotFound","AlreadyCanceledSubscription","PaymentFailed","CustomerPortalSubscriptionsUpdate403Error","PaymentMethodRequired"],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n CustomerPortalSubscriptionsUpdate403Error,\n HTTPValidationError,\n PaymentFailed,\n PaymentMethodRequired,\n ResourceNotFound,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit }, requestOptions);\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {PaymentMethodRequired} The subscription has no payment method to charge.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n body: CustomerSubscriptionUpdate,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: CustomerPortalSubscriptionsUpdate403Error,\n 404: ResourceNotFound,\n 409: PaymentMethodRequired,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;;AAiBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;;CAcvD,OAAO,OACL,OAQA,mBAC8C;EAC9C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,OAAO,OAAO;GACd,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,sCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WA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ACN;EAEA,MAAM,UAAU,OAAO,aACrB,SACA,0CACA,YACA,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAKG,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKH,eAAAA;GACL,KAAKI,eAAAA;GACL,KAAKL,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
1
|
+
{"version":3,"file":"subscriptions.cjs","names":["HTTPValidationError","ResourceNotFound","AlreadyCanceledSubscription","PaymentFailed","CustomerPortalSubscriptionsUpdate403Error","CustomerPortalSubscriptionsUpdate409Error"],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n CustomerPortalSubscriptionsUpdate403Error,\n CustomerPortalSubscriptionsUpdate409Error,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit }, requestOptions);\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {CustomerPortalSubscriptionsUpdate409Error} The subscription has no payment method to charge, or is not scheduled to be canceled.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n body: CustomerSubscriptionUpdate,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: CustomerPortalSubscriptionsUpdate403Error,\n 404: ResourceNotFound,\n 409: CustomerPortalSubscriptionsUpdate409Error,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;;AAiBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;;CAcvD,OAAO,OACL,OAQA,mBAC8C;EAC9C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,OAAO,OAAO;GACd,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,sCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,c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U,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAKG,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKH,eAAAA;GACL,KAAKI,eAAAA;GACL,KAAKL,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as CustomerSubscriptionSortProperty, Nn as ListResourceCustomerSubscription, jt as CustomerSubscriptionUpdate, kt as CustomerSubscription } from "../../../models-
|
|
1
|
+
import { At as CustomerSubscriptionSortProperty, Nn as ListResourceCustomerSubscription, jt as CustomerSubscriptionUpdate, kt as CustomerSubscription } from "../../../models-D3N1jo2G.cjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.cjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/subscriptions.d.ts
|
|
4
4
|
declare const listSubscriptions: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as CustomerSubscriptionSortProperty, Nn as ListResourceCustomerSubscription, jt as CustomerSubscriptionUpdate, kt as CustomerSubscription } from "../../../models-
|
|
1
|
+
import { At as CustomerSubscriptionSortProperty, Nn as ListResourceCustomerSubscription, jt as CustomerSubscriptionUpdate, kt as CustomerSubscription } from "../../../models-D3N1jo2G.mjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.mjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/subscriptions.d.ts
|
|
4
4
|
declare const listSubscriptions: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as CustomerPortalSubscriptionsUpdate409Error, Tt as ResourceNotFound, lt as HTTPValidationError, t as AlreadyCanceledSubscription, xt as PaymentFailed, z as CustomerPortalSubscriptionsUpdate403Error } from "../../../errors-D1yM2ZQm.mjs";
|
|
2
2
|
//#region src/2026-04/services/customer_portal/subscriptions.ts
|
|
3
3
|
const listSubscriptions = (client) => {
|
|
4
4
|
/**
|
|
@@ -124,7 +124,7 @@ const updateSubscriptions = (client) => {
|
|
|
124
124
|
* @throws {PaymentFailed} Payment required to apply the subscription update.
|
|
125
125
|
* @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.
|
|
126
126
|
* @throws {ResourceNotFound} Customer subscription was not found.
|
|
127
|
-
* @throws {
|
|
127
|
+
* @throws {CustomerPortalSubscriptionsUpdate409Error} The subscription has no payment method to charge, or is not scheduled to be canceled.
|
|
128
128
|
* @throws {HTTPValidationError} Validation Error
|
|
129
129
|
*/
|
|
130
130
|
return async (id, body, requestOptions) => {
|
|
@@ -135,7 +135,7 @@ const updateSubscriptions = (client) => {
|
|
|
135
135
|
402: PaymentFailed,
|
|
136
136
|
403: CustomerPortalSubscriptionsUpdate403Error,
|
|
137
137
|
404: ResourceNotFound,
|
|
138
|
-
409:
|
|
138
|
+
409: CustomerPortalSubscriptionsUpdate409Error,
|
|
139
139
|
422: HTTPValidationError
|
|
140
140
|
});
|
|
141
141
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n CustomerPortalSubscriptionsUpdate403Error,\n HTTPValidationError,\n PaymentFailed,\n PaymentMethodRequired,\n ResourceNotFound,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit }, requestOptions);\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {PaymentMethodRequired} The subscription has no payment method to charge.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n body: CustomerSubscriptionUpdate,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: CustomerPortalSubscriptionsUpdate403Error,\n 404: ResourceNotFound,\n 409: PaymentMethodRequired,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;AAiBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;;CAcvD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AM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AACA,MAAa,uBAAuB,WAAuB;;;;;;;;;;;;;;;;;CAiBzD,OAAO,OACL,IACA,MACA,mBACkC;EAClC,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,SACA,0CACA,YACA,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n CustomerPortalSubscriptionsUpdate403Error,\n CustomerPortalSubscriptionsUpdate409Error,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (\n query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n },\n requestOptions?: RequestOptions,\n ): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit }, requestOptions);\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, requestOptions?: RequestOptions): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {CustomerPortalSubscriptionsUpdate403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {CustomerPortalSubscriptionsUpdate409Error} The subscription has no payment method to charge, or is not scheduled to be canceled.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n body: CustomerSubscriptionUpdate,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: CustomerPortalSubscriptionsUpdate403Error,\n 404: ResourceNotFound,\n 409: CustomerPortalSubscriptionsUpdate409Error,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;AAiBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;;CAcvD,OAAO,OACL,OAQA,mBAC8C;EAC9C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,OAAO,OAAO;GACd,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA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MAAM,UAAU,OAAO,aACrB,SACA,0CACA,YACA,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("../../../errors-
|
|
2
|
+
const require_errors = require("../../../errors-CPJ329AT.cjs");
|
|
3
3
|
//#region src/2026-04/services/customer_portal/wallets.ts
|
|
4
4
|
const listWallets = (client) => {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as CustomerWalletSortProperty, Pn as ListResourceCustomerWallet, Pt as CustomerWallet } from "../../../models-
|
|
1
|
+
import { Ft as CustomerWalletSortProperty, Pn as ListResourceCustomerWallet, Pt as CustomerWallet } from "../../../models-D3N1jo2G.cjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.cjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/wallets.d.ts
|
|
4
4
|
declare const listWallets: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as CustomerWalletSortProperty, Pn as ListResourceCustomerWallet, Pt as CustomerWallet } from "../../../models-
|
|
1
|
+
import { Ft as CustomerWalletSortProperty, Pn as ListResourceCustomerWallet, Pt as CustomerWallet } from "../../../models-D3N1jo2G.mjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../../base-C5EE71lz.mjs";
|
|
3
3
|
//#region src/2026-04/services/customer_portal/wallets.d.ts
|
|
4
4
|
declare const listWallets: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tt as ResourceNotFound,
|
|
1
|
+
import { Tt as ResourceNotFound, lt as HTTPValidationError } from "../../../errors-D1yM2ZQm.mjs";
|
|
2
2
|
//#region src/2026-04/services/customer_portal/wallets.ts
|
|
3
3
|
const listWallets = (client) => {
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("../../errors-
|
|
2
|
+
const require_errors = require("../../errors-CPJ329AT.cjs");
|
|
3
3
|
//#region src/2026-04/services/customer_seats.ts
|
|
4
4
|
const listSeatsCustomerSeats = (client) => {
|
|
5
5
|
/**
|
|
@@ -12,7 +12,7 @@ const listSeatsCustomerSeats = (client) => {
|
|
|
12
12
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
13
13
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
14
14
|
* @throws {CustomerSeatsListSeats401Error} Authentication required
|
|
15
|
-
* @throws {CustomerSeatsListSeats403Error} Not permitted
|
|
15
|
+
* @throws {CustomerSeatsListSeats403Error} Not permitted
|
|
16
16
|
* @throws {CustomerSeatsListSeats404Error} Subscription or order not found
|
|
17
17
|
* @throws {HTTPValidationError} Validation Error
|
|
18
18
|
*/
|
|
@@ -44,7 +44,7 @@ const assignSeatCustomerSeats = (client) => {
|
|
|
44
44
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
45
45
|
* @throws {CustomerSeatsAssignSeat400Error} No available seats or customer already has a seat
|
|
46
46
|
* @throws {CustomerSeatsAssignSeat401Error} Authentication required
|
|
47
|
-
* @throws {CustomerSeatsAssignSeat403Error} Not permitted
|
|
47
|
+
* @throws {CustomerSeatsAssignSeat403Error} Not permitted
|
|
48
48
|
* @throws {CustomerSeatsAssignSeat404Error} Subscription, order, or customer not found
|
|
49
49
|
* @throws {HTTPValidationError} Validation Error
|
|
50
50
|
*/
|
|
@@ -71,7 +71,7 @@ const revokeSeatCustomerSeats = (client) => {
|
|
|
71
71
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
72
72
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
73
73
|
* @throws {CustomerSeatsRevokeSeat401Error} Authentication required
|
|
74
|
-
* @throws {CustomerSeatsRevokeSeat403Error} Not permitted
|
|
74
|
+
* @throws {CustomerSeatsRevokeSeat403Error} Not permitted
|
|
75
75
|
* @throws {CustomerSeatsRevokeSeat404Error} Seat not found
|
|
76
76
|
* @throws {HTTPValidationError} Validation Error
|
|
77
77
|
*/
|
|
@@ -99,7 +99,7 @@ const resendInvitationCustomerSeats = (client) => {
|
|
|
99
99
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
100
100
|
* @throws {CustomerSeatsResendInvitation400Error} Seat is not pending or already claimed
|
|
101
101
|
* @throws {CustomerSeatsResendInvitation401Error} Authentication required
|
|
102
|
-
* @throws {CustomerSeatsResendInvitation403Error} Not permitted
|
|
102
|
+
* @throws {CustomerSeatsResendInvitation403Error} Not permitted
|
|
103
103
|
* @throws {CustomerSeatsResendInvitation404Error} Seat not found
|
|
104
104
|
* @throws {HTTPValidationError} Validation Error
|
|
105
105
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer_seats.cjs","names":["CustomerSeatsListSeats401Error","CustomerSeatsListSeats403Error","CustomerSeatsListSeats404Error","HTTPValidationError","CustomerSeatsAssignSeat400Error","CustomerSeatsAssignSeat401Error","CustomerSeatsAssignSeat403Error","CustomerSeatsAssignSeat404Error","CustomerSeatsRevokeSeat401Error","CustomerSeatsRevokeSeat403Error","CustomerSeatsRevokeSeat404Error","CustomerSeatsResendInvitation400Error","CustomerSeatsResendInvitation401Error","CustomerSeatsResendInvitation403Error","CustomerSeatsResendInvitation404Error","CustomerSeatsGetClaimInfo400Error","CustomerSeatsGetClaimInfo403Error","CustomerSeatsGetClaimInfo404Error","CustomerSeatsClaimSeat400Error","CustomerSeatsClaimSeat403Error"],"sources":["../../../src/2026-04/services/customer_seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatClaimResponse,\n SeatAssign,\n SeatClaim,\n SeatClaimInfo,\n SeatsList,\n} from \"../models\";\n\nimport {\n CustomerSeatsAssignSeat400Error,\n CustomerSeatsAssignSeat401Error,\n CustomerSeatsAssignSeat403Error,\n CustomerSeatsAssignSeat404Error,\n CustomerSeatsClaimSeat400Error,\n CustomerSeatsClaimSeat403Error,\n CustomerSeatsGetClaimInfo400Error,\n CustomerSeatsGetClaimInfo403Error,\n CustomerSeatsGetClaimInfo404Error,\n CustomerSeatsListSeats401Error,\n CustomerSeatsListSeats403Error,\n CustomerSeatsListSeats404Error,\n CustomerSeatsResendInvitation400Error,\n CustomerSeatsResendInvitation401Error,\n CustomerSeatsResendInvitation403Error,\n CustomerSeatsResendInvitation404Error,\n CustomerSeatsRevokeSeat401Error,\n CustomerSeatsRevokeSeat403Error,\n CustomerSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../errors\";\n\nexport const listSeatsCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:read`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsListSeats401Error} Authentication required\n * @throws {CustomerSeatsListSeats403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerSeatsListSeats401Error,\n 403: CustomerSeatsListSeats403Error,\n 404: CustomerSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerSeatsAssignSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (body: SeatAssign, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerSeatsAssignSeat400Error,\n 401: CustomerSeatsAssignSeat401Error,\n 403: CustomerSeatsAssignSeat403Error,\n 404: CustomerSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerSeatsRevokeSeat403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerSeatsRevokeSeat401Error,\n 403: CustomerSeatsRevokeSeat403Error,\n 404: CustomerSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerSeatsResendInvitation403Error} Not permitted or seat-based pricing not enabled\n * @throws {CustomerSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerSeatsResendInvitation400Error,\n 401: CustomerSeatsResendInvitation401Error,\n 403: CustomerSeatsResendInvitation403Error,\n 404: CustomerSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getClaimInfoCustomerSeats = (client: ClientBase) => {\n /**\n *\n * @param invitation_token\n * @param requestOptions - Request options\n * @returns {SeatClaimInfo}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsGetClaimInfo400Error} Invalid or expired invitation token\n * @throws {CustomerSeatsGetClaimInfo403Error} Seat-based pricing not enabled for organization\n * @throws {CustomerSeatsGetClaimInfo404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n invitation_token: string,\n requestOptions?: RequestOptions,\n ): Promise<SeatClaimInfo> => {\n const pathParams = {\n invitation_token: invitation_token,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-seats/claim/{invitation_token}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatClaimInfo>(response, \"json\", {\n 400: CustomerSeatsGetClaimInfo400Error,\n 403: CustomerSeatsGetClaimInfo403Error,\n 404: CustomerSeatsGetClaimInfo404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const claimSeatCustomerSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeatClaimResponse}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsClaimSeat400Error} Invalid, expired, or already claimed token\n * @throws {CustomerSeatsClaimSeat403Error} Seat-based pricing not enabled for organization\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: SeatClaim,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeatClaimResponse> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats/claim\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeatClaimResponse>(response, \"json\", {\n 400: CustomerSeatsClaimSeat400Error,\n 403: CustomerSeatsClaimSeat403Error,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createCustomerSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsCustomerSeats(client),\n assignSeat: assignSeatCustomerSeats(client),\n revokeSeat: revokeSeatCustomerSeats(client),\n resendInvitation: resendInvitationCustomerSeats(client),\n getClaimInfo: getClaimInfoCustomerSeats(client),\n claimSeat: claimSeatCustomerSeats(client),\n };\n}\n\nexport type CustomerSeats = ReturnType<typeof createCustomerSeatsService>;\n"],"mappings":";;;AAiCA,MAAa,0BAA0B,WAAuB;;;;;;;;;;;;;;;CAe5D,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,sBACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAyB,UAAU,QAAQ;GACvD,KAAKA,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,2BAA2B,WAAuB;;;;;;;;;;;;;;;;CAgB7D,OAAO,OAAO,MAAkB,mBAA2D;EAGzF,MAAM,UAAU,OAAO,aACrB,QACA,sBACA,CAAS,GACT,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAA4B,UAAU,QAAQ;GAC1D,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKJ,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,2BAA2B,WAAuB;;;;;;;;;;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AY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAyC,UAAU,QAAQ;GACvE,KAAKe,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKhB,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,WAAW,uBAAuB,MAAM;EACxC,YAAY,wBAAwB,MAAM;EAC1C,YAAY,wBAAwB,MAAM;EAC1C,kBAAkB,8BAA8B,MAAM;EACtD,cAAc,0BAA0B,MAAM;EAC9C,WAAW,uBAAuB,MAAM;CAC1C;AACF"}
|
|
1
|
+
{"version":3,"file":"customer_seats.cjs","names":["CustomerSeatsListSeats401Error","CustomerSeatsListSeats403Error","CustomerSeatsListSeats404Error","HTTPValidationError","CustomerSeatsAssignSeat400Error","CustomerSeatsAssignSeat401Error","CustomerSeatsAssignSeat403Error","CustomerSeatsAssignSeat404Error","CustomerSeatsRevokeSeat401Error","CustomerSeatsRevokeSeat403Error","CustomerSeatsRevokeSeat404Error","CustomerSeatsResendInvitation400Error","CustomerSeatsResendInvitation401Error","CustomerSeatsResendInvitation403Error","CustomerSeatsResendInvitation404Error","CustomerSeatsGetClaimInfo400Error","CustomerSeatsGetClaimInfo403Error","CustomerSeatsGetClaimInfo404Error","CustomerSeatsClaimSeat400Error","CustomerSeatsClaimSeat403Error"],"sources":["../../../src/2026-04/services/customer_seats.ts"],"sourcesContent":["import type { ClientBase, RequestOptions } from \"../../base\";\nimport type {\n CustomerSeat,\n CustomerSeatClaimResponse,\n SeatAssign,\n SeatClaim,\n SeatClaimInfo,\n SeatsList,\n} from \"../models\";\n\nimport {\n CustomerSeatsAssignSeat400Error,\n CustomerSeatsAssignSeat401Error,\n CustomerSeatsAssignSeat403Error,\n CustomerSeatsAssignSeat404Error,\n CustomerSeatsClaimSeat400Error,\n CustomerSeatsClaimSeat403Error,\n CustomerSeatsGetClaimInfo400Error,\n CustomerSeatsGetClaimInfo403Error,\n CustomerSeatsGetClaimInfo404Error,\n CustomerSeatsListSeats401Error,\n CustomerSeatsListSeats403Error,\n CustomerSeatsListSeats404Error,\n CustomerSeatsResendInvitation400Error,\n CustomerSeatsResendInvitation401Error,\n CustomerSeatsResendInvitation403Error,\n CustomerSeatsResendInvitation404Error,\n CustomerSeatsRevokeSeat401Error,\n CustomerSeatsRevokeSeat403Error,\n CustomerSeatsRevokeSeat404Error,\n HTTPValidationError,\n} from \"../errors\";\n\nexport const listSeatsCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:read`\n *\n * @param query - Query parameters\n * @param requestOptions - Request options\n * @returns {SeatsList}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsListSeats401Error} Authentication required\n * @throws {CustomerSeatsListSeats403Error} Not permitted\n * @throws {CustomerSeatsListSeats404Error} Subscription or order not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n query?: {\n subscription_id?: string | null;\n order_id?: string | null;\n },\n requestOptions?: RequestOptions,\n ): Promise<SeatsList> => {\n const pathParams = {};\n const queryParams = {\n subscription_id: query?.subscription_id,\n order_id: query?.order_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-seats\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatsList>(response, \"json\", {\n 401: CustomerSeatsListSeats401Error,\n 403: CustomerSeatsListSeats403Error,\n 404: CustomerSeatsListSeats404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const assignSeatCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsAssignSeat400Error} No available seats or customer already has a seat\n * @throws {CustomerSeatsAssignSeat401Error} Authentication required\n * @throws {CustomerSeatsAssignSeat403Error} Not permitted\n * @throws {CustomerSeatsAssignSeat404Error} Subscription, order, or customer not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (body: SeatAssign, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerSeatsAssignSeat400Error,\n 401: CustomerSeatsAssignSeat401Error,\n 403: CustomerSeatsAssignSeat403Error,\n 404: CustomerSeatsAssignSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const revokeSeatCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsRevokeSeat401Error} Authentication required\n * @throws {CustomerSeatsRevokeSeat403Error} Not permitted\n * @throws {CustomerSeatsRevokeSeat404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-seats/{seat_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 401: CustomerSeatsRevokeSeat401Error,\n 403: CustomerSeatsRevokeSeat403Error,\n 404: CustomerSeatsRevokeSeat404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const resendInvitationCustomerSeats = (client: ClientBase) => {\n /**\n * **Scopes**: `customer_seats:write`\n *\n * @param seat_id\n * @param requestOptions - Request options\n * @returns {CustomerSeat}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsResendInvitation400Error} Seat is not pending or already claimed\n * @throws {CustomerSeatsResendInvitation401Error} Authentication required\n * @throws {CustomerSeatsResendInvitation403Error} Not permitted\n * @throws {CustomerSeatsResendInvitation404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (seat_id: string, requestOptions?: RequestOptions): Promise<CustomerSeat> => {\n const pathParams = {\n seat_id: seat_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats/{seat_id}/resend\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeat>(response, \"json\", {\n 400: CustomerSeatsResendInvitation400Error,\n 401: CustomerSeatsResendInvitation401Error,\n 403: CustomerSeatsResendInvitation403Error,\n 404: CustomerSeatsResendInvitation404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getClaimInfoCustomerSeats = (client: ClientBase) => {\n /**\n *\n * @param invitation_token\n * @param requestOptions - Request options\n * @returns {SeatClaimInfo}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsGetClaimInfo400Error} Invalid or expired invitation token\n * @throws {CustomerSeatsGetClaimInfo403Error} Seat-based pricing not enabled for organization\n * @throws {CustomerSeatsGetClaimInfo404Error} Seat not found\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n invitation_token: string,\n requestOptions?: RequestOptions,\n ): Promise<SeatClaimInfo> => {\n const pathParams = {\n invitation_token: invitation_token,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-seats/claim/{invitation_token}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<SeatClaimInfo>(response, \"json\", {\n 400: CustomerSeatsGetClaimInfo400Error,\n 403: CustomerSeatsGetClaimInfo403Error,\n 404: CustomerSeatsGetClaimInfo404Error,\n 422: HTTPValidationError,\n });\n };\n};\nexport const claimSeatCustomerSeats = (client: ClientBase) => {\n /**\n *\n * @param body - Request body\n * @param requestOptions - Request options\n * @returns {CustomerSeatClaimResponse}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {CustomerSeatsClaimSeat400Error} Invalid, expired, or already claimed token\n * @throws {CustomerSeatsClaimSeat403Error} Seat-based pricing not enabled for organization\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n body: SeatClaim,\n requestOptions?: RequestOptions,\n ): Promise<CustomerSeatClaimResponse> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\n \"POST\",\n \"/v1/customer-seats/claim\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request, requestOptions);\n return client.parseResponse<CustomerSeatClaimResponse>(response, \"json\", {\n 400: CustomerSeatsClaimSeat400Error,\n 403: CustomerSeatsClaimSeat403Error,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createCustomerSeatsService(client: ClientBase) {\n return {\n listSeats: listSeatsCustomerSeats(client),\n assignSeat: assignSeatCustomerSeats(client),\n revokeSeat: revokeSeatCustomerSeats(client),\n resendInvitation: resendInvitationCustomerSeats(client),\n getClaimInfo: getClaimInfoCustomerSeats(client),\n claimSeat: claimSeatCustomerSeats(client),\n };\n}\n\nexport type CustomerSeats = ReturnType<typeof createCustomerSeatsService>;\n"],"mappings":";;;AAiCA,MAAa,0BAA0B,WAAuB;;;;;;;;;;;;;;;CAe5D,OAAO,OACL,OAIA,mBACuB;EACvB,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,UA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;GAC1D,KAAKQ,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKX,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,6BAA6B,WAAuB;;;;;;;;;;;;;;CAc/D,OAAO,OACL,kBACA,mBAC2B;EAC3B,MAAM,aAAa,EACC,iBACpB;EAEA,MAAM,UAAU,OAAO,aACrB,OACA,+CACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAA6B,UAAU,QAAQ;GAC3D,KAAKY,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKd,eAAAA;EACP,CAAC;CACH;AACF;AACA,MAAa,0BAA0B,WAAuB;;;;;;;;;;;;;CAa5D,OAAO,OACL,MACA,mBACuC;EAGvC,MAAM,UAAU,OAAO,aACrB,QACA,4BACA,CAAS,GACT,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,SAAS,cAAc;EACjE,OAAO,OAAO,cAAyC,UAAU,QAAQ;GACvE,KAAKe,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKhB,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,WAAW,uBAAuB,MAAM;EACxC,YAAY,wBAAwB,MAAM;EAC1C,YAAY,wBAAwB,MAAM;EAC1C,kBAAkB,8BAA8B,MAAM;EACtD,cAAc,0BAA0B,MAAM;EAC9C,WAAW,uBAAuB,MAAM;CAC1C;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as CustomerSeatClaimResponse, _i as SeatsList, gi as SeatClaimInfo, hi as SeatClaim, mi as SeatAssign, xt as CustomerSeat } from "../../models-
|
|
1
|
+
import { Ct as CustomerSeatClaimResponse, _i as SeatsList, gi as SeatClaimInfo, hi as SeatClaim, mi as SeatAssign, xt as CustomerSeat } from "../../models-D3N1jo2G.cjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../base-C5EE71lz.cjs";
|
|
3
3
|
//#region src/2026-04/services/customer_seats.d.ts
|
|
4
4
|
declare const listSeatsCustomerSeats: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as CustomerSeatClaimResponse, _i as SeatsList, gi as SeatClaimInfo, hi as SeatClaim, mi as SeatAssign, xt as CustomerSeat } from "../../models-
|
|
1
|
+
import { Ct as CustomerSeatClaimResponse, _i as SeatsList, gi as SeatClaimInfo, hi as SeatClaim, mi as SeatAssign, xt as CustomerSeat } from "../../models-D3N1jo2G.mjs";
|
|
2
2
|
import { c as RequestOptions, t as ClientBase } from "../../base-C5EE71lz.mjs";
|
|
3
3
|
//#region src/2026-04/services/customer_seats.d.ts
|
|
4
4
|
declare const listSeatsCustomerSeats: (client: ClientBase) => (query?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as CustomerSeatsResendInvitation400Error, G as CustomerSeatsClaimSeat400Error, H as CustomerSeatsAssignSeat401Error, J as CustomerSeatsGetClaimInfo403Error, K as CustomerSeatsClaimSeat403Error, Q as CustomerSeatsListSeats404Error, U as CustomerSeatsAssignSeat403Error, V as CustomerSeatsAssignSeat400Error, W as CustomerSeatsAssignSeat404Error, X as CustomerSeatsListSeats401Error, Y as CustomerSeatsGetClaimInfo404Error, Z as CustomerSeatsListSeats403Error, at as CustomerSeatsRevokeSeat404Error, et as CustomerSeatsResendInvitation401Error, it as CustomerSeatsRevokeSeat403Error, lt as HTTPValidationError, nt as CustomerSeatsResendInvitation404Error, q as CustomerSeatsGetClaimInfo400Error, rt as CustomerSeatsRevokeSeat401Error, tt as CustomerSeatsResendInvitation403Error } from "../../errors-D1yM2ZQm.mjs";
|
|
2
2
|
//#region src/2026-04/services/customer_seats.ts
|
|
3
3
|
const listSeatsCustomerSeats = (client) => {
|
|
4
4
|
/**
|
|
@@ -11,7 +11,7 @@ const listSeatsCustomerSeats = (client) => {
|
|
|
11
11
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
12
12
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
13
13
|
* @throws {CustomerSeatsListSeats401Error} Authentication required
|
|
14
|
-
* @throws {CustomerSeatsListSeats403Error} Not permitted
|
|
14
|
+
* @throws {CustomerSeatsListSeats403Error} Not permitted
|
|
15
15
|
* @throws {CustomerSeatsListSeats404Error} Subscription or order not found
|
|
16
16
|
* @throws {HTTPValidationError} Validation Error
|
|
17
17
|
*/
|
|
@@ -43,7 +43,7 @@ const assignSeatCustomerSeats = (client) => {
|
|
|
43
43
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
44
44
|
* @throws {CustomerSeatsAssignSeat400Error} No available seats or customer already has a seat
|
|
45
45
|
* @throws {CustomerSeatsAssignSeat401Error} Authentication required
|
|
46
|
-
* @throws {CustomerSeatsAssignSeat403Error} Not permitted
|
|
46
|
+
* @throws {CustomerSeatsAssignSeat403Error} Not permitted
|
|
47
47
|
* @throws {CustomerSeatsAssignSeat404Error} Subscription, order, or customer not found
|
|
48
48
|
* @throws {HTTPValidationError} Validation Error
|
|
49
49
|
*/
|
|
@@ -70,7 +70,7 @@ const revokeSeatCustomerSeats = (client) => {
|
|
|
70
70
|
* @throws {PolarRateLimitError} When the rate limit is exceeded
|
|
71
71
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
72
72
|
* @throws {CustomerSeatsRevokeSeat401Error} Authentication required
|
|
73
|
-
* @throws {CustomerSeatsRevokeSeat403Error} Not permitted
|
|
73
|
+
* @throws {CustomerSeatsRevokeSeat403Error} Not permitted
|
|
74
74
|
* @throws {CustomerSeatsRevokeSeat404Error} Seat not found
|
|
75
75
|
* @throws {HTTPValidationError} Validation Error
|
|
76
76
|
*/
|
|
@@ -98,7 +98,7 @@ const resendInvitationCustomerSeats = (client) => {
|
|
|
98
98
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
99
99
|
* @throws {CustomerSeatsResendInvitation400Error} Seat is not pending or already claimed
|
|
100
100
|
* @throws {CustomerSeatsResendInvitation401Error} Authentication required
|
|
101
|
-
* @throws {CustomerSeatsResendInvitation403Error} Not permitted
|
|
101
|
+
* @throws {CustomerSeatsResendInvitation403Error} Not permitted
|
|
102
102
|
* @throws {CustomerSeatsResendInvitation404Error} Seat not found
|
|
103
103
|
* @throws {HTTPValidationError} Validation Error
|
|
104
104
|
*/
|