@codingame/monaco-vscode-extensions-service-override
Version:
VSCode public API plugged on the monaco editor - extensions service-override
89 lines (88 loc) • 6.93 kB
TypeScript
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
import { AuthenticationSession, AuthenticationSessionsChangeEvent, AuthenticationSessionAccount, IAuthenticationWwwAuthenticateRequest } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication";
import { IAuthenticationExtensionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service";
import { IAuthenticationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service";
import { IRegisterAuthenticationProviderDetails, IRegisterDynamicAuthenticationProviderDetails, MainThreadAuthenticationShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
import { IAuthenticationAccessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationAccessService.service";
import { IAuthenticationUsageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationUsageService.service";
import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
import { IURLService } from "@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service";
import { IAuthorizationTokenResponse } from "@codingame/monaco-vscode-api/vscode/vs/base/common/oauth";
import { IDynamicAuthenticationProviderStorageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service";
import { IClipboardService } from "@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service";
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
export interface AuthenticationInteractiveOptions {
detail?: string;
learnMore?: UriComponents;
sessionToRecreate?: AuthenticationSession;
}
export interface AuthenticationGetSessionOptions {
clearSessionPreference?: boolean;
createIfNone?: boolean | AuthenticationInteractiveOptions;
forceNewSession?: boolean | AuthenticationInteractiveOptions;
silent?: boolean;
account?: AuthenticationSessionAccount;
authorizationServer?: UriComponents;
}
export declare class MainThreadAuthentication extends Disposable implements MainThreadAuthenticationShape {
private readonly productService;
private readonly authenticationService;
private readonly authenticationExtensionsService;
private readonly authenticationAccessService;
private readonly authenticationUsageService;
private readonly dialogService;
private readonly notificationService;
private readonly extensionService;
private readonly telemetryService;
private readonly openerService;
private readonly logService;
private readonly urlService;
private readonly dynamicAuthProviderStorageService;
private readonly clipboardService;
private readonly quickInputService;
private readonly _proxy;
private readonly _registrations;
private _sentProviderUsageEvents;
private _suppressUnregisterEvent;
constructor(extHostContext: IExtHostContext, productService: IProductService, authenticationService: IAuthenticationService, authenticationExtensionsService: IAuthenticationExtensionsService, authenticationAccessService: IAuthenticationAccessService, authenticationUsageService: IAuthenticationUsageService, dialogService: IDialogService, notificationService: INotificationService, extensionService: IExtensionService, telemetryService: ITelemetryService, openerService: IOpenerService, logService: ILogService, urlService: IURLService, dynamicAuthProviderStorageService: IDynamicAuthenticationProviderStorageService, clipboardService: IClipboardService, quickInputService: IQuickInputService);
$registerAuthenticationProvider({ id, label, supportsMultipleAccounts, resourceServer, supportedAuthorizationServers, supportsChallenges }: IRegisterAuthenticationProviderDetails): Promise<void>;
$unregisterAuthenticationProvider(id: string): Promise<void>;
$ensureProvider(id: string): Promise<void>;
$sendDidChangeSessions(providerId: string, event: AuthenticationSessionsChangeEvent): Promise<void>;
$removeSession(providerId: string, sessionId: string): Promise<void>;
$waitForUriHandler(expectedUri: UriComponents): Promise<UriComponents>;
$showContinueNotification(message: string): Promise<boolean>;
$registerDynamicAuthenticationProvider(details: IRegisterDynamicAuthenticationProviderDetails): Promise<void>;
$setSessionsForDynamicAuthProvider(authProviderId: string, clientId: string, sessions: (IAuthorizationTokenResponse & {
created_at: number;
})[]): Promise<void>;
$sendDidChangeDynamicProviderInfo({ providerId, clientId, authorizationServer, label, clientSecret }: Partial<{
providerId: string;
clientId: string;
authorizationServer: UriComponents;
label: string;
clientSecret: string;
}>): Promise<void>;
private loginPrompt;
private continueWithIncorrectAccountPrompt;
private doGetSession;
$getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | IAuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<AuthenticationSession | undefined>;
$getAccounts(providerId: string): Promise<ReadonlyArray<AuthenticationSessionAccount>>;
private _sentClientIdUsageEvents;
private sendClientIdUsageTelemetry;
private sendProviderUsageTelemetry;
private _getAccountPreference;
$showDeviceCodeModal(userCode: string, verificationUri: string): Promise<boolean>;
$promptForClientRegistration(authorizationServerUrl: string): Promise<{
clientId: string;
clientSecret?: string;
} | undefined>;
}