11import type { Disposable } from 'vscode' ;
22import { ThemeIcon , window } from 'vscode' ;
3- import {
4- proFeaturePreviewUsages ,
5- proTrialLengthInDays ,
6- SubscriptionPlanId ,
7- SubscriptionState ,
8- } from '../../constants.subscription' ;
3+ import { proFeaturePreviewUsages , proTrialLengthInDays , SubscriptionState } from '../../constants.subscription' ;
94import type { Container } from '../../container' ;
105import type { QuickPickItemOfT } from '../../quickpicks/items/common' ;
116import { createQuickPickSeparator } from '../../quickpicks/items/common' ;
127import { registerCommand } from '../../system/-webview/command' ;
138import type { GKCheckInResponse , GKLicenses , GKLicenseType , GKUser } from './models/checkin' ;
9+ import type { PaidSubscriptionPlanIds , SubscriptionPlanIds } from './models/subscription' ;
1410import type { SubscriptionService } from './subscriptionService' ;
1511import { getConfiguredActiveOrganizationId } from './utils/-webview/subscription.utils' ;
1612import { getSubscriptionFromCheckIn } from './utils/checkin.utils' ;
@@ -55,18 +51,14 @@ type SimulateQuickPickItem = QuickPickItemOfT<
5551 state : SubscriptionState . Trial ;
5652 reactivatedTrial ?: boolean ;
5753 expiredPaid ?: never ;
58- planId ?: SubscriptionPlanId . Advanced ;
54+ planId ?: Extract < 'advanced' , SubscriptionPlanIds > ;
5955 featurePreviews ?: never ;
6056 }
6157 | {
6258 state : SubscriptionState . Paid ;
6359 reactivatedTrial ?: never ;
6460 expiredPaid ?: boolean ;
65- planId ?:
66- | SubscriptionPlanId . Pro
67- | SubscriptionPlanId . Advanced
68- | SubscriptionPlanId . Business
69- | SubscriptionPlanId . Enterprise ;
61+ planId ?: PaidSubscriptionPlanIds ;
7062 featurePreviews ?: never ;
7163 }
7264> ;
@@ -156,15 +148,15 @@ class AccountDebug {
156148 label : 'Pro Trial (Advanced)' ,
157149 description : 'Pro trial (advanced plan), account' ,
158150 iconPath : new ThemeIcon ( 'blank' ) ,
159- item : { state : SubscriptionState . Trial , planId : SubscriptionPlanId . Advanced } ,
151+ item : { state : SubscriptionState . Trial , planId : 'advanced' } ,
160152 } ,
161153 {
162154 label : 'Pro Trial (Advanced, Reactivated)' ,
163155 description : 'Pro trial (advanced plan), account' ,
164156 iconPath : new ThemeIcon ( 'blank' ) ,
165157 item : {
166158 state : SubscriptionState . Trial ,
167- planId : SubscriptionPlanId . Advanced ,
159+ planId : 'advanced' ,
168160 reactivatedTrial : true ,
169161 } ,
170162 } ,
@@ -185,25 +177,25 @@ class AccountDebug {
185177 label : 'Pro' ,
186178 description : 'Pro, account' ,
187179 iconPath : new ThemeIcon ( 'blank' ) ,
188- item : { state : SubscriptionState . Paid , planId : SubscriptionPlanId . Pro } ,
180+ item : { state : SubscriptionState . Paid , planId : 'pro' } ,
189181 } ,
190182 {
191183 label : 'Advanced' ,
192184 description : 'Advanced plan, account' ,
193185 iconPath : new ThemeIcon ( 'blank' ) ,
194- item : { state : SubscriptionState . Paid , planId : SubscriptionPlanId . Advanced } ,
186+ item : { state : SubscriptionState . Paid , planId : 'advanced' } ,
195187 } ,
196188 {
197189 label : 'Business' ,
198190 description : 'Business plan, account' ,
199191 iconPath : new ThemeIcon ( 'blank' ) ,
200- item : { state : SubscriptionState . Paid , planId : SubscriptionPlanId . Business } ,
192+ item : { state : SubscriptionState . Paid , planId : 'teams' } ,
201193 } ,
202194 {
203195 label : 'Enterprise' ,
204196 description : 'Enterprise plan, account' ,
205197 iconPath : new ThemeIcon ( 'blank' ) ,
206- item : { state : SubscriptionState . Paid , planId : SubscriptionPlanId . Enterprise } ,
198+ item : { state : SubscriptionState . Paid , planId : 'enterprise' } ,
207199 } ,
208200 // TODO: Update this subscription state once we have a "paid expired" state availale
209201 {
0 commit comments