Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const Promise = require('bluebird');
const Queue = require('promise-queue'); Queue.configure(Promise);
const debug = require('debug')('nefit-easy-core');
const rawDebug = require('debug')('nefit-easy-core:raw');
const HTTPParser = require('http-string-parser');
const XMPPClient = require('node-xmpp-client');
const Stanza = XMPPClient.Stanza;
const Encryption = require('./encryption');
const SCRAM = require('./scram-auth-mechanism');
// Default options for XMPP
const DEFAULT_OPTIONS = {
host : 'wa2-mz36-qrmzh6.bosch.de',
saslMechanism : 'SCRAM-SHA-1',
pingInterval : 30 * 1000,
maxRetries : 15,
retryTimeout : 2000,
};// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
const
Queue = require('promise-queue'),
child_process = require('child_process'),
FromConfig = require('./cache/from-config'),
BaseCache = require('./cache/base'),
logger = require('./logger').logger,
_ = require('underscore'),
fs = require('fs-extra'),
Sentry = require('@sentry/node');
Queue.configure(Promise);
class CompilationEnvironment {
constructor(compilerProps, doCache) {
this.ceProps = compilerProps.ceProps;
this.compilerProps = compilerProps.get.bind(compilerProps);
this.okOptions = new RegExp(this.ceProps('optionsWhitelistRe', '.*'));
this.badOptions = new RegExp(this.ceProps('optionsBlacklistRe', '(?!)'));
this.cache = FromConfig.create(doCache === undefined || doCache ? this.ceProps('cacheConfig', '') : "");
this.executableCache = FromConfig.create(
doCache === undefined || doCache ? this.ceProps('executableCacheConfig', '') : "");
this.compilerCache = FromConfig.create(
doCache === undefined || doCache ? this.ceProps('compilerCacheConfig', '') : "");
this.compileQueue = new Queue(this.ceProps("maxConcurrentCompiles", 1), Infinity);
this.reportCacheEvery = this.ceProps("cacheReportEvery", 100);
this.multiarch = null;
try {const chalk = require('chalk');
const _ = require('lodash');
const userStats = require('../../../utils/userStats');
const naming = require('../lib/naming.js');
const https = require('https');
const fs = require('fs');
const objectHash = require('object-hash');
const PromiseQueue = require('promise-queue');
const getS3EndpointForRegion = require('../utils/getS3EndpointForRegion');
const readline = require('readline');
const constants = {
providerName: 'aws',
};
PromiseQueue.configure(BbPromise.Promise);
const impl = {
/**
* Determine whether the given credentials are valid. It turned out that detecting invalid
* credentials was more difficult than detecting the positive cases we know about. Hooray for
* whak-a-mole!
* @param credentials The credentials to test for validity
* @return {boolean} Whether the given credentials were valid
*/
validCredentials: credentials => {
let result = false;
if (credentials) {
if (
// valid credentials loaded
(credentials.accessKeyId &&
credentials.accessKeyId !== 'undefined' &&* @callback IteratorCallback
* @param {?Error} err - An error if the iterator encountered one
* @param {IteratorData} [data] - New data from the iterator
* @returns {void}
*/
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
var querystring = require('querystring'),
Promise = require('bluebird'),
PromiseQueue = require('promise-queue'),
errors = require('./errors');
PromiseQueue.configure(Promise);
// -----------------------------------------------------------------------------
// Private
// -----------------------------------------------------------------------------
const PAGING_MODES = Object.freeze({
MARKER: 'marker',
OFFSET: 'offset'
});
// -----------------------------------------------------------------------------
// Public
// -----------------------------------------------------------------------------
/**
* Asynchronous iterator for paged collectionsvar Queue = require('promise-queue');
var program = require('commander');
var RepoSync = require('./reposync');
var db = require('./db');
// set promise
Queue.configure(require('bluebird'));
var queue = new Queue(1, 1000);
function startRepoSync() {
const config = require('./config.json');
for (let repoSyncOptions of config.repos) {
const rs = new RepoSync(repoSyncOptions, queue);
rs.start();
}
}
program
.version('0.0.1')
.command('start')
.action(startRepoSync);var Nightmare = require('nightmare'),
Promise = require('bluebird'),
Queue = require('promise-queue'),
express = require('express'),
bodyParser = require('body-parser'),
uuid = require('node-uuid'),
fs = require('fs'),
config = require('./config.json');
// Set promise-queue to use
// bluebird's promises.
Queue.configure(Promise);
var port = process.env.PORT || config.port,
timeout = process.env.TIMEOUT || config.timeout,
concurrency = process.env.CONCURRENCY || config.concurrency,
nightmares = Array(concurrency).fill().map(function() { return Nightmare(); }),
queue = new Queue(concurrency, Infinity),
server = express();
// Create the rendering engine for a new render call
function render(data) {
var id = uuid.v4(),
output = '/tmp/' + id + '.pdf',
router = express.Router(),
nightmare = nightmares.pop(), // Get ourselves a nightmare worker
deferred;const _ = require('lodash')
const Promise = require('bluebird')
const Queue = require('promise-queue')
const { client } = require('./irc')
const events = require('./events')
Queue.configure(Promise)
const eventQueue = new Queue(1, Infinity)
const eventMap = {
debug: events.onDebug,
close: events.onClose,
connecting: events.onConnecting,
reconnecting: events.onReconnecting,
registered: events.onRegistered,
join: events.onJoin,
quit: events.onQuit,
part: events.onPart,
kick: events.onKick,
nick: events.onNick,
userlist: events.onUserList,
mode: events.onMode,var path = require('path');
var chalk = require('chalk');
var tempfile = require('tempfile');
var Promise = require('bluebird');
var spawn = require('child_process').spawn;
var Queue = require('promise-queue');
var FilterStream = require('streamfilter');
var fs = require('../util/fs');
var DiskCache = require('../DiskCache');
Queue.configure(Promise);
var exec = Promise.promisify(require('child_process').exec);
var COMPRESS_EXTS = {
'.png': true,
'.jpg': true,
'.gif': true
};
var CACHE_FILENAME = 'image-compress';
var loggedWarning = false;
exports.create = function (api, app, config) {
var logger = api.logging.get('image-compress');var Promise = require('bluebird');
var fs = require('fs');
var os = require('os');
var mkdirp = require('mkdirp');
var jsonio = require('./json-io.js');
var lineReader = require('reverse-line-reader');
var Queue = require('promise-queue');
Queue.configure(Promise);
function AccountHistory(account, web3Connector, onChange) {
this.web3Connector = web3Connector;
this.onChange = onChange || function() {};
this.web3 = web3Connector.getWeb3();
this.account = account;
this.workAbi = web3Connector.getWorkAbi();
this.licenseAbi = web3Connector.getLicenseAbi();
this.loggerAbi = web3Connector.getLoggerAbi();
this.loggerAddress = web3Connector.getLoggerAddress();
this.indexDir = os.homedir() + "/.musicoin/accounts/" + account + "/";
this.indexName = this.indexDir + "history-status.json";
this.logName = this.indexDir + "transactions.json";
this.eventFilter = {stopWatching: function(){}};
this.historyIndex = { lastBlock: 0 };
this.queue = new Queue(1, Infinity);