()
| 1713 | // Returns whether the user has Opus access at all, regardless of whether they |
| 1714 | // are a subscriber or PayG. |
| 1715 | export function hasOpusAccess(): boolean { |
| 1716 | const subscriptionType = getSubscriptionType() |
| 1717 | |
| 1718 | return ( |
| 1719 | subscriptionType === 'max' || |
| 1720 | subscriptionType === 'enterprise' || |
| 1721 | subscriptionType === 'team' || |
| 1722 | subscriptionType === 'pro' || |
| 1723 | // subscriptionType === null covers both API users and the case where |
| 1724 | // subscribers do not have subscription type populated. For those |
| 1725 | // subscribers, when in doubt, we should not limit their access to Opus. |
| 1726 | subscriptionType === null |
| 1727 | ) |
| 1728 | } |
| 1729 | |
| 1730 | export function getSubscriptionType(): SubscriptionType | null { |
| 1731 | // Check for mock subscription type first (ANT-only testing) |
nothing calls this directly
no test coverage detected