12/**3* BuildDSN builds a MySQL data source name (DSN) from the given options.4* @example5* ```javascript6* const mysql = require('nuclei/mysql');7* const options = new mysql.MySQLOptions();8* options.Host = 'acme.com';9* options.Port = 3306;10* const dsn = mysql.BuildDSN(options);11* ```12*/13export function BuildDSN(opts: MySQLOptions): string | null {14return null;15}16171819/**20* MySQLClient is a client for MySQL database.21* Internally client uses go-sql-driver/mysql driver.22* @example23* ```javascript24* const mysql = require('nuclei/mysql');25* const client = new mysql.MySQLClient;26* ```27*/28export class MySQLClient {293031// Constructor of MySQLClient32constructor() {}33/**34* IsMySQL checks if the given host is running MySQL database.35* If the host is running MySQL database, it returns true.36* If the host is not running MySQL database, it returns false.37* @example38* ```javascript39* const mysql = require('nuclei/mysql');40* const isMySQL = mysql.IsMySQL('acme.com', 3306);41* ```42*/43public IsMySQL(host: string, port: number): boolean | null {44return null;45}464748/**49* Connect connects to MySQL database using given credentials.50* If connection is successful, it returns true.51* If connection is unsuccessful, it returns false and error.52* The connection is closed after the function returns.53* @example54* ```javascript55* const mysql = require('nuclei/mysql');56* const client = new mysql.MySQLClient;57* const connected = client.Connect('acme.com', 3306, 'username', 'password');58* ```59*/60public Connect(host: string, port: number, username: string): boolean | null {61return null;62}636465/**66* returns MySQLInfo when fingerpint is successful67* @example68* ```javascript69* const mysql = require('nuclei/mysql');70* const info = mysql.FingerprintMySQL('acme.com', 3306);71* log(to_json(info));72* ```73*/74public FingerprintMySQL(host: string, port: number): MySQLInfo | null {75return null;76}777879/**80* ConnectWithDSN connects to MySQL database using given DSN.81* we override mysql dialer with fastdialer so it respects network policy82* If connection is successful, it returns true.83* @example84* ```javascript85* const mysql = require('nuclei/mysql');86* const client = new mysql.MySQLClient;87* const connected = client.ConnectWithDSN('username:password@tcp(acme.com:3306)/');88* ```89*/90public ConnectWithDSN(dsn: string): boolean | null {91return null;92}939495/**96* ExecuteQueryWithOpts connects to Mysql database using given credentials97* and executes a query on the db.98* @example99* ```javascript100* const mysql = require('nuclei/mysql');101* const options = new mysql.MySQLOptions();102* options.Host = 'acme.com';103* options.Port = 3306;104* const result = mysql.ExecuteQueryWithOpts(options, 'SELECT * FROM users');105* log(to_json(result));106* ```107*/108public ExecuteQueryWithOpts(opts: MySQLOptions, query: string): SQLResult | null | null {109return null;110}111112113/**114* ExecuteQuery connects to Mysql database using given credentials115* and executes a query on the db.116* @example117* ```javascript118* const mysql = require('nuclei/mysql');119* const result = mysql.ExecuteQuery('acme.com', 3306, 'username', 'password', 'SELECT * FROM users');120* log(to_json(result));121* ```122*/123public ExecuteQuery(host: string, port: number, username: string): SQLResult | null | null {124return null;125}126127128/**129* ExecuteQuery connects to Mysql database using given credentials130* and executes a query on the db.131* @example132* ```javascript133* const mysql = require('nuclei/mysql');134* const result = mysql.ExecuteQueryOnDB('acme.com', 3306, 'username', 'password', 'dbname', 'SELECT * FROM users');135* log(to_json(result));136* ```137*/138public ExecuteQueryOnDB(host: string, port: number, username: string): SQLResult | null | null {139return null;140}141142143}144145146147/**148* MySQLInfo contains information about MySQL server.149* this is returned when fingerprint is successful150*/151export interface MySQLInfo {152153Host?: string,154155IP?: string,156157Port?: number,158159Protocol?: string,160161TLS?: boolean,162163Transport?: string,164165Version?: string,166167Debug?: ServiceMySQL,168169Raw?: string,170}171172173174/**175* MySQLOptions defines the data source name (DSN) options required to connect to a MySQL database.176* along with other options like Timeout etc177* @example178* ```javascript179* const mysql = require('nuclei/mysql');180* const options = new mysql.MySQLOptions();181* options.Host = 'acme.com';182* options.Port = 3306;183* ```184*/185export interface MySQLOptions {186187Host?: string,188189Port?: number,190191Protocol?: string,192193Username?: string,194195Password?: string,196197DbName?: string,198199RawQuery?: string,200201Timeout?: number,202}203204205206/**207* SQLResult Interface208*/209export interface SQLResult {210211Count?: number,212213Columns?: string[],214}215216217218/**219* ServiceMySQL Interface220*/221export interface ServiceMySQL {222223PacketType?: string,224225ErrorMessage?: string,226227ErrorCode?: number,228}229230231232