()
| 1920 | // Returns whether the user has Opus access at all, regardless of whether they |
| 1921 | // are a subscriber or PayG. |
| 1922 | export function hasOpusAccess(): boolean { |
| 1923 | const subscriptionType = getSubscriptionType() |
| 1924 | |
| 1925 | return ( |
| 1926 | subscriptionType === 'max' || |
| 1927 | subscriptionType === 'enterprise' || |
| 1928 | subscriptionType === 'team' || |
| 1929 | subscriptionType === 'pro' || |
| 1930 | // subscriptionType === null covers both API users and the case where |
| 1931 | // subscribers do not have subscription type populated. For those |
| 1932 | // subscribers, when in doubt, we should not limit their access to Opus. |
| 1933 | subscriptionType === null |
| 1934 | ) |
| 1935 | } |
| 1936 | |
| 1937 | export function getSubscriptionType(): SubscriptionType | null { |
| 1938 | // Check for mock subscription type first (ANT-only testing) |
nothing calls this directly
no test coverage detected