@@ -16,7 +16,7 @@ import { GlyphChars, Schemes } from '../constants';
1616import { SubscriptionPlanId } from '../constants.subscription' ;
1717import type { Container } from '../container' ;
1818import { AccessDeniedError , ProviderNotFoundError , ProviderNotSupportedError } from '../errors' ;
19- import type { AdvancedFeatures , FeatureAccess , Features , PlusFeatures , RepoFeatureAccess } from '../features' ;
19+ import type { FeatureAccess , Features , PlusFeatures , RepoFeatureAccess } from '../features' ;
2020import type { Subscription } from '../plus/gk/models/subscription' ;
2121import type { SubscriptionChangeEvent } from '../plus/gk/subscriptionService' ;
2222import { isSubscriptionPaidPlan } from '../plus/gk/utils/subscription.utils' ;
@@ -722,26 +722,17 @@ export class GitProviderService implements Disposable {
722722 return this . _subscription ?? ( this . _subscription = await this . container . subscription . getSubscription ( ) ) ;
723723 }
724724
725- private _accessCache = new Map < PlusFeatures | AdvancedFeatures | undefined , Promise < FeatureAccess > > ( ) ;
725+ private _accessCache = new Map < PlusFeatures | undefined , Promise < FeatureAccess > > ( ) ;
726726 private _accessCacheByRepo = new Map < string /* path */ , Promise < RepoFeatureAccess > > ( ) ;
727727 private clearAccessCache ( ) : void {
728728 this . _accessCache . clear ( ) ;
729729 this . _accessCacheByRepo . clear ( ) ;
730730 }
731731
732- async access (
733- feature : PlusFeatures | AdvancedFeatures | undefined ,
734- repoPath : string | Uri ,
735- ) : Promise < RepoFeatureAccess > ;
736- async access (
737- feature ?: PlusFeatures | AdvancedFeatures ,
738- repoPath ?: string | Uri ,
739- ) : Promise < FeatureAccess | RepoFeatureAccess > ;
732+ async access ( feature : PlusFeatures | undefined , repoPath : string | Uri ) : Promise < RepoFeatureAccess > ;
733+ async access ( feature ?: PlusFeatures , repoPath ?: string | Uri ) : Promise < FeatureAccess | RepoFeatureAccess > ;
740734 @debug ( { exit : true } )
741- async access (
742- feature ?: PlusFeatures | AdvancedFeatures ,
743- repoPath ?: string | Uri ,
744- ) : Promise < FeatureAccess | RepoFeatureAccess > {
735+ async access ( feature ?: PlusFeatures , repoPath ?: string | Uri ) : Promise < FeatureAccess | RepoFeatureAccess > {
745736 if ( repoPath == null ) {
746737 let access = this . _accessCache . get ( feature ) ;
747738 if ( access == null ) {
@@ -763,17 +754,14 @@ export class GitProviderService implements Disposable {
763754 return access ;
764755 }
765756
757+ private async accessCore ( feature : PlusFeatures | undefined , repoPath : string | Uri ) : Promise < RepoFeatureAccess > ;
766758 private async accessCore (
767- feature : PlusFeatures | AdvancedFeatures | undefined ,
768- repoPath : string | Uri ,
769- ) : Promise < RepoFeatureAccess > ;
770- private async accessCore (
771- feature ?: PlusFeatures | AdvancedFeatures ,
759+ feature ?: PlusFeatures ,
772760 repoPath ?: string | Uri ,
773761 ) : Promise < FeatureAccess | RepoFeatureAccess > ;
774762 @debug ( { exit : true } )
775763 private async accessCore (
776- feature ?: PlusFeatures | AdvancedFeatures ,
764+ feature ?: PlusFeatures ,
777765 repoPath ?: string | Uri ,
778766 ) : Promise < FeatureAccess | RepoFeatureAccess > {
779767 const subscription = await this . getSubscription ( ) ;
@@ -870,7 +858,7 @@ export class GitProviderService implements Disposable {
870858 return getRepoAccess . call ( this , repoPath , true ) ;
871859 }
872860
873- async ensureAccess ( feature : PlusFeatures | AdvancedFeatures , repoPath ?: string ) : Promise < void > {
861+ async ensureAccess ( feature : PlusFeatures , repoPath ?: string ) : Promise < void > {
874862 const { allowed, subscription } = await this . access ( feature , repoPath ) ;
875863 if ( allowed === false ) throw new AccessDeniedError ( subscription . current , subscription . required ) ;
876864 }
0 commit comments