Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(settings){
super();
//console.log(">> HFCSDKConnector");
Connector.call(this, 'hfc-sdk', settings);
this.settings = settings; // Store the settings for ease of access
Common.validateSettings(this.settings);
//logger.info("Info output test");
//logger.debug("Debugging output test");
//logger.error("Error output test");
};
function CouchDB(name, settings, ds) {
// Injection for tests
this.CouchDBDriver = settings.Driver || Driver;
debug('CouchDB constructor settings: %j', settings);
Connector.call(this, name, settings);
this.debug = settings.debug || debug.enabled;
this.dataSource = ds;
if (!settings.url && (!settings.username || !settings.password)) {
throw new Error(g.f('Invalid settings: "url" OR "username"' +
' AND "password" required'));
}
this.options = _.merge({}, settings);
// If settings.url is not set, then setup account/password props.
if (!this.options.url) {
this.options.account = settings.username;
this.options.password = settings.password;
}
this.pool = {};
};
function CouchbaseDB(settings, dataSource) {
this.name = 'couchbase';
this._models = {};
this.settings = settings;
this.dataSource = dataSource;
Connector.call(this, 'couchbase', settings);
}
function KeyValueMemoryConnector(settings, dataSource) {
Connector.call(this, 'kv-memory', settings);
debug('Connector settings', settings);
this.dataSource = dataSource;
this.DataAccessObject = dataSource.juggler.KeyValueAccessObject;
this._store = Object.create(null);
this._setupRegularCleanup();
}
util.inherits(KeyValueMemoryConnector, Connector);
function MongoDB(settings, dataSource) {
Connector.call(this, 'mongodb', settings);
this.debug = settings.debug || debug.enabled;
if (this.debug) {
debug('Settings: %j', settings);
}
this.dataSource = dataSource;
if (
this.settings.enableOptimisedfindOrCreate === true ||
this.settings.enableOptimisedFindOrCreate === true ||
this.settings.enableOptimizedfindOrCreate === true ||
this.settings.enableOptimizedFindOrCreate === true
) {
MongoDB.prototype.findOrCreate = optimizedFindOrCreate;
function MongoDB(settings, dataSource) {
Connector.call(this, 'mongodb', settings);
this.debug = settings.debug || debug.enabled;
if (this.debug) {
debug('Settings: %j', settings);
}
this.dataSource = dataSource;
if (this.settings.enableOptimisedfindOrCreate === true ||
this.settings.enableOptimisedFindOrCreate === true ||
this.settings.enableOptimizedfindOrCreate === true ||
this.settings.enableOptimizedFindOrCreate === true) {
MongoDB.prototype.findOrCreate = optimizedFindOrCreate;
}
if (this.settings.enableGeoIndexing === true) {
MongoDB.prototype.buildNearFilter = buildNearFilter;