request-light
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -1,1 +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})})(); | ||
(()=>{"use strict";var e={};(()=>{var r=e;Object.defineProperty(r,"__esModule",{value:!0}),r.xhr=r.configure=void 0,r.getErrorStatusDescription=function(e){return String(e)},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)}}}})();var r=exports;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); |
@@ -1,1 +0,1 @@ | ||
(()=>{var e={46:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,{signal:r}={}){return new Promise(((o,n)=>{function s(){null==r||r.removeEventListener("abort",s),e.removeListener(t,a),e.removeListener("error",u)}function a(...e){s(),o(e)}function u(e){s(),n(e)}null==r||r.addEventListener("abort",s),e.on(t,a),e.on("error",u)}))}},54:function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const n=r(361),s=o(r(374)),a=o(r(304)),u=s.default("agent-base");function i(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some((e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:")))}function c(e,t){return new c.Agent(e,t)}!function(e){class t extends n.EventEmitter{constructor(e,t){super();let r=t;"function"==typeof e?this.callback=e:e&&(r=e),this.timeout=null,r&&"number"==typeof r.timeout&&(this.timeout=r.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:i()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:i()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,r){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const r=Object.assign({},t);"boolean"!=typeof r.secureEndpoint&&(r.secureEndpoint=i()),null==r.host&&(r.host="localhost"),null==r.port&&(r.port=r.secureEndpoint?443:80),null==r.protocol&&(r.protocol=r.secureEndpoint?"https:":"http:"),r.host&&r.path&&delete r.path,delete r.agent,delete r.hostname,delete r._defaultAgent,delete r.defaultPort,delete r.createConnection,e._last=!0,e.shouldKeepAlive=!1;let o=!1,n=null;const s=r.timeout||this.timeout,c=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},l=()=>{n=null,o=!0;const e=new Error(`A "socket" was not created for HTTP request before ${s}ms`);e.code="ETIMEOUT",c(e)},d=e=>{o||(null!==n&&(clearTimeout(n),n=null),c(e))},f=t=>{if(o)return;if(null!=n&&(clearTimeout(n),n=null),s=t,Boolean(s)&&"function"==typeof s.addRequest)return u("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,r);var s;if(t)return t.once("free",(()=>{this.freeSocket(t,r)})),void e.onSocket(t);const a=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);c(a)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(u("Converting legacy callback function to promise"),this.promisifiedCallback=a.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof s&&s>0&&(n=setTimeout(l,s)),"port"in r&&"number"!=typeof r.port&&(r.port=Number(r.port));try{u("Resolving socket for %o request: %o",r.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,r)).then(f,d)}catch(e){Promise.reject(e).catch(d)}}else c(new Error("`callback` is not defined"))}freeSocket(e,t){u("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){u("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype}(c||(c={})),e.exports=c},304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r){return new Promise(((o,n)=>{e.call(this,t,r,((e,t)=>{e?n(e):o(t)}))}))}}},370:function(e,t,r){"use strict";var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function a(e){try{i(o.next(e))}catch(e){s(e)}}function u(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}i((o=o.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(r(808)),a=n(r(404)),u=n(r(310)),i=n(r(374)),c=n(r(46)),l=r(54),d=(0,i.default)("http-proxy-agent");class f extends l.Agent{constructor(e){let t;if(t="string"==typeof e?u.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");d("Creating new HttpProxyAgent instance: %o",t),super(t);const r=Object.assign({},t);var o;this.secureProxy=t.secureProxy||"string"==typeof(o=r.protocol)&&/^https:?$/i.test(o),r.host=r.hostname||r.host,"string"==typeof r.port&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(e,t){return o(this,void 0,void 0,(function*(){const{proxy:r,secureProxy:o}=this,n=u.default.parse(e.path);let i;if(n.protocol||(n.protocol="http:"),n.hostname||(n.hostname=t.hostname||t.host||null),null==n.port&&(t.port,1)&&(n.port=String(t.port)),"80"===n.port&&(n.port=""),e.path=u.default.format(n),r.auth&&e.setHeader("Proxy-Authorization",`Basic ${Buffer.from(r.auth).toString("base64")}`),o?(d("Creating `tls.Socket`: %o",r),i=a.default.connect(r)):(d("Creating `net.Socket`: %o",r),i=s.default.connect(r)),e._header){let t,r;d("Regenerating stored HTTP header string for request"),e._header=null,e._implicitHeader(),e.output&&e.output.length>0?(d("Patching connection write() output buffer with updated header"),t=e.output[0],r=t.indexOf("\r\n\r\n")+4,e.output[0]=e._header+t.substring(r),d("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(d("Patching connection write() output buffer with updated header"),t=e.outputData[0].data,r=t.indexOf("\r\n\r\n")+4,e.outputData[0].data=e._header+t.substring(r),d("Output buffer: %o",e.outputData[0].data))}return yield(0,c.default)(i,"connect"),i}))}}t.default=f},201:function(e,t,r){"use strict";const o=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(370));function n(e){return new o.default(e)}!function(e){e.HttpProxyAgent=o.default,e.prototype=o.default.prototype}(n||(n={})),e.exports=n},146:function(e,t,r){"use strict";var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function a(e){try{i(o.next(e))}catch(e){s(e)}}function u(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}i((o=o.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(r(808)),a=n(r(404)),u=n(r(310)),i=n(r(491)),c=n(r(374)),l=r(54),d=n(r(829)),f=c.default("https-proxy-agent:agent");class p extends l.Agent{constructor(e){let t;if(t="string"==typeof e?u.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");f("creating new HttpsProxyAgent instance: %o",t),super(t);const r=Object.assign({},t);var o;this.secureProxy=t.secureProxy||"string"==typeof(o=r.protocol)&&/^https:?$/i.test(o),r.host=r.hostname||r.host,"string"==typeof r.port&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(e,t){return o(this,void 0,void 0,(function*(){const{proxy:r,secureProxy:o}=this;let n;o?(f("Creating `tls.Socket`: %o",r),n=a.default.connect(r)):(f("Creating `net.Socket`: %o",r),n=s.default.connect(r));const u=Object.assign({},r.headers);let c=`CONNECT ${t.host}:${t.port} HTTP/1.1\r\n`;r.auth&&(u["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:l,port:p,secureEndpoint:g}=t;(function(e,t){return Boolean(!t&&80===e||t&&443===e)})(p,g)||(l+=`:${p}`),u.Host=l,u.Connection="close";for(const e of Object.keys(u))c+=`${e}: ${u[e]}\r\n`;const v=d.default(n);n.write(`${c}\r\n`);const{statusCode:m,buffered:y}=yield v;if(200===m){if(e.once("socket",h),t.secureEndpoint){f("Upgrading socket connection to TLS");const e=t.servername||t.host;return a.default.connect(Object.assign(Object.assign({},function(e,...t){const r={};let o;for(o in e)t.includes(o)||(r[o]=e[o]);return r}(t,"host","hostname","path","port")),{socket:n,servername:e}))}return n}n.destroy();const b=new s.default.Socket({writable:!1});return b.readable=!0,e.once("socket",(e=>{f("replaying proxy buffer for failed request"),i.default(e.listenerCount("data")>0),e.push(y),e.push(null)})),b}))}}function h(e){e.resume()}t.default=p},18:function(e,t,r){"use strict";const o=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(146));function n(e){return new o.default(e)}!function(e){e.HttpsProxyAgent=o.default,e.prototype=o.default.prototype}(n||(n={})),e.exports=n},829:function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=o(r(374)).default("https-proxy-agent:parse-proxy-response");t.default=function(e){return new Promise(((t,r)=>{let o=0;const s=[];function a(){const r=e.read();r?function(e){s.push(e),o+=e.length;const r=Buffer.concat(s,o);if(-1===r.indexOf("\r\n\r\n"))return n("have not received end of HTTP headers yet..."),void a();const u=r.toString("ascii",0,r.indexOf("\r\n")),i=+u.split(" ")[1];n("got proxy server response: %o",u),t({statusCode:i,buffered:r})}(r):e.once("readable",a)}function u(e){n("onclose had error %o",e)}function i(){n("onend")}e.on("error",(function t(o){e.removeListener("end",i),e.removeListener("error",t),e.removeListener("close",u),e.removeListener("readable",a),n("onerror %o",o),r(o)})),e.on("close",u),e.on("end",i),a()}))}},539:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorStatusDescription=t.xhr=t.configure=void 0;var a=r(685),u=r(687),i=r(310),c=r(472),l=r(796),d=r(201),f=r(18);if(process.env.VSCODE_NLS_CONFIG){var p=process.env.VSCODE_NLS_CONFIG;c.config(JSON.parse(p))}var h=c.loadMessageBundle(),g=void 0,v=!0;function m(e){var t;return new Promise((function(r,o){var n=(0,i.parse)(e.url),s={hostname:n.hostname,agent:!!e.agent&&e.agent,port:n.port?parseInt(n.port):"https:"===n.protocol?443:80,path:n.path,method:e.type||"GET",headers:e.headers,rejectUnauthorized:"boolean"!=typeof e.strictSSL||e.strictSSL};e.user&&e.password&&(s.auth=e.user+":"+e.password);var c=function(o){if(o.statusCode>=300&&o.statusCode<400&&e.followRedirects&&e.followRedirects>0&&o.headers.location){var s=o.headers.location;s.startsWith("/")&&(s=(0,i.format)({protocol:n.protocol,hostname:n.hostname,port:n.port,pathname:s})),r(m(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach((function(t){return Object.keys(t).forEach((function(r){return e[r]=t[r]}))})),e}({},e,{url:s,followRedirects:e.followRedirects-1})))}else r({req:t,res:o})};(t="https:"===n.protocol?u.request(s,c):a.request(s,c)).on("error",o),e.timeout&&t.setTimeout(e.timeout),e.data&&t.write(e.data),t.end(),e.token&&(e.token.isCancellationRequested&&t.destroy(new y),e.token.onCancellationRequested((function(){t.destroy(new y)})))}))}t.configure=function(e,t){g=e,v=t},t.xhr=function(e){return"boolean"!=typeof(e=s({},e)).strictSSL&&(e.strictSSL=v),e.agent||(e.agent=function(e,t){void 0===t&&(t={});var r=(0,i.parse)(e),o=t.proxyUrl||function(e){return"http:"===e.protocol?process.env.HTTP_PROXY||process.env.http_proxy||null:"https:"===e.protocol&&(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy)||null}(r);if(!o)return null;var n=(0,i.parse)(o);if(!/^https?:$/.test(n.protocol))return null;var s={host:n.hostname,port:Number(n.port),auth:n.auth,rejectUnauthorized:"boolean"!=typeof t.strictSSL||t.strictSSL,protocol:n.protocol};return"http:"===r.protocol?d(s):f(s)}(e.url,{proxyUrl:g,strictSSL:v})),"number"!=typeof e.followRedirects&&(e.followRedirects=5),m(e).then((function(r){return new Promise((function(o,n){var s,a,u=r.res,c=u,d=!1,f=u.headers&&u.headers["content-encoding"];if(f&&(s=e.type,a=r.res.statusCode,!("HEAD"===s||a>=100&&a<200||204===a||304===a))){var p={flush:l.constants.Z_SYNC_FLUSH,finishFlush:l.constants.Z_SYNC_FLUSH};if("gzip"===f){var g=l.createGunzip(p);u.pipe(g),c=g}else if("deflate"===f){var v=l.createInflate(p);u.pipe(v),c=v}}var m=[];c.on("data",(function(e){return m.push(e)})),c.on("end",(function(){if(!d){if(d=!0,e.followRedirects>0&&(u.statusCode>=300&&u.statusCode<=303||307===u.statusCode)){var r=u.headers.location;if(r.startsWith("/")){var s=(0,i.parse)(e.url);r=(0,i.format)({protocol:s.protocol,hostname:s.hostname,port:s.port,pathname:r})}if(r){var a={type:e.type,url:r,user:e.user,password:e.password,headers:e.headers,timeout:e.timeout,followRedirects:e.followRedirects-1,data:e.data,token:e.token};return void(0,t.xhr)(a).then(o,n)}}var c=Buffer.concat(m),l={responseText:c.toString(),body:c,status:u.statusCode,headers:u.headers||{}};u.statusCode>=200&&u.statusCode<300||1223===u.statusCode?o(l):n(l)}})),c.on("error",(function(t){var r;r=y.is(t)?t:{responseText:h("error","Unable to access {0}. Error: {1}",e.url,t.message),body:Buffer.concat(m),status:500,headers:{}},d=!0,n(r)})),e.token&&(e.token.isCancellationRequested&&c.destroy(new y),e.token.onCancellationRequested((function(){c.destroy(new y)})))}))}),(function(t){var r;return r=y.is(t)?t:{responseText:e.agent?h("error.cannot.connect.proxy","Unable to connect to {0} through a proxy. Error: {1}",e.url,t.message):h("error.cannot.connect","Unable to connect to {0}. Error: {1}",e.url,t.message),body:Buffer.concat([]),status:404,headers:{}},Promise.reject(r)}))},t.getErrorStatusDescription=function(e){if(!(e<400))switch(e){case 400:return h("status.400","Bad request. The request cannot be fulfilled due to bad syntax.");case 401:return h("status.401","Unauthorized. The server is refusing to respond.");case 403:return h("status.403","Forbidden. The server is refusing to respond.");case 404:return h("status.404","Not Found. The requested location could not be found.");case 405:return h("status.405","Method not allowed. A request was made using a request method not supported by that location.");case 406:return h("status.406","Not Acceptable. The server can only generate a response that is not accepted by the client.");case 407:return h("status.407","Proxy Authentication Required. The client must first authenticate itself with the proxy.");case 408:return h("status.408","Request Timeout. The server timed out waiting for the request.");case 409:return h("status.409","Conflict. The request could not be completed because of a conflict in the request.");case 410:return h("status.410","Gone. The requested page is no longer available.");case 411:return h("status.411",'Length Required. The "Content-Length" is not defined.');case 412:return h("status.412","Precondition Failed. The precondition given in the request evaluated to false by the server.");case 413:return h("status.413","Request Entity Too Large. The server will not accept the request, because the request entity is too large.");case 414:return h("status.414","Request-URI Too Long. The server will not accept the request, because the URL is too long.");case 415:return h("status.415","Unsupported Media Type. The server will not accept the request, because the media type is not supported.");case 500:return h("status.500","Internal Server Error.");case 501:return h("status.501","Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request.");case 502:return h("status.502","Bad Gateway. The upstream server did not respond.");case 503:return h("status.503","Service Unavailable. The server is currently unavailable (overloaded or down).");default:return h("status.416","HTTP status code {0}",e)}};var y=function(e){function t(){var r=e.call(this,"The user aborted a request")||this;return r.name="AbortError",Object.setPrototypeOf(r,t.prototype),r}return n(t,e),t.is=function(e){return e instanceof t},t}(Error)},800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.localize=t.format=t.setPseudo=t.isPseudo=t.isDefined=t.BundleFormat=t.MessageFormat=void 0;var o,n,s,a=r(926);function u(e){return void 0!==e}function i(e,r){return t.isPseudo&&(e="["+e.replace(/[aouei]/g,"$&$&")+"]"),0===r.length?e:e.replace(/\{(\d+)\}/g,(function(e,t){var o=t[0],n=r[o],s=e;return"string"==typeof n?s=n:"number"!=typeof n&&"boolean"!=typeof n&&null!=n||(s=String(n)),s}))}(s=t.MessageFormat||(t.MessageFormat={})).file="file",s.bundle="bundle",s.both="both",(n=t.BundleFormat||(t.BundleFormat={})).standalone="standalone",n.languagePack="languagePack",function(e){e.is=function(e){var t=e;return t&&u(t.key)&&u(t.comment)}}(o||(o={})),t.isDefined=u,t.isPseudo=!1,t.setPseudo=function(e){t.isPseudo=e},t.format=i,t.localize=function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return i(t,r)},t.loadMessageBundle=function(e){return(0,a.default)().loadMessageBundle(e)},t.config=function(e){return(0,a.default)().config(e)}},926:(e,t)=>{"use strict";var r;function o(){if(void 0===r)throw new Error("No runtime abstraction layer installed");return r}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");r=e}}(o||(o={})),t.default=o},472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.BundleFormat=t.MessageFormat=void 0;var o=r(17),n=r(147),s=r(926),a=r(800),u=r(800);Object.defineProperty(t,"MessageFormat",{enumerable:!0,get:function(){return u.MessageFormat}}),Object.defineProperty(t,"BundleFormat",{enumerable:!0,get:function(){return u.BundleFormat}});var i,c,l=Object.prototype.toString;function d(e){return"[object Number]"===l.call(e)}function f(e){return"[object String]"===l.call(e)}function p(e){return JSON.parse(n.readFileSync(e,"utf8"))}function h(e){return function(t,r){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];return d(t)?t>=e.length?void console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: ".concat(new Error("").stack)):(0,a.format)(e[t],o):f(r)?(console.warn("Message ".concat(r," didn't get externalized correctly.")),(0,a.format)(r,o)):void console.error("Broken localize call found. Stacktrace is\n: ".concat(new Error("").stack))}}function g(e,t){return i[e]=t,t}function v(e){try{return function(e){var t=p(o.join(e,"nls.metadata.json")),r=Object.create(null);for(var n in t){var s=t[n];r[n]=s.messages}return r}(e)}catch(e){return void console.log("Generating default bundle from meta data failed.",e)}}function m(e,t){var r;if(!0===c.languagePackSupport&&void 0!==c.cacheRoot&&void 0!==c.languagePackId&&void 0!==c.translationsConfigFile&&void 0!==c.translationsConfig)try{r=function(e,t){var r,s,a,u=o.join(c.cacheRoot,"".concat(e.id,"-").concat(e.hash,".json")),i=!1,l=!1;try{return r=JSON.parse(n.readFileSync(u,{encoding:"utf8",flag:"r"})),s=u,a=new Date,n.utimes(s,a,a,(function(){})),r}catch(e){if("ENOENT"===e.code)l=!0;else{if(!(e instanceof SyntaxError))throw e;console.log("Syntax error parsing message bundle: ".concat(e.message,".")),n.unlink(u,(function(e){e&&console.error("Deleting corrupted bundle ".concat(u," failed."))})),i=!0}}if(r=function(e,t){var r=c.translationsConfig[e.id];if(r){var n=p(r).contents,s=p(o.join(t,"nls.metadata.json")),a=Object.create(null);for(var u in s){var i=s[u],l=n["".concat(e.outDir,"/").concat(u)];if(l){for(var d=[],h=0;h<i.keys.length;h++){var g=i.keys[h],v=l[f(g)?g:g.key];void 0===v&&(v=i.messages[h]),d.push(v)}a[u]=d}else a[u]=i.messages}return a}}(e,t),!r||i)return r;if(l)try{n.writeFileSync(u,JSON.stringify(r),{encoding:"utf8",flag:"wx"})}catch(e){if("EEXIST"===e.code)return r;throw e}return r}(e,t)}catch(e){console.log("Load or create bundle failed ",e)}if(!r){if(c.languagePackSupport)return v(t);var s=function(e){for(var t=c.language;t;){var r=o.join(e,"nls.bundle.".concat(t,".json"));if(n.existsSync(r))return r;var s=t.lastIndexOf("-");t=s>0?t.substring(0,s):void 0}if(void 0===t&&(r=o.join(e,"nls.bundle.json"),n.existsSync(r)))return r}(t);if(s)try{return p(s)}catch(e){console.log("Loading in the box message bundle failed.",e)}r=v(t)}return r}function y(e){if(!e)return a.localize;var t=o.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),c.messageFormat===a.MessageFormat.both||c.messageFormat===a.MessageFormat.bundle){var r=function(e){for(var t,r=o.dirname(e);t=o.join(r,"nls.metadata.header.json"),!n.existsSync(t);){var s=o.dirname(r);if(s===r){t=void 0;break}r=s}return t}(e);if(r){var s=o.dirname(r),u=i[s];if(void 0===u)try{var l=JSON.parse(n.readFileSync(r,"utf8"));try{var d=m(l,s);u=g(s,d?{header:l,nlsBundle:d}:null)}catch(e){console.error("Failed to load nls bundle",e),u=g(s,null)}}catch(e){console.error("Failed to read header file",e),u=g(s,null)}if(u){var f=e.substr(s.length+1).replace(/\\/g,"/"),v=u.nlsBundle[f];return void 0===v?(console.error("Messages for file ".concat(e," not found. See console for details.")),function(){return"Messages not found."}):h(v)}}}if(c.messageFormat===a.MessageFormat.both||c.messageFormat===a.MessageFormat.file)try{var y=p(function(e){var t;if(c.cacheLanguageResolution&&t);else{if(a.isPseudo||!c.language)t=".nls.json";else for(var r=c.language;r;){var o=".nls."+r+".json";if(n.existsSync(e+o)){t=o;break}var s=r.lastIndexOf("-");s>0?r=r.substring(0,s):(t=".nls.json",r=null)}c.cacheLanguageResolution}return e+t}(e));return Array.isArray(y)?h(y):(0,a.isDefined)(y.messages)&&(0,a.isDefined)(y.keys)?h(y.messages):(console.error("String bundle '".concat(e,"' uses an unsupported format.")),function(){return"File bundle has unsupported format. See console for details"})}catch(e){"ENOENT"!==e.code&&console.error("Failed to load single file bundle",e)}return console.error("Failed to load message bundle for file ".concat(e)),function(){return"Failed to load message bundle. See console for details."}}function b(e){return e&&(f(e.locale)&&(c.locale=e.locale.toLowerCase(),c.language=c.locale,i=Object.create(null)),void 0!==e.messageFormat&&(c.messageFormat=e.messageFormat),e.bundleFormat===a.BundleFormat.standalone&&!0===c.languagePackSupport&&(c.languagePackSupport=!1)),(0,a.setPseudo)("pseudo"===c.locale),y}!function(){if(c={locale:void 0,language:void 0,languagePackSupport:!1,cacheLanguageResolution:!0,messageFormat:a.MessageFormat.bundle},f(process.env.VSCODE_NLS_CONFIG))try{var e=JSON.parse(process.env.VSCODE_NLS_CONFIG),t=void 0;if(e.availableLanguages){var r=e.availableLanguages["*"];f(r)&&(t=r)}if(f(e.locale)&&(c.locale=e.locale.toLowerCase()),void 0===t?c.language=c.locale:"en"!==t&&(c.language=t),function(e){return!0===e||!1===e}(e._languagePackSupport)&&(c.languagePackSupport=e._languagePackSupport),f(e._cacheRoot)&&(c.cacheRoot=e._cacheRoot),f(e._languagePackId)&&(c.languagePackId=e._languagePackId),f(e._translationsConfigFile)){c.translationsConfigFile=e._translationsConfigFile;try{c.translationsConfig=p(c.translationsConfigFile)}catch(t){if(e._corruptedFile){var s=o.dirname(e._corruptedFile);n.exists(s,(function(t){t&&n.writeFile(e._corruptedFile,"corrupted","utf8",(function(e){console.error(e)}))}))}}}}catch(e){}(0,a.setPseudo)("pseudo"===c.locale),i=Object.create(null)}(),t.loadMessageBundle=y,t.config=b,s.default.install(Object.freeze({loadMessageBundle:y,config:b}))},374:(e,t)=>{function r(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r}},491:e=>{"use strict";e.exports=require("assert")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},685:e=>{"use strict";e.exports=require("http")},687:e=>{"use strict";e.exports=require("https")},808:e=>{"use strict";e.exports=require("net")},17:e=>{"use strict";e.exports=require("path")},404:e=>{"use strict";e.exports=require("tls")},310:e=>{"use strict";e.exports=require("url")},796:e=>{"use strict";e.exports=require("zlib")}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,r),s.exports}(539),o=exports;for(var n in r)o[n]=r[n];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); | ||
(()=>{var e={747:(e,t,r)=>{"use strict";var o,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(a,{config:()=>f,t:()=>h}),e.exports=(o=a,((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of i(t))c.call(e,r)||undefined===r||n(e,r,{get:()=>t[r],enumerable:!(o=s(t,r))||o.enumerable});return e})(n({},"__esModule",{value:!0}),o));var u,p=r(896),l=r(943);function f(e){if("contents"in e)u="string"==typeof e.contents?JSON.parse(e.contents):e.contents;else if("fsPath"in e){const r=(t=e.fsPath,(0,p.readFileSync)(t,"utf8")),o=JSON.parse(r);u=g(o)?o.contents.bundle:o}else{var t;if(e.uri){let t=e.uri;return"string"==typeof e.uri&&(t=new URL(e.uri)),new Promise(((e,r)=>{(async function(e){if("file:"===e.protocol)return await(0,l.readFile)(e,"utf8");if("http:"===e.protocol||"https:"===e.protocol){const t=await fetch(e.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!t.ok){let r=`Unexpected ${t.status} response while trying to read ${e}`;try{r+=`: ${await t.text()}`}catch{}throw new Error(r)}return await t.text()}throw new Error("Unsupported protocol")})(t).then((t=>{try{const r=JSON.parse(t);u=g(r)?r.contents.bundle:r,e()}catch(e){r(e)}})).catch((e=>{r(e)}))}))}}}function h(...e){const t=e[0];let r,o,n;if("string"==typeof t)r=t,o=t,e.splice(0,1),n=e&&"object"==typeof e[0]?e[0]:e;else{if(t instanceof Array){const r=e.slice(1);if(t.length!==r.length+1)throw new Error("expected a string as the first argument to l10n.t");let o=t[0];for(let e=1;e<t.length;e++)o+=`{${e-1}}`+t[e];return h(o,...r)}o=t.message,r=o,t.comment&&t.comment.length>0&&(r+=`/${Array.isArray(t.comment)?t.comment.join(""):t.comment}`),n=t.args??{}}const s=u?.[r];return s?"string"==typeof s?y(s,n):s.comment?y(s.message,n):y(o,n):y(o,n)}var d=/{([^}]+)}/g;function y(e,t){return 0===Object.keys(t).length?e:e.replace(d,((e,r)=>t[r]??e))}function g(e){return!("object"!=typeof e?.contents?.bundle||"string"!=typeof e?.version)}},544:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.req=t.json=t.toBuffer=void 0;const i=s(r(611)),c=s(r(692));async function a(e){let t=0;const r=[];for await(const o of e)t+=o.length,r.push(o);return Buffer.concat(r,t)}t.toBuffer=a,t.json=async function(e){const t=(await a(e)).toString("utf8");try{return JSON.parse(t)}catch(e){const r=e;throw r.message+=` (input: ${t})`,r}},t.req=function(e,t={}){const r=(("string"==typeof e?e:e.href).startsWith("https:")?c:i).request(e,t),o=new Promise(((e,t)=>{r.once("response",e).once("error",t).end()}));return r.then=o.then.bind(o),r}},917:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t},i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Agent=void 0;const c=s(r(278)),a=s(r(611)),u=r(692);i(r(544),t);const p=Symbol("AgentBaseInternalState");class l extends a.Agent{constructor(e){super(e),this[p]={}}isSecureEndpoint(e){if(e){if("boolean"==typeof e.secureEndpoint)return e.secureEndpoint;if("string"==typeof e.protocol)return"https:"===e.protocol}const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some((e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:")))}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const t=new c.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||null===t)return;const r=this.sockets[e],o=r.indexOf(t);-1!==o&&(r.splice(o,1),this.totalSocketCount--,0===r.length&&delete this.sockets[e])}getName(e){return("boolean"==typeof e.secureEndpoint?e.secureEndpoint:this.isSecureEndpoint(e))?u.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){const o={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(o),s=this.incrementSockets(n);Promise.resolve().then((()=>this.connect(e,o))).then((i=>{if(this.decrementSockets(n,s),i instanceof a.Agent)return i.addRequest(e,o);this[p].currentSocket=i,super.createSocket(e,t,r)}),(e=>{this.decrementSockets(n,s),r(e)}))}createConnection(){const e=this[p].currentSocket;if(this[p].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[p].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(e){this[p]&&(this[p].defaultPort=e)}get protocol(){return this[p].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[p]&&(this[p].protocol=e)}}t.Agent=l},645:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpProxyAgent=void 0;const c=s(r(278)),a=s(r(756)),u=i(r(150)),p=r(434),l=r(917),f=r(16),h=(0,u.default)("http-proxy-agent");class d extends l.Agent{constructor(e,t){super(t),this.proxy="string"==typeof e?new f.URL(e):e,this.proxyHeaders=t?.headers??{},h("Creating new HttpProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={...t?y(t,"headers"):null,host:r,port:o}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){const{proxy:r}=this,o=`${t.secureEndpoint?"https:":"http:"}//${e.getHeader("host")||"localhost"}`,n=new f.URL(e.path,o);80!==t.port&&(n.port=String(t.port)),e.path=String(n);const s="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(s)){const r=s[t];r&&e.setHeader(t,r)}}async connect(e,t){let r,o,n;return e._header=null,e.path.includes("://")||this.setRequestProps(e,t),h("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(h("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,o=r.indexOf("\r\n\r\n")+4,e.outputData[0].data=e._header+r.substring(o),h("Output buffer: %o",e.outputData[0].data)),"https:"===this.proxy.protocol?(h("Creating `tls.Socket`: %o",this.connectOpts),n=a.connect(this.connectOpts)):(h("Creating `net.Socket`: %o",this.connectOpts),n=c.connect(this.connectOpts)),await(0,p.once)(n,"connect"),n}}function y(e,...t){const r={};let o;for(o in e)t.includes(o)||(r[o]=e[o]);return r}d.protocols=["http","https"],t.HttpProxyAgent=d},288:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpsProxyAgent=void 0;const c=s(r(278)),a=s(r(756)),u=i(r(613)),p=i(r(150)),l=r(917),f=r(16),h=r(868),d=(0,p.default)("https-proxy-agent");class y extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy="string"==typeof e?new f.URL(e):e,this.proxyHeaders=t?.headers??{},d("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?v(t,"headers"):null,host:r,port:o}}async connect(e,t){const{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let o;if("https:"===r.protocol){d("Creating `tls.Socket`: %o",this.connectOpts);const e=this.connectOpts.servername||this.connectOpts.host;o=a.connect({...this.connectOpts,servername:e})}else d("Creating `net.Socket`: %o",this.connectOpts),o=c.connect(this.connectOpts);const n="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=c.isIPv6(t.host)?`[${t.host}]`:t.host;let i=`CONNECT ${s}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}n.Host=`${s}:${t.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(n))i+=`${e}: ${n[e]}\r\n`;const p=(0,h.parseProxyResponse)(o);o.write(`${i}\r\n`);const{connect:l,buffered:f}=await p;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),200===l.statusCode){if(e.once("socket",g),t.secureEndpoint){d("Upgrading socket connection to TLS");const e=t.servername||t.host;return a.connect({...v(t,"host","path","port"),socket:o,servername:e})}return o}o.destroy();const y=new c.Socket({writable:!1});return y.readable=!0,e.once("socket",(e=>{d("Replaying proxy buffer for failed request"),(0,u.default)(e.listenerCount("data")>0),e.push(f),e.push(null)})),y}}function g(e){e.resume()}function v(e,...t){const r={};let o;for(o in e)t.includes(o)||(r[o]=e[o]);return r}y.protocols=["http","https"],t.HttpsProxyAgent=y},868:function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseProxyResponse=void 0;const n=(0,o(r(150)).default)("https-proxy-agent:parse-proxy-response");t.parseProxyResponse=function(e){return new Promise(((t,r)=>{let o=0;const s=[];function i(){const a=e.read();a?function(a){s.push(a),o+=a.length;const u=Buffer.concat(s,o),p=u.indexOf("\r\n\r\n");if(-1===p)return n("have not received end of HTTP headers yet..."),void i();const l=u.slice(0,p).toString("ascii").split("\r\n"),f=l.shift();if(!f)return e.destroy(),r(new Error("No header received from proxy CONNECT response"));const h=f.split(" "),d=+h[1],y=h.slice(2).join(" "),g={};for(const t of l){if(!t)continue;const o=t.indexOf(":");if(-1===o)return e.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${t}"`));const n=t.slice(0,o).toLowerCase(),s=t.slice(o+1).trimStart(),i=g[n];"string"==typeof i?g[n]=[i,s]:Array.isArray(i)?i.push(s):g[n]=s}n("got proxy server response: %o %o",f,g),c(),t({connect:{statusCode:d,statusText:y,headers:g},buffered:u})}(a):e.once("readable",i)}function c(){e.removeListener("end",a),e.removeListener("error",u),e.removeListener("readable",i)}function a(){c(),n("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function u(e){c(),n("onerror %o",e),r(e)}e.on("error",u),e.on("end",a),i()}))}},580:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.xhr=t.configure=void 0,t.getErrorStatusDescription=function(e){if(!(e<400))switch(e){case 400:return u.t("Bad request. The request cannot be fulfilled due to bad syntax.");case 401:return u.t("Unauthorized. The server is refusing to respond.");case 403:return u.t("Forbidden. The server is refusing to respond.");case 404:return u.t("Not Found. The requested location could not be found.");case 405:return u.t("Method not allowed. A request was made using a request method not supported by that location.");case 406:return u.t("Not Acceptable. The server can only generate a response that is not accepted by the client.");case 407:return u.t("Proxy Authentication Required. The client must first authenticate itself with the proxy.");case 408:return u.t("Request Timeout. The server timed out waiting for the request.");case 409:return u.t("Conflict. The request could not be completed because of a conflict in the request.");case 410:return u.t("Gone. The requested page is no longer available.");case 411:return u.t('Length Required. The "Content-Length" is not defined.');case 412:return u.t("Precondition Failed. The precondition given in the request evaluated to false by the server.");case 413:return u.t("Request Entity Too Large. The server will not accept the request, because the request entity is too large.");case 414:return u.t("Request-URI Too Long. The server will not accept the request, because the URL is too long.");case 415:return u.t("Unsupported Media Type. The server will not accept the request, because the media type is not supported.");case 500:return u.t("Internal Server Error.");case 501:return u.t("Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request.");case 502:return u.t("Bad Gateway. The upstream server did not respond.");case 503:return u.t("Service Unavailable. The server is currently unavailable (overloaded or down).");default:return u.t("HTTP status code {0}",e)}};var i=r(611),c=r(692),a=r(16),u=r(747),p=r(106),l=r(645),f=r(288),h=void 0,d=!0;function y(e){var t;return new Promise((function(r,o){var n=(0,a.parse)(e.url),s={hostname:n.hostname,agent:!!e.agent&&e.agent,port:n.port?parseInt(n.port):"https:"===n.protocol?443:80,path:n.path,method:e.type||"GET",headers:e.headers,rejectUnauthorized:"boolean"!=typeof e.strictSSL||e.strictSSL};e.user&&e.password&&(s.auth=e.user+":"+e.password);var u=function(o){if(o.statusCode>=300&&o.statusCode<400&&e.followRedirects&&e.followRedirects>0&&o.headers.location){var s=o.headers.location;s.startsWith("/")&&(s=(0,a.format)({protocol:n.protocol,hostname:n.hostname,port:n.port,pathname:s})),r(y(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach((function(t){return Object.keys(t).forEach((function(r){return e[r]=t[r]}))})),e}({},e,{url:s,followRedirects:e.followRedirects-1})))}else r({req:t,res:o})};(t="https:"===n.protocol?c.request(s,u):i.request(s,u)).on("error",o),e.timeout&&t.setTimeout(e.timeout),e.data&&t.write(e.data),t.end(),e.token&&(e.token.isCancellationRequested&&t.destroy(new g),e.token.onCancellationRequested((function(){t.destroy(new g)})))}))}t.configure=function(e,t){h=e,d=t},t.xhr=function(e){return"boolean"!=typeof(e=s({},e)).strictSSL&&(e.strictSSL=d),e.agent||(e.agent=function(e,t){var r;void 0===t&&(t={});var o=(0,a.parse)(e),n=t.proxyUrl||function(e){return"http:"===e.protocol?process.env.HTTP_PROXY||process.env.http_proxy||null:"https:"===e.protocol&&(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy)||null}(o);return n&&/^https?:/.test(n)?"http:"===o.protocol?new l.HttpProxyAgent(n):new f.HttpsProxyAgent(n,{rejectUnauthorized:null===(r=t.strictSSL)||void 0===r||r}):null}(e.url,{proxyUrl:h,strictSSL:d})),"number"!=typeof e.followRedirects&&(e.followRedirects=5),y(e).then((function(r){return new Promise((function(o,n){var s,i,c=r.res,l=c,f=!1,h=c.headers&&c.headers["content-encoding"];if(h&&(s=e.type,i=r.res.statusCode,!("HEAD"===s||i>=100&&i<200||204===i||304===i))){var d={flush:p.constants.Z_SYNC_FLUSH,finishFlush:p.constants.Z_SYNC_FLUSH};if("gzip"===h){var y=p.createGunzip(d);c.pipe(y),l=y}else if("deflate"===h){var v=p.createInflate(d);c.pipe(v),l=v}}var b=[];l.on("data",(function(e){return b.push(e)})),l.on("end",(function(){if(!f){if(f=!0,e.followRedirects>0&&(c.statusCode>=300&&c.statusCode<=303||307===c.statusCode)){var r=c.headers.location;if(r.startsWith("/")){var s=(0,a.parse)(e.url);r=(0,a.format)({protocol:s.protocol,hostname:s.hostname,port:s.port,pathname:r})}if(r){var i={type:e.type,url:r,user:e.user,password:e.password,headers:e.headers,timeout:e.timeout,followRedirects:e.followRedirects-1,data:e.data,token:e.token};return void(0,t.xhr)(i).then(o,n)}}var u=Buffer.concat(b),p={responseText:u.toString(),body:u,status:c.statusCode,headers:c.headers||{}};c.statusCode>=200&&c.statusCode<300||1223===c.statusCode?o(p):n(p)}})),l.on("error",(function(t){var r;r=g.is(t)?t:{responseText:u.t("Unable to access {0}. Error: {1}",e.url,t.message),body:Buffer.concat(b),status:500,headers:{}},f=!0,n(r)})),e.token&&(e.token.isCancellationRequested&&l.destroy(new g),e.token.onCancellationRequested((function(){l.destroy(new g)})))}))}),(function(t){var r;return r=g.is(t)?t:{responseText:e.agent?u.t("Unable to connect to {0} through a proxy. Error: {1}",e.url,t.message):u.t("Unable to connect to {0}. Error: {1}",e.url,t.message),body:Buffer.concat([]),status:404,headers:{}},Promise.reject(r)}))};var g=function(e){function t(){var r=e.call(this,"The user aborted a request")||this;return r.name="AbortError",Object.setPrototypeOf(r,t.prototype),r}return n(t,e),t.is=function(e){return e instanceof t},t}(Error)},150:(e,t)=>{function r(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r}},613:e=>{"use strict";e.exports=require("assert")},434:e=>{"use strict";e.exports=require("events")},896:e=>{"use strict";e.exports=require("fs")},943:e=>{"use strict";e.exports=require("fs/promises")},611:e=>{"use strict";e.exports=require("http")},692:e=>{"use strict";e.exports=require("https")},278:e=>{"use strict";e.exports=require("net")},756:e=>{"use strict";e.exports=require("tls")},16:e=>{"use strict";e.exports=require("url")},106:e=>{"use strict";e.exports=require("zlib")}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,r),s.exports}(580),o=exports;for(var n in r)o[n]=r[n];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); |
{ | ||
"name": "request-light", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Lightweight request library. Promise based, with proxy support.", | ||
@@ -10,2 +10,9 @@ "main": "./lib/node/main.js", | ||
"typings": "./api", | ||
"exports": { | ||
".": { | ||
"types": "./api.d.ts", | ||
"browser": "./lib/browser/main.js", | ||
"default": "./lib/node/main.js" | ||
} | ||
}, | ||
"author": "Microsoft Corporation", | ||
@@ -21,14 +28,14 @@ "repository": { | ||
"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" | ||
"http-proxy-agent": "^7.0.2", | ||
"https-proxy-agent": "^7.0.5", | ||
"@vscode/l10n": "^0.0.18", | ||
"typescript": "^5.5.2", | ||
"@types/node": "18.x", | ||
"vscode-jsonrpc": "^8.2.1", | ||
"rimraf": "^5.0.7", | ||
"ts-loader": "^9.5.1", | ||
"webpack": "^5.92.1", | ||
"webpack-cli": "^5.1.4", | ||
"ava": "^6.1.3", | ||
"proxy": "^2.2.0" | ||
}, | ||
@@ -35,0 +42,0 @@ "scripts": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
9
8
31942
7