This commit is contained in:
28
node_modules/request-light/CHANGELOG.md
generated
vendored
Normal file
28
node_modules/request-light/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
0.5.0 / 2021-07-12
|
||||
==================
|
||||
* support binary content (XHRResponse.body)
|
||||
* updated to http-proxy-agent@4.0.1, https-proxy-agent@5.0.0
|
||||
* webpacked, stripping out debug and dependencies
|
||||
* tests
|
||||
|
||||
0.4.0 / 2020-06-17
|
||||
==================
|
||||
* support for browser ('browser' in package.json)
|
||||
|
||||
0.3.0 / 2020-02-28
|
||||
==================
|
||||
* Add XHRResponse.headers
|
||||
|
||||
0.2.5 / 2019-11-30
|
||||
==================
|
||||
* update https-proxy-agent
|
||||
|
||||
0.2.2 / 2017-12-21
|
||||
==================
|
||||
* Error handling for gzip errors
|
||||
* Update http-proxy-agent & https-proxy-agent
|
||||
|
||||
0.2.1 / 2017-05-16
|
||||
==================
|
||||
* Support for gzip & deflate
|
||||
21
node_modules/request-light/LICENSE.md
generated
vendored
Normal file
21
node_modules/request-light/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
22
node_modules/request-light/README.md
generated
vendored
Normal file
22
node_modules/request-light/README.md
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# request-light
|
||||
|
||||
|
||||
[](https://www.npmjs.org/package/request-light)
|
||||
[](https://npmjs.org/package/request-light)
|
||||
[](https://github.com/microsoft/node-request-light/workflows/Tests)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
A lightweight request library intended to be used by VSCode extensions.
|
||||
- NodeJS and browser main entry points
|
||||
- proxy support: Use `configure` or `HTTP_PROXY` and `HTTPS_PROXY` env variables to configure the HTTP proxy addresses.
|
||||
|
||||
```ts
|
||||
import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';
|
||||
|
||||
const headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||
return xhr({ url: url, followRedirects: 5, headers }).then(response => {
|
||||
return response.responseText;
|
||||
}, (error: XHRResponse) => {
|
||||
throw new Error(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||
});
|
||||
```
|
||||
41
node_modules/request-light/SECURITY.md
generated
vendored
Normal file
41
node_modules/request-light/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
78
node_modules/request-light/api.d.ts
generated
vendored
Normal file
78
node_modules/request-light/api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export interface XHROptions {
|
||||
type?: string;
|
||||
url: string;
|
||||
user?: string;
|
||||
password?: string;
|
||||
headers?: Headers;
|
||||
timeout?: number;
|
||||
data?: string;
|
||||
strictSSL?: boolean;
|
||||
followRedirects?: number;
|
||||
token?: CancellationToken;
|
||||
agent?: HttpProxyAgent | HttpsProxyAgent;
|
||||
}
|
||||
|
||||
export interface XHRResponse {
|
||||
readonly responseText: string;
|
||||
readonly body: Uint8Array;
|
||||
readonly status: number;
|
||||
readonly headers: Headers;
|
||||
}
|
||||
|
||||
export interface XHRRequest {
|
||||
(options: XHROptions): Promise<XHRResponse>
|
||||
}
|
||||
|
||||
export interface XHRConfigure {
|
||||
(proxyUrl: string | undefined, strictSSL: boolean): void;
|
||||
}
|
||||
|
||||
export interface Disposable {
|
||||
/**
|
||||
* Dispose this object.
|
||||
*/
|
||||
dispose(): void;
|
||||
}
|
||||
/**
|
||||
* Represents a typed event.
|
||||
*/
|
||||
export interface Event<T> {
|
||||
/**
|
||||
*
|
||||
* @param listener The listener function will be call when the event happens.
|
||||
* @param thisArgs The 'this' which will be used when calling the event listener.
|
||||
* @param disposables An array to which a {{IDisposable}} will be added. The
|
||||
* @return
|
||||
*/
|
||||
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
|
||||
}
|
||||
/**
|
||||
* Defines a CancellationToken. This interface is not
|
||||
* intended to be implemented. A CancellationToken must
|
||||
* be created via a CancellationTokenSource.
|
||||
*/
|
||||
export interface CancellationToken {
|
||||
/**
|
||||
* Is `true` when the token has been cancelled, `false` otherwise.
|
||||
*/
|
||||
readonly isCancellationRequested: boolean;
|
||||
/**
|
||||
* An [event](#Event) which fires upon cancellation.
|
||||
*/
|
||||
readonly onCancellationRequested: Event<any>;
|
||||
}
|
||||
|
||||
export type HttpProxyAgent = any;
|
||||
|
||||
export type HttpsProxyAgent = any;
|
||||
|
||||
export type Headers = { [header: string]: string | string[] | undefined };
|
||||
|
||||
export declare const configure: XHRConfigure;
|
||||
export declare const xhr: XHRRequest;
|
||||
|
||||
export declare function getErrorStatusDescription(status: number): string;
|
||||
1
node_modules/request-light/lib/browser/main.js
generated
vendored
Normal file
1
node_modules/request-light/lib/browser/main.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(()=>{"use strict";var e={};(()=>{var r=e;Object.defineProperty(r,"__esModule",{value:!0}),r.getErrorStatusDescription=r.xhr=r.configure=void 0,r.configure=(e,r)=>{},r.xhr=async e=>{const r=new Headers;if(e.headers)for(const t in e.headers){const o=e.headers[t];Array.isArray(o)?o.forEach((e=>r.set(t,e))):r.set(t,o)}e.user&&e.password&&r.set("Authorization","Basic "+btoa(e.user+":"+e.password));const t={method:e.type,redirect:e.followRedirects>0?"follow":"manual",mode:"cors",headers:r};if(e.data&&(t.body=e.data),e.token){const r=new AbortController;e.token.isCancellationRequested&&r.abort(),e.token.onCancellationRequested((()=>{r.abort()})),t.signal=r.signal}const o=new Request(e.url,t),s=await fetch(o),a={};s.headers.forEach(((e,r)=>{a[r]=e}));const n=await s.arrayBuffer();return new class{constructor(){this.status=s.status,this.headers=a}get responseText(){return(new TextDecoder).decode(n)}get body(){return new Uint8Array(n)}}},r.getErrorStatusDescription=function(e){return String(e)}})();var r=exports;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
|
||||
1
node_modules/request-light/lib/node/main.js
generated
vendored
Normal file
1
node_modules/request-light/lib/node/main.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
41
node_modules/request-light/package.json
generated
vendored
Normal file
41
node_modules/request-light/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "request-light",
|
||||
"version": "0.7.0",
|
||||
"description": "Lightweight request library. Promise based, with proxy support.",
|
||||
"main": "./lib/node/main.js",
|
||||
"browser": {
|
||||
"./lib/node/main.js": "./lib/browser/main.js"
|
||||
},
|
||||
"typings": "./api",
|
||||
"author": "Microsoft Corporation",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/node-request-light"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/microsoft/node-request-light/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"http-proxy-agent": "^5.0.0",
|
||||
"https-proxy-agent": "^5.0.1",
|
||||
"vscode-nls": "^5.2.0",
|
||||
"typescript": "^4.9.4",
|
||||
"@types/node": "16.x",
|
||||
"vscode-jsonrpc": "^5.0.0",
|
||||
"rimraf": "^4.1.1",
|
||||
"ts-loader": "^9.4.2",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"ava": "^5.1.1",
|
||||
"proxy": "^1.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"bundle": "webpack --mode production --devtool hidden-source-map",
|
||||
"prepack": "npm run clean && npm run bundle && tsc -p ./src/test/ && ava ./lib/test/test.js",
|
||||
"clean": "rimraf lib",
|
||||
"test": "npm run compile && tsc -p ./src/test/ && ava ./lib/test/test.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user