Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(githubRepo, githubTokenOfCI) {
this.githubRepo = githubRepo;
this.request = req.defaults({
headers: {
"User-Agent": "AutoRest CI",
"Authorization": "token " + githubTokenOfCI
}
});
}
constructor(username, password, log) {
this.username = username;
this.password = password;
this.lastLogin = new Date(1970, 1, 1);
this.lastUpdate = new Date(1970, 1, 1);
this.thermostats = new Map();
this.session = rp.defaults({ gzip:true, jar:true });
this.log = log;
this.lock = new Lock();
}
var setRequestOptions = function (options = {}) {
options = Object.assign({
gzip: true,
resolveWithFullResponse: true,
}, options);
options.headers = Object.assign({
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'
}, options.headers);
request = require('request-promise-native').defaults(options);
};
async function connect (opts) {
opts = defaults(opts);
validate(opts);
if (opts.authtoken) {
await setAuthtoken(opts);
}
processUrl = await getProcess(opts);
internalApi = request.defaults({baseUrl: processUrl});
return connectRetry(opts);
}
constructor() {
this.req = request.defaults({
headers: {
'user-agent': `NONISV|SharePointPnP|Office365CLI/${packageJSON.version}`
},
gzip: true
});
}