<commit_before>var request = require("request");
var scm = require("./lib/scm");
var command = require("./lib/command");
var vfs = require("./lib/vfs");
var zip = require("./lib/zip");
var deployment = require("./lib/deployment");
var sshkey = require("./lib/sshkey");
var environment = require("./lib/environment");
var settings = require("./lib/settings");
var dump = require("./lib/dump");
var diagnostics = require("./lib/diagnostics");
var logs = require("./lib/logs");
var extensions = require("./lib/extensions");

module.exports = function api(options) {
    //options: website, username, password, basic (hashed)
    var website = options.website,
        headers = {};
    if(options.username && options.password){
        headers.Authorization =  "Basic " +
            new Buffer(options.username + ":" + options.password)
            .toString("base64");
    }

    if(options.basic){
      headers.Authorization =  "Basic " + options.basic;
    }

    var r = request.defaults({
        baseUrl: "https://" + website + ".scm.azurewebsites.net/",
        headers: headers,
    });
    return {
        scm: scm(r),
        command: command(r),
        vfs: vfs(r),
        zip: zip(r),<commit_msg>Add backwards compat for old construction signature<commit_after>var request = require("request");
var scm = require("./lib/scm");
var command = require("./lib/command");
var vfs = require("./lib/vfs");
var zip = require("./lib/zip");
var deployment = require("./lib/deployment");
var sshkey = require("./lib/sshkey");
var environment = require("./lib/environment");
var settings = require("./lib/settings");
var dump = require("./lib/dump");
var diagnostics = require("./lib/diagnostics");
var logs = require("./lib/logs");
var extensions = require("./lib/extensions");

module.exports = function api(options) {
    // Backward compat for old method signature
    if (typeof options === "string") {
        options = {
            website: options,
            username: arguments[1],
            password: arguments[2]
        };
    }

    //options: website, username, password, basic (hashed)
    var website = options.website,
        headers = {};

    if(options.username && options.password){
        headers.Authorization =  "Basic " +
            new Buffer(options.username + ":" + options.password)
            .toString("base64");
    }

    if(options.basic){
      headers.Authorization =  "Basic " + options.basic;
    }

    var r = request.defaults({
        baseUrl: "https://" + website + ".scm.azurewebsites.net/",
        headers: headers,
    });
    return {
        scm: scm(r),
        command: command(r),
        vfs: vfs(r),
        zip: zip(r),
{'fraction_non_alphanumeric': 0.1713221601489758, 'fraction_numerical': 0.0022346368715083797, 'mean_word_length': 2.767180925666199, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3881337', 'n_tokens_mistral': 787, 'n_tokens_neox': 772, 'n_words': 186}