404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.217.69.43: ~ $
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = exports.createRequest = exports.PROXY_ENVIRONMENT_VARIABLES = void 0;
const utils_array_1 = require("@ionic/utils-array");
const utils_fs_1 = require("@ionic/utils-fs");
const Debug = require("debug");
const debug = Debug('ionic:lib:utils:http');
exports.PROXY_ENVIRONMENT_VARIABLES = ['IONIC_HTTP_PROXY', 'HTTPS_PROXY', 'HTTP_PROXY', 'PROXY', 'https_proxy', 'http_proxy', 'proxy'];
function getGlobalProxy() {
    for (const envvar of exports.PROXY_ENVIRONMENT_VARIABLES) {
        const envval = process.env[envvar];
        if (envval) {
            return { envval, envvar };
        }
    }
}
async function createRequest(method, url, { userAgent, proxy, ssl }) {
    const superagent = await Promise.resolve().then(() => require('superagent'));
    if (!proxy) {
        const gproxy = getGlobalProxy();
        if (gproxy) {
            proxy = gproxy.envval;
        }
    }
    const req = superagent(method, url);
    req
        .set('User-Agent', userAgent)
        .redirects(25);
    if (proxy) {
        const superagentProxy = await Promise.resolve().then(() => require('superagent-proxy'));
        superagentProxy(superagent);
        if (req.proxy) {
            req.proxy(proxy);
        }
        else {
            debug(`Cannot install proxy--req.proxy not defined`);
        }
    }
    if (ssl) {
        const cafiles = utils_array_1.conform(ssl.cafile);
        const certfiles = utils_array_1.conform(ssl.certfile);
        const keyfiles = utils_array_1.conform(ssl.keyfile);
        if (cafiles.length > 0) {
            req.ca(await Promise.all(cafiles.map(p => utils_fs_1.readFile(p, { encoding: 'utf8' }))));
        }
        if (certfiles.length > 0) {
            req.cert(await Promise.all(certfiles.map(p => utils_fs_1.readFile(p, { encoding: 'utf8' }))));
        }
        if (keyfiles.length > 0) {
            req.key(await Promise.all(keyfiles.map(p => utils_fs_1.readFile(p, { encoding: 'utf8' }))));
        }
    }
    return { req };
}
exports.createRequest = createRequest;
/**
 * Initiate a request, downloading the contents to a writable stream.
 *
 * @param req The request to download to the writable stream.
 * @param ws Must be a dedicated writable stream that calls the 'close' event.
 */
async function download(req, ws, { progress }) {
    return new Promise((resolve, reject) => {
        req
            .on('response', res => {
            if (res.status !== 200) {
                reject(new Error(`Encountered bad status code (${res.status}) for ${req.url}\n` +
                    `This could mean the server is experiencing difficulties right now--please try again later.`));
            }
            if (progress) {
                let loaded = 0;
                const total = Number(res.header['content-length']);
                res.on('data', chunk => {
                    loaded += chunk.length;
                    progress(loaded, total);
                });
            }
        })
            .on('error', err => {
            if (err.code === 'ECONNABORTED') {
                reject(new Error(`Timeout of ${err.timeout}ms reached for ${req.url}`));
            }
            else {
                reject(err);
            }
        });
        ws.on('close', resolve);
        req.pipe(ws);
    });
}
exports.download = download;

Filemanager

Name Type Size Permission Actions
archive.d.ts File 44 B 0644
archive.js File 146 B 0644
color.d.ts File 572 B 0644
color.js File 5.18 KB 0644
emoji.d.ts File 68 B 0644
emoji.js File 310 B 0644
file.d.ts File 204 B 0644
file.js File 708 B 0644
http.d.ts File 810 B 0644
http.js File 3.33 KB 0644
logger.d.ts File 707 B 0644
logger.js File 1.64 KB 0644
npm.d.ts File 991 B 0644
npm.js File 4.86 KB 0644
uuid.d.ts File 91 B 0644
uuid.js File 490 B 0644