@sussudio/platform
Version:
Internal APIs for VS Code's service injection the base services.
49 lines (47 loc) • 2.1 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference types="node" />
import * as http from 'http';
import { CancellationToken } from '@sussudio/base/common/cancellation.mjs';
import { Disposable } from '@sussudio/base/common/lifecycle.mjs';
import { IRequestContext, IRequestOptions } from '@sussudio/base/parts/request/common/request.mjs';
import { IConfigurationService } from '../../configuration/common/configuration.mjs';
import { INativeEnvironmentService } from '../../environment/common/environment.mjs';
import { ILogService } from '../../log/common/log.mjs';
import { IRequestService } from '../common/request.mjs';
import { Agent } from './proxy.mjs';
export interface IRawRequestFunction {
(options: http.RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
}
export interface NodeRequestOptions extends IRequestOptions {
agent?: Agent;
strictSSL?: boolean;
isChromiumNetwork?: boolean;
getRawRequest?(options: IRequestOptions): IRawRequestFunction;
}
/**
* This service exposes the `request` API, while using the global
* or configured proxy settings.
*/
export declare class RequestService extends Disposable implements IRequestService {
private readonly configurationService;
private readonly environmentService;
private readonly logService;
readonly _serviceBrand: undefined;
private proxyUrl?;
private strictSSL;
private authorization?;
private shellEnvErrorLogged?;
constructor(
configurationService: IConfigurationService,
environmentService: INativeEnvironmentService,
logService: ILogService,
);
private configure;
request(options: NodeRequestOptions, token: CancellationToken): Promise<IRequestContext>;
private getNodeRequest;
private _request;
resolveProxy(url: string): Promise<string | undefined>;
}