()
| 1645 | // Returns whether the user has Opus access at all, regardless of whether they |
| 1646 | // are a subscriber or PayG. |
| 1647 | export function hasOpusAccess(): boolean { |
| 1648 | const subscriptionType = getSubscriptionType() |
| 1649 | |
| 1650 | return ( |
| 1651 | subscriptionType === 'max' || |
| 1652 | subscriptionType === 'enterprise' || |
| 1653 | subscriptionType === 'team' || |
| 1654 | subscriptionType === 'pro' || |
| 1655 | // subscriptionType === null covers both API users and the case where |
| 1656 | // subscribers do not have subscription type populated. For those |
| 1657 | // subscribers, when in doubt, we should not limit their access to Opus. |
| 1658 | subscriptionType === null |
| 1659 | ) |
| 1660 | } |
| 1661 | |
| 1662 | export function getSubscriptionType(): SubscriptionType | null { |
| 1663 | // Check for mock subscription type first (ANT-only testing) |
nothing calls this directly
no test coverage detected