/**
Copyright: 2024 Contrast Security, Inc
  Contact: support@contrastsecurity.com
  License: Commercial

  NOTICE: This Software and the patented inventions embodied within may only be
  used as part of Contrast Security’s commercial offerings. Even though it is
  made available through public repositories, use of this Software is subject to
  the applicable End User Licensing Agreement found at
  https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
  between Contrast Security and the End User. The Software may not be reverse
  engineered, modified, repackaged, sold, redistributed or otherwise used in a
  way not consistent with the End User License Agreement.
*/
/**
 * @module /lib/protect/sinks
 */

'use strict';

const ModuleHook = require('../../hooks/require');

const EvalSink = require('./eval');
const FunctionSink = require('./function');
const ChildProcessSink = require('./child-process');
const FSSink = require('./fs');
const LibXMLSink = require('./libxmljs');
const MongoDBSink = require('./mongodb');
const MySQLSink = require('./mysql');
const NodeSerializeSink = require('./node-serialize');
const PostgresSink = require('./postgres');
const RethinkDBSink = require('./rethinkdb');
const SequelizeSink = require('./sequelize');
const Sqlite3Sink = require('./sqlite3');
const VMSink = require('./vm');

module.exports = function init(agent) {
  // Language Sinks
  new EvalSink(agent).install();
  new FunctionSink(agent).install();

  // Module Sinks
  new ChildProcessSink(agent).install({ ModuleHook });
  new FSSink(agent).install({ ModuleHook });
  new LibXMLSink(agent).install({ ModuleHook });
  new MongoDBSink(agent).install({ ModuleHook });
  new MySQLSink(agent).install({ ModuleHook });
  new NodeSerializeSink(agent).install({ ModuleHook });
  new PostgresSink(agent).install({ ModuleHook });
  new RethinkDBSink(agent).install({ ModuleHook });
  new SequelizeSink(agent).install({ ModuleHook });
  new VMSink(agent).install({ ModuleHook });
  new Sqlite3Sink(agent).install({ ModuleHook });
};
