diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..d23208f --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 0000000..541945b --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..58834d0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + {} + { + "isMigrated": true +} + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..77f0800 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/node-informixdb.iml b/.idea/node-informixdb.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/node-informixdb.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.zip b/build.zip deleted file mode 100644 index 010c137..0000000 Binary files a/build.zip and /dev/null differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..7bfe9da --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,14 @@ +const pluginJs = require("@eslint/js"); +const globals = require("globals") + +/** @type {import('eslint').Linter.Config[]} */ +module.exports = [{ + files: ["**/*.js"], languageOptions: {sourceType: "commonjs"} +}, { + languageOptions: {globals: globals.node} +}, pluginJs.configs.recommended, { + rules: { + 'no-unused-vars': 'off', + 'no-empty': 'off' + } +}]; diff --git a/examples/SampleApp1.js b/examples/SampleApp1.js index f7c766b..333c30f 100644 --- a/examples/SampleApp1.js +++ b/examples/SampleApp1.js @@ -41,7 +41,7 @@ function DoSomeWork(err, conn) var rows = conn.querySync("SELECT * FROM t1"); console.log(); console.log(rows); -}; +} var MyAsynchronousTask = function (err, conn) diff --git a/examples/SampleApp2.js b/examples/SampleApp2.js index d38b484..4baa4cf 100644 --- a/examples/SampleApp2.js +++ b/examples/SampleApp2.js @@ -7,7 +7,7 @@ function DirExec( conn, ErrIgn, sql ) var result = conn.querySync( sql ); console.log( sql ); } - catch (e) + catch (e) { console.log( "--- " + sql ); if( ErrIgn != 1 ) @@ -124,11 +124,11 @@ function DoSomePrepareExec(conn) function DoSomeWork(err, conn) { - if (err) + if (err) { return console.log(err); } - + DirExec( conn, 1, "drop table t1" ); DirExec( conn, 0, "create table t1 ( c1 int, c2 char(20) ) " ); DirExec( conn, 0, "insert into t1 values( 1, 'val-1' )" ); @@ -143,8 +143,8 @@ function DoSomeWork(err, conn) /* //var stmt = conn.prepareSync("insert into t1 (c1, c2) VALUES (?, ?)"); //Bind and Execute the statment asynchronously - stmt.execute([ 6, 'BindVal-6'], - function (err, result) + stmt.execute([ 6, 'BindVal-6'], + function (err, result) { result.closeSync(); @@ -157,7 +157,7 @@ function DoSomeWork(err, conn) var rows = conn.querySync( "SELECT * FROM t1" ); console.log(); console.log(rows); -}; +} var MyAsynchronousTask = function (err, conn) @@ -181,38 +181,38 @@ function informixdb_OpenSync(ConStr) console.log(); console.log(" --- Executing informixdb.openSync() ...." ); var conn; - try + try { conn = dbobj.openSync(ConStr); } - catch(e) + catch(e) { console.log(e); return; } - + DoSomeWork(0, conn); - - try + + try { //dbobj.closeSync(); conn.closeSync(); } - catch(e) + catch(e) { console.log(e); } console.log(" --- End informixdb.openSync()" ); } -function main_func() +function main_func() { //// Make sure the port is IDS SQLI port. var ConnectionString = "SERVER=ids0;DATABASE=db1;HOST=127.0.0.1;SERVICE=9088;PROTOCOL=onsoctcp;UID=informix;PWD=xxxx;"; - //Synchronous Execution + //Synchronous Execution informixdb_OpenSync(ConnectionString); - + //Asynchronous Execution //informixdb_Open(ConnectionString); } diff --git a/installer/driverInstall.js b/installer/driverInstall.js index 6f80c5d..9142173 100644 --- a/installer/driverInstall.js +++ b/installer/driverInstall.js @@ -20,27 +20,24 @@ /** * Node-informixdb Installer file. */ - -var fs = require('fs'); -var os = require('os'); -var path = require('path'); -var exec = require('child_process').exec; -var execSync = require('child_process').execSync; -var url = require('url'); -var request = require('request'); -var unzipper = require('unzipper'); - -var platform = os.platform(); -var CURRENT_DIR = process.cwd(); -var DOWNLOAD_DIR = path.resolve(CURRENT_DIR, 'installer'); -var INSTALLER_FILE; -var BUILD_FILE; -var deleteInstallerFile = false; -var arch = os.arch(); - -var vscode_build = false; -var readStream; -var writeStream; +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const exec = require('node:child_process').exec; +const execSync = require('node:child_process').execSync; +const url = require('node:url'); +const axios = require('axios').default; + +let platform = os.platform(); +const CURRENT_DIR = process.cwd(); +const DOWNLOAD_DIR = path.resolve(CURRENT_DIR, 'installer'); +let INSTALLER_FILE; +let BUILD_FILE; +let deleteInstallerFile = false; +const arch = os.arch(); + +const vscode_build = false; +let readStream; /* * "process.env.CSDK_INSTALLER_URL" @@ -50,21 +47,23 @@ var writeStream; * You can add CSDK_INSTALLER_URL in .npmrc file too. */ //URL for downloading Informix ODBC/CLI driver. -var installerURL = 'https://hcl-onedb.github.io/odbc'; -var license_agreement = '\n\n****************************************\nYou are downloading a package which includes the Node.js module for HCL/IBM Informix. The module is licensed under the Apache License 2.0. Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device.\n****************************************\n'; -installerURL = process.env.npm_config_CSDK_INSTALLER_URL || - process.env.CSDK_INSTALLER_URL || installerURL; +let installerURL = 'https://hcl-onedb.github.io/odbc'; +const license_agreement = '\n\n****************************************\nYou are downloading a package which includes the Node.js module for HCL/IBM Informix. The module is licensed under the Apache License 2.0. Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device.\n****************************************\n'; +installerURL = process.env.npm_config_CSDK_INSTALLER_URL || process.env.CSDK_INSTALLER_URL || installerURL; installerURL = installerURL + "/"; -var CSDK_HOME, CSDK_INCLUDE, CSDK_LIB; +let CSDK_HOME, CSDK_INCLUDE, CSDK_LIB; -InstallNodeInformixDB(); +InstallNodeInformixDB().catch((err) => { + console.error(err); + process.exit(1); +}); // Function to download and install node-informixdb -function InstallNodeInformixDB() { +async function InstallNodeInformixDB() { checkDriverCompatibilityForOSAndNodejsVersion(); - var installerfileURL; + let installerfileURL; /* * Installer steps: Generic for all platforms : @@ -83,8 +82,8 @@ function InstallNodeInformixDB() { */ //If building for supporting VSCode Extn, then remove onedb-odbc-driver folder and get it freshly - if(vscode_build && fs.existsSync(path.join(DOWNLOAD_DIR,'onedb-odbc-driver'))){ - deleteFolderRecursive(path.join(DOWNLOAD_DIR,'onedb-odbc-driver')) + if (vscode_build && fs.existsSync(path.join(DOWNLOAD_DIR, 'onedb-odbc-driver'))) { + deleteFolderRecursive(path.join(DOWNLOAD_DIR, 'onedb-odbc-driver')) } /* @@ -98,109 +97,77 @@ function InstallNodeInformixDB() { * and then extract for further use. */ - if (process.env.CSDK_HOME || process.env.INFORMIXDIR || fs.existsSync(DOWNLOAD_DIR + "/onedb-odbc-driver")) - { - var IS_ENVIRONMENT_VAR; + if (process.env.CSDK_HOME || process.env.INFORMIXDIR || fs.existsSync(DOWNLOAD_DIR + "/onedb-odbc-driver")) { + let IS_ENVIRONMENT_VAR; if (process.env.CSDK_HOME) { CSDK_HOME = process.env.CSDK_HOME; IS_ENVIRONMENT_VAR = true; - console.log('\nFOUND: CSDK_HOME environment variable : ' + CSDK_HOME + - '\nACTION: Build is in progress...\n'); - } - else if (process.env.INFORMIXDIR) { + console.log('\nFOUND: CSDK_HOME environment variable : ' + CSDK_HOME + '\nACTION: Build is in progress...\n'); + } else if (process.env.INFORMIXDIR) { CSDK_HOME = process.env.INFORMIXDIR; process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g, '\\ '); IS_ENVIRONMENT_VAR = true; - console.log('\nFOUND: INFORMIXDIR environment variable : ' + CSDK_HOME + - '\nACTION: Build is in progress...\n'); - } - else if (fs.existsSync(DOWNLOAD_DIR + "/onedb-odbc-driver")){ + console.log('\nFOUND: INFORMIXDIR environment variable : ' + CSDK_HOME + '\nACTION: Build is in progress...\n'); + } else if (fs.existsSync(DOWNLOAD_DIR + "/onedb-odbc-driver")) { CSDK_HOME = path.resolve(DOWNLOAD_DIR, 'onedb-odbc-driver'); - process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g,'\\ '); + process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g, '\\ '); IS_ENVIRONMENT_VAR = false; } checkCSDKInternalDirs(); if (IS_ENVIRONMENT_VAR) { - console.log('CSDK_HOME environment variable have already been ' + - 'set to -> ' + CSDK_HOME + '\n\nDownloading of onedb-odbc-driver skipped - build is in progress...\n'); + console.log('CSDK_HOME environment variable have already been ' + 'set to -> ' + CSDK_HOME + '\n\nDownloading of onedb-odbc-driver skipped - build is in progress...\n'); } else { - console.log('Rebuild Process: Found onedb-odbc-driver at -> '+ CSDK_HOME + - '\n\nDownloading of onedb-odbc-driver skipped - build is in progress...\n'); + console.log('Rebuild Process: Found onedb-odbc-driver at -> ' + CSDK_HOME + '\n\nDownloading of onedb-odbc-driver skipped - build is in progress...\n'); } - if (platform != 'win32') { - if (!fs.existsSync(CSDK_HOME + "/lib")) - fs.symlinkSync(CSDK_LIB, path.resolve(CSDK_HOME, 'lib')); + if (platform !== 'win32') { + if (!fs.existsSync(CSDK_HOME + "/lib")) fs.symlinkSync(CSDK_LIB, path.resolve(CSDK_HOME, 'lib')); - if ((platform == 'linux') || (platform == 'aix') || - (platform == 'darwin' && arch == 'x64')) { + if ((platform === 'linux') || (platform === 'aix') || (platform === 'darwin' && arch === 'x64')) { buildDriverAndGenerateBinary(!IS_ENVIRONMENT_VAR); } - } - else if (platform == 'win32' && arch == 'x64') { + } else if (platform === 'win32' && arch === 'x64') { buildDriverAndGenerateBinary(!IS_ENVIRONMENT_VAR); + } else { + console.log('\nBuilding binaries for node-informixdb. This platform ' + 'is not completely supported, you might encounter errors. ' + 'In such cases please open an issue on our repository, ' + 'https://github.com/OpenInformix/node-informixdb. \n'); } - else { - console.log('\nBuilding binaries for node-informixdb. This platform ' + - 'is not completely supported, you might encounter errors. ' + - 'In such cases please open an issue on our repository, ' + - 'https://github.com/OpenInformix/node-informixdb. \n'); - } - } - else { - if(platform == 'win32') { - if(arch == 'x64') { + } else { + if (platform === 'win32') { + if (arch === 'x64') { installerfileURL = installerURL + 'OneDB-Win64-ODBC-Driver.zip'; } - } - else if(platform == 'linux') - { - if(arch == 'x64') { + } else if (platform === 'linux') { + if (arch === 'x64') { installerfileURL = installerURL + 'OneDB-Linux64-ODBC-Driver.tar.gz'; } else { - console.log('Node-Informixdb does not support other Linux flavours. Exiting the ' + - 'install process.\n'); + console.log('Node-Informixdb does not support other Linux flavours. Exiting the ' + 'install process.\n'); process.exit(1); } - } - else if(platform == 'darwin') - { - console.log('Node-Informixdb does not support MAC OS. Exiting the ' + - 'install process.\n'); + } else if (platform === 'darwin') { + console.log('Node-Informixdb does not support MAC OS. Exiting the ' + 'install process.\n'); process.exit(1); - } - else if(platform == 'aix') - { - console.log('Node-Informixdb does not support AIX OS. Exiting the ' + - 'install process.\n'); + } else if (platform === 'aix') { + console.log('Node-Informixdb does not support AIX OS. Exiting the ' + 'install process.\n'); process.exit(1); - } - else if(platform == 'os390') - { - console.log('Node-Informixdb does not support OS390. Exiting the ' + - 'install process.\n'); + } else if (platform === 'os390') { + console.log('Node-Informixdb does not support OS390. Exiting the ' + 'install process.\n'); process.exit(1); - } - else - { - console.log('Node-Informixdb does not support this OS platform. Exiting the ' + - 'install process.\n'); + } else { + console.log('Node-Informixdb does not support this OS platform. Exiting the ' + 'install process.\n'); process.exit(1); } - if(!installerfileURL) { - console.log('Unable to fetch driver download file. Exiting the ' + - 'install process.\n'); + if (!installerfileURL) { + console.log('Unable to fetch driver download file. Exiting the ' + 'install process.\n'); process.exit(1); } - var file_name = url.parse(installerfileURL).pathname.split('/').pop(); + const file_name = new URL(installerfileURL).pathname.split('/').pop(); INSTALLER_FILE = path.resolve(DOWNLOAD_DIR, file_name); - console.log('Downloading Informix ODBC CLI Driver from ' + - installerfileURL+'...\n'); + console.log('Downloading Informix ODBC CLI Driver from ' + installerfileURL + '...\n'); fs.stat(installerfileURL, function (err, stats) { if (!err && stats.isFile()) { @@ -210,49 +177,44 @@ function InstallNodeInformixDB() { return downloadODBCDriver(installerfileURL); }); } // * END OF EXECUTION */ -}; //InstallNodeInformixDB +} //InstallNodeInformixDB function checkDriverCompatibilityForOSAndNodejsVersion() { console.log("\nPlatform = ", platform, ", Arch = ", arch, ", Node.js version = ", process.version); - if ((platform == 'win32' && arch == 'x64') || platform == 'linux') { + if ((platform === 'win32' && arch === 'x64') || platform === 'linux') { // Add-on binaries for node.js version less than 10.0 has been discontinued. if (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 10.0) { - console.log('\nERROR: node-informixdb does not provide compilation and precompiled add-on binary support for node.js version < 10.X on Windows & Linux platforms.' + - ' Please use the node.js version >= 10.X\n'); + console.log('\nERROR: node-informixdb does not provide compilation and precompiled add-on binary support for node.js version < 10.X on Windows & Linux platforms.' + ' Please use the node.js version >= 10.X\n'); process.exit(1); } - } - else { + } else { console.log('\nERROR: Platform: ' + platform + ' with arch: ' + arch + ' is not supported. Please use a supported OS platform.\n'); process.exit(1); } -}; +} function checkCSDKInternalDirs() { CSDK_INCLUDE = path.resolve(CSDK_HOME, 'incl/cli'); CSDK_LIB = path.resolve(CSDK_HOME, 'lib'); if (!fs.existsSync(CSDK_HOME)) { - console.log('\nERROR:' + CSDK_HOME + ' directory does not exist. Please check if you have ' + - 'set the CSDK_HOME environment variable\'s value correctly.\n'); + console.log('\nERROR:' + CSDK_HOME + ' directory does not exist. Please check if you have ' + 'set the CSDK_HOME environment variable\'s value correctly.\n'); process.exit(1); } if (!fs.existsSync(CSDK_INCLUDE)) { - console.log('\nERROR:' + CSDK_INCLUDE + ' directory does not exist. Please check if you have ' + - 'set the CSDK_HOME environment variable\'s value correctly.\n'); + console.log('\nERROR:' + CSDK_INCLUDE + ' directory does not exist. Please check if you have ' + 'set the CSDK_HOME environment variable\'s value correctly.\n'); process.exit(1); } if (!fs.existsSync(CSDK_LIB)) { - console.log('\nERROR:' + CSDK_LIB + ' directory does not exist. Please check if you have ' + - 'set the CSDK_HOME environment variable\'s value correctly.\n'); + console.log('\nERROR:' + CSDK_LIB + ' directory does not exist. Please check if you have ' + 'set the CSDK_HOME environment variable\'s value correctly.\n'); process.exit(1); } -}; +} function buildDriverAndGenerateBinary(isDownloaded) { - var buildString = "node-gyp configure build "; + let buildString = "node-gyp configure build "; - if(isDownloaded) { + if (isDownloaded) { buildString = buildString + " --IS_DOWNLOADED=true"; } else { buildString = buildString + " --IS_DOWNLOADED=false"; @@ -262,242 +224,148 @@ function buildDriverAndGenerateBinary(isDownloaded) { removeDir('build'); // Windows : Auto Installation Process -> 1) node-gyp - if (platform == 'win32' && arch == 'x64') { - var buildString = buildString + " --CSDK_HOME=\$CSDK_HOME"; + if (platform === 'win32' && arch === 'x64') { + buildString = buildString + " --CSDK_HOME=$CSDK_HOME"; - var childProcess = exec(buildString, function (error, stdout, stderr) { + exec(buildString, function (error, stdout) { console.log(stdout); if (error !== null) { console.log('\nERROR: node-gyp build process failed! \n' + error); - installPreCompiledBinary(); - return; + process.exit(1); + } else { - console.log("\n" + - "=======================================\n" + - "node-informixdb installed successfully!\n" + - "=======================================\n"); + console.log("\n" + "=======================================\n" + "node-informixdb installed successfully!\n" + "=======================================\n"); } }); - } - else { - var buildString = buildString + " --CSDK_HOME=\"$CSDK_HOME\""; - var childProcess = exec(buildString, function (error, stdout, stderr) { + } else { + buildString = buildString + " --CSDK_HOME=\"$CSDK_HOME\""; + exec(buildString, function (error, stdout) { console.log(stdout); if (error !== null) { console.log('\nERROR: node-gyp build process failed! \n' + error); - installPreCompiledBinary(); - return; + process.exit(1); + } else { - console.log("\n" + - "=======================================\n" + - "node-informixdb installed successfully!\n" + - "=======================================\n"); + console.log("\n" + "=======================================\n" + "node-informixdb installed successfully!\n" + "=======================================\n"); } }); } -}; //buildDriverAndGenerateBinary - -function installPreCompiledBinary() { - console.log('\nACTION: Proceeding with Pre-compiled Binary Installation. \n'); - if (!process.env.CSDK_HOME && !process.env.INFORMIXDIR && !fs.existsSync(DOWNLOAD_DIR + "/onedb-odbc-driver")) - { - console.log('\nNo prior CSDK/ODBC installation/directory found. Please check if you have ' + - 'set the CSDK_HOME/INFORMIXDIR environment variable\'s value correctly.\n'); - console.log('\nERROR: Installation Failed! \n'); - process.exit(1); - } - var fstream = require('fstream'); - // build.zip file contains all the pre-compiled binary files - BUILD_FILE = path.resolve(CURRENT_DIR, 'build.zip'); - - // This will always be the final installation name/path for all the binaries - var ODBC_BINDINGS = 'build\/Release\/odbc_bindings.node'; - - // Supported Node.js versions bonaries - var ODBC_BINDINGS_V10, ODBC_BINDINGS_V11, ODBC_BINDINGS_V12, ODBC_BINDINGS_V13, ODBC_BINDINGS_V14 - - if (platform == 'win32' && arch == 'x64') { - // Windows node binary names should update here. - ODBC_BINDINGS_V10 = 'build\/Release\/odbc_bindings_win64.node.10.24.1'; - ODBC_BINDINGS_V11 = 'build\/Release\/odbc_bindings_win64.node.11.15.0'; - ODBC_BINDINGS_V12 = 'build\/Release\/odbc_bindings_win64.node.12.22.5'; - ODBC_BINDINGS_V13 = 'build\/Release\/odbc_bindings_win64.node.13.14.0'; - ODBC_BINDINGS_V14 = 'build\/Release\/odbc_bindings_win64.node.14.17.5'; - } - else if (platform = 'linux') { - // Linux node binary names should update here. - ODBC_BINDINGS_V10 = 'build\/Release\/odbc_bindings_linux.node.10.24.1'; - ODBC_BINDINGS_V11 = 'build\/Release\/odbc_bindings_linux.node.11.15.0'; - ODBC_BINDINGS_V12 = 'build\/Release\/odbc_bindings_linux.node.12.22.5'; - ODBC_BINDINGS_V13 = 'build\/Release\/odbc_bindings_linux.node.13.14.0'; - ODBC_BINDINGS_V14 = 'build\/Release\/odbc_bindings_linux.node.14.17.5'; - } +} //buildDriverAndGenerateBinary - /* - * odbcBindingsNode will consist of the node binary- - * file name according to the node version in the system. - */ - var odbcBindingsNode = (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 11.0) && ODBC_BINDINGS_V10 || - (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 12.0) && ODBC_BINDINGS_V11 || - (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 13.0) && ODBC_BINDINGS_V12 || - (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 14.0) && ODBC_BINDINGS_V13 || ODBC_BINDINGS_V14; - - // Removing the "build" directory created by Auto Installation Process. - // "unzipper" will create a fresh "build" directory for extraction of "build.zip". - removeDir('build'); +// Function to download onedb-odbc-driver file using axios module. +async function downloadODBCDriver(installerFileURL) { + const outStream = fs.createWriteStream(INSTALLER_FILE); - readStream = fs.createReadStream(BUILD_FILE); + const response = await axios({ + method: 'get', + url: installerFileURL, + responseType: 'stream', + }); - /* - * unzipper will parse the build.zip file content and - * then it will check for the odbcBindingsNode - * (node Binary), when it gets that binary file, - * fstream.Writer will write the same node binary - * but the name will be odbc_bindings.node, and the other - * binary files and build.zip will be discarded. - */ - readStream.pipe(unzipper.Parse()) - .on('entry', function (entry) { - if (entry.path === odbcBindingsNode) { - entry.pipe(fstream.Writer(ODBC_BINDINGS)); - } else { - entry.autodrain(); - } - }) - .on('error', function (e) { - console.log('\nERROR: Installation Failed! \n', e); - process.exit(1); - }) - .on('finish', function () { - console.log("\n" + - "=======================================\n" + - "node-informixdb installed successfully!\n" + - "=======================================\n"); - }); - return 1; -}; - -// Function to download onedb-odbc-driver file using request module. -function downloadODBCDriver(installerfileURL) { - // Variable to save downloading progress - var received_bytes = 0; - var total_bytes = 0; - - var outStream = fs.createWriteStream(INSTALLER_FILE); - - request - .get(installerfileURL) - .on('error', function(err) { - console.log('\nERROR: downloading onedb-odbc-driver process failed! \n' + err); - installPreCompiledBinary(); - return; - }) - .on('response', function(data) { - total_bytes = parseInt(data.headers['content-length']); - }) - .on('data', function(chunk) { - received_bytes += chunk.length; - showDownloadingProgress(received_bytes, total_bytes); - }) - .pipe(outStream); + const totalBytes = parseInt(response.headers['content-length'], 10); + let receivedBytes = 0; + + // Listen to the data event to track download progress + response.data.on('data', (chunk) => { + receivedBytes += chunk.length; + showDownloadingProgress(receivedBytes, totalBytes); + }); + + // Pipe the response data to the file + response.data.pipe(outStream); + + // Wait for the stream to finish + await new Promise((resolve, reject) => { + outStream.on('finish', resolve); + outStream.on('error', reject); + }); deleteInstallerFile = true; outStream.once('close', copyAndExtractODBCDriver) - .once('error', function (err) { - console.log('\nERROR: extraction of onedb-odbc-driver failed! \n' + err); - installPreCompiledBinary(); - return; - }); -}; + .once('error', function (err) { + console.log('\nERROR: extraction of onedb-odbc-driver failed! \n' + err); + process.exit(1); + }); +} function showDownloadingProgress(received, total) { - var percentage = ((received * 100) / total).toFixed(2); - process.stdout.write((platform == 'win32') ? "\033[0G": "\r"); + const percentage = ((received * 100) / total).toFixed(2); + process.stdout.write((platform === 'win32') ? "\033[0G" : "\r"); process.stdout.write(percentage + "% | " + received + " bytes downloaded out of " + total + " bytes."); -}; +} function copyAndExtractODBCDriver() { - if(platform == 'win32') { + if (platform === 'win32') { readStream = fs.createReadStream(INSTALLER_FILE); // Using the "unzipper" module to extract the zipped "onedb-odbc-driver", // and on successful close, printing the license_agreement - var extractODBCDriver = readStream.pipe(unzipper.Extract({path: DOWNLOAD_DIR})); + const unzipper = require('unzipper'); + const extractODBCDriver = readStream.pipe(unzipper.Extract({path: DOWNLOAD_DIR})); - extractODBCDriver.on('close', function() { + extractODBCDriver.on('close', function () { console.log(license_agreement); - console.log('Downloading and extraction of Informix ODBC ' + - 'CLI Driver completed successfully... \n'); + console.log('Downloading and extraction of Informix ODBC ' + 'CLI Driver completed successfully... \n'); CSDK_HOME = path.resolve(DOWNLOAD_DIR, 'onedb-odbc-driver'); - process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g,'\\ '); + process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g, '\\ '); checkCSDKInternalDirs(); buildDriverAndGenerateBinary(true); removeFile(BUILD_FILE); - if(deleteInstallerFile) removeFile(INSTALLER_FILE); + if (deleteInstallerFile) removeFile(INSTALLER_FILE); }); - extractODBCDriver.on('err', function() { + extractODBCDriver.on('err', function (err) { console.log('\nERROR: extraction of onedb-odbc-driver failed! \n' + err); - installPreCompiledBinary(); - return; + process.exit(1); }); - } - else - { - var targz = require('targz'); - var decompress = targz.decompress({src: INSTALLER_FILE, dest: DOWNLOAD_DIR}, function(err){ - if(err) { + } else { + const targz = require('targz'); + targz.decompress({src: INSTALLER_FILE, dest: DOWNLOAD_DIR}, function (err) { + if (err) { console.log('\nERROR: extraction of onedb-odbc-driver failed! \n' + err); - installPreCompiledBinary(); - return; - } - else { + process.exit(1); + } else { console.log(license_agreement); - console.log('Downloading and extraction of Informix ODBC ' + - 'CLI Driver completed successfully... \n'); + console.log('Downloading and extraction of Informix ODBC ' + 'CLI Driver completed successfully... \n'); CSDK_HOME = path.resolve(DOWNLOAD_DIR, 'onedb-odbc-driver'); - process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g,'\\ '); + process.env.CSDK_HOME = CSDK_HOME.replace(/\s/g, '\\ '); checkCSDKInternalDirs(); buildDriverAndGenerateBinary(true); removeFile(BUILD_FILE); - if(deleteInstallerFile) removeFile(INSTALLER_FILE); + if (deleteInstallerFile) removeFile(INSTALLER_FILE); } }); } -}; +} function removeDir(dir) { - var fullPath = path.resolve(CURRENT_DIR, dir); + const fullPath = path.resolve(CURRENT_DIR, dir); if (fs.existsSync(fullPath)) { - if (platform == 'win32') { + if (platform === 'win32') { execSync("rmdir /s /q " + '"' + fullPath + '"'); } else { execSync("rm -rf " + '"' + fullPath + '"'); } } -}; +} -function removeFile(FILE_PATH) -{ +function removeFile(FILE_PATH) { // Delete downloaded odbc_cli.tar.gz file. - fs.exists(FILE_PATH, function(exists) - { - if (exists) - { - fs.unlinkSync(FILE_PATH); - } - }); -}; + const exists = fs.existsSync(FILE_PATH) + if (exists) { + fs.unlinkSync(FILE_PATH); + } +} -function deleteFolderRecursive(p){ +function deleteFolderRecursive(p) { if (fs.existsSync(p)) { - fs.readdirSync(p).forEach(function(file, index){ - var curPath = path.join(p, file); + fs.readdirSync(p).forEach(function (file) { + const curPath = path.join(p, file); if (fs.lstatSync(curPath).isDirectory()) { // recurse deleteFolderRecursive(curPath); - }else { // delete file + } else { // delete file fs.unlinkSync(curPath); } }); fs.rmdirSync(p); } -}; +} diff --git a/lib/odbc.js b/lib/odbc.js index f717274..ccd6572 100644 --- a/lib/odbc.js +++ b/lib/odbc.js @@ -18,34 +18,28 @@ */ // Setting SQLLIB bin path to the path env before load for windows -var os = require('os'), - path = require('path'); - -if (os.platform() == 'win32') -{ +const os = require('os'), path = require('path'); + +if (os.platform() === 'win32') { //CSDK_HOME - process.env.PATH = process.env.PATH + ';' + - path.resolve(__dirname, process.env.CSDK_HOME + '/bin'); - process.env.LIB = process.env.LIB + ';' + - path.resolve(__dirname, process.env.CSDK_HOME + '/lib'); + process.env.PATH = process.env.PATH + ';' + path.resolve(__dirname, process.env.CSDK_HOME + '/bin'); + process.env.LIB = process.env.LIB + ';' + path.resolve(__dirname, process.env.CSDK_HOME + '/lib'); } - -var odbc = require("bindings")("odbc_bindings") - , SimpleQueue = require("./simple-queue") - , util = require("util") - , Readable = require('stream').Readable - , Q = require('q'); +const odbc = require("bindings")("odbc_bindings") +const SimpleQueue = require("./simple-queue") +const util = require("node:util") +const Readable = require('node:stream').Readable +const Q = require('q'); // Call of odbc.ODBC() loads odbc library and allocate environment handle. // All calls of new Database() should use this same odbc unless passed as // options.odbc. ENV will keep value of this odbc after first call of Database. -var ENV; -module.exports = function (options) -{ - return new Database(options); +let ENV; +module.exports = function (options) { + return new Database(options); }; module.exports.Database = Database; @@ -55,72 +49,61 @@ module.exports.ODBCStatement = odbc.ODBCStatement; module.exports.ODBCResult = odbc.ODBCResult; exports.debug = false; -var informixdbStartTime = new Date(); -var getElapsedTime = function(){ - var tstamp = (new Date() - informixdbStartTime)/1000.0; - //process.stdout.write(tstamp + " :: "); - return (tstamp + " :: "); - }; +const informixdbStartTime = new Date(); +const getElapsedTime = function () { + const tstamp = (new Date() - informixdbStartTime) / 1000.0; + //process.stdout.write(tstamp + " :: "); + return (tstamp + " :: "); +}; module.exports.getElapsedTime = getElapsedTime; -module.exports.debug = function(x) { - if(x) { +module.exports.debug = function (x) { + if (x) { exports.debug = true; console.log("node-informixdb logs enabled."); - } - else { + } else { exports.debug = false; console.log("node-informixdb logs disabled."); } }; -module.exports.open = function (connStr, options, cb) -{ - var db, deferred; +module.exports.open = function (connStr, options, cb) { + let db, deferred; - var DBFactory = function(options) { - return new Database(options); - }; + const DBFactory = function (options) { + return new Database(options); + }; - if (!cb && typeof options !== 'function') - { - if(!options) - { - options = null; + if (!cb && typeof options !== 'function') { + if (!options) { + options = null; + } + db = DBFactory(options); + deferred = Q.defer(); + db.open(connStr, function (err) { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(db); + } + }); + return deferred.promise; + } else if (typeof options === 'function') { + cb = options; + options = null; } - db = DBFactory(options); - deferred = Q.defer(); - db.open(connStr, function(err) { - if (err) - { - deferred.reject(err); - } - else - { - deferred.resolve(db); - } - }); - return deferred.promise; - } - else if (typeof options === 'function') - { - cb = options; - options = null; - } - - db = DBFactory(options); + db = DBFactory(options); - db.open(connStr, function (err) { - cb && cb(err, db); - }); + db.open(connStr, function (err) { + cb && cb(err, db); + }); }; // informixdb.open -module.exports.openSync = function (connStr, options) -{ - var db = new Database(options); - db.openSync(connStr); - return db; +module.exports.openSync = function (connStr, options) { + const db = new Database(options); + db.openSync(connStr); + return db; }; // informixdb.openSync /* @@ -131,53 +114,44 @@ module.exports.openSync = function (connStr, options) * * return: TRUE on success or FALSE on failure. */ -module.exports.createDbSync = function (dbName, connStr, options) -{ - var result; - var params = []; - var db = new Database(options); - - if (typeof(connStr) === "object") - { - var obj = connStr; - connStr = ""; - Object.keys(obj).forEach(function (key) { - connStr += key + "=" + obj[key] + ";"; - }); - } - // Connection String to connect witht the DB instance. - var conStr = connStr + ";" + "CONNECTDATABASE=NO"; - var connectionOpen = db.openSync(conStr); - - if (connectionOpen) - { - db.connected = true; - } - - if (!db.connected) - { - throw ({ message : "Connection not open."}); - } - else - { - if(dbName == null ) - { - throw ({ message : "Database Name is required."}); +module.exports.createDbSync = function (dbName, connStr, options) { + let result; + //const params = []; + const db = new Database(options); + + if (typeof (connStr) === "object") { + const obj = connStr; + connStr = ""; + Object.keys(obj).forEach(function (key) { + connStr += key + "=" + obj[key] + ";"; + }); } - else - { - var createDbSQL = "create database " + dbName; - // IF: argument "options" is not passed while calling. - // THEN: db.codeSet and db.mode will be "null" (default value). - params.push(db.codeSet); - params.push(db.mode); - // TODO: Not passing params now, as need to figure out how it will work in Informix. - // Is it even required or not. - // result = db.conn.createDbSync(createDbSQL, params); - result = db.conn.createDbSync(createDbSQL); - return result; + // Connection String to connect witht the DB instance. + const conStr = connStr + ";" + "CONNECTDATABASE=NO"; + const connectionOpen = db.openSync(conStr); + + if (connectionOpen) { + db.connected = true; + } + + if (!db.connected) { + throw ({message: "Connection not open."}); + } else { + if (dbName == null) { + throw ({message: "Database Name is required."}); + } else { + const createDbSQL = "create database " + dbName; + // IF: argument "options" is not passed while calling. + // THEN: db.codeSet and db.mode will be "null" (default value). + // TODO: Not passing params now, as need to figure out how it will work in Informix. + // params.push(db.codeSet); + // params.push(db.mode); + // Is it even required or not. + // result = db.conn.createDbSync(createDbSQL, params); + result = db.conn.createDbSync(createDbSQL); + return result; + } } - } }; // informixdb.createDbSync /* @@ -187,928 +161,752 @@ module.exports.createDbSync = function (dbName, connStr, options) * * return: TRUE on success or FALSE on failure. */ -module.exports.dropDbSync = function (dbName, connStr, options) -{ - var result; - var db = new Database(options); +module.exports.dropDbSync = function (dbName, connStr, options) { + let result; + const db = new Database(options); - if (typeof(connStr) === "object") - { - var obj = connStr; - connStr = ""; + if (typeof (connStr) === "object") { + const obj = connStr; + connStr = ""; - Object.keys(obj).forEach(function (key) { - connStr += key + "=" + obj[key] + ";"; - }); - } - var conStr = connStr + ";" + "CONNECTDATABASE=NO"; - var connectionOpen = db.openSync(conStr); - - if (connectionOpen) - { - db.connected = true; - } - - if (!db.connected) - { - throw ({ message : "Connection not open."}); - } - else - { - if(dbName == null ) - { - throw ({ message : "Database Name is required."}); + Object.keys(obj).forEach(function (key) { + connStr += key + "=" + obj[key] + ";"; + }); } - else - { - var dropDbSQL = "drop database " + dbName; - result = db.conn.dropDbSync(dropDbSQL); - return result; + const conStr = connStr + ";" + "CONNECTDATABASE=NO"; + const connectionOpen = db.openSync(conStr); + + if (connectionOpen) { + db.connected = true; + } + + if (!db.connected) { + throw ({message: "Connection not open."}); + } else { + if (dbName == null) { + throw ({message: "Database Name is required."}); + } else { + const dropDbSQL = "drop database " + dbName; + result = db.conn.dropDbSync(dropDbSQL); + return result; + } } - } }; // informixdb.dropDbSync -module.exports.close = function(db) -{ - if(db && typeof(db) === "object") - { - var key; - for(key in db) - { - delete db[key]; +module.exports.close = function (db) { + if (db && typeof (db) === "object") { + let key; + for (key in db) { + delete db[key]; + } } - delete db; - db = undefined; - } }; // informixdb.close -function Database(options) -{ - var self = this; - - options = options || {}; - - self.odbc = (options.odbc) ? options.odbc : ((ENV) ? ENV : new odbc.ODBC()); - if(!ENV) ENV = self.odbc; - self.queue = new SimpleQueue(); - self.fetchMode = options.fetchMode || null; - self.connected = false; - self.connectTimeout = options.connectTimeout || null; - self.systemNaming = options.systemNaming; - self.codeSet = options.codeSet || null; - self.mode = options.mode || null; +function Database(options) { + const self = this; + + options = options || {}; + + self.odbc = (options.odbc) ? options.odbc : ((ENV) ? ENV : new odbc.ODBC()); + if (!ENV) ENV = self.odbc; + self.queue = new SimpleQueue(); + self.fetchMode = options.fetchMode || null; + self.connected = false; + self.connectTimeout = options.connectTimeout || null; + self.systemNaming = options.systemNaming; + self.codeSet = options.codeSet || null; + self.mode = options.mode || null; } // Database() //Expose constants Object.keys(odbc.ODBC).forEach(function (key) { - if (typeof odbc.ODBC[key] !== "function") - { - //On the database prototype - Database.prototype[key] = odbc.ODBC[key]; - - //On the exports - module.exports[key] = odbc.ODBC[key]; - } + if (typeof odbc.ODBC[key] !== "function") { + //On the database prototype + Database.prototype[key] = odbc.ODBC[key]; + + //On the exports + module.exports[key] = odbc.ODBC[key]; + } }); Database.prototype.open = function (connStr, cb) { - var self = this, deferred; + const self = this; + let deferred; - if (typeof(connStr) === "object") - { - var obj = connStr; - connStr = ""; + if (typeof (connStr) === "object") { + const obj = connStr; + connStr = ""; - Object.keys(obj).forEach(function (key) { - connStr += key + "=" + obj[key] + ";"; - }); - } - - if (!cb) - { - deferred = Q.defer(); - } - - self.odbc.createConnection(function (err, conn) { - if(!cb) - { - if (err) deferred.reject(err); - } else - { - if (err) return cb(err); + Object.keys(obj).forEach(function (key) { + connStr += key + "=" + obj[key] + ";"; + }); } - self.conn = conn; - - if (self.connectTimeout || self.connectTimeout === 0) - { - self.conn.connectTimeout = self.connectTimeout; - } - if (typeof(self.systemNaming) !== 'undefined') - { - self.conn.systemNaming = self.systemNaming; + if (!cb) { + deferred = Q.defer(); } - self.conn.open(connStr, function (err, result) - { - if(cb) - { - if (err) cb(err); - else { - self.connected = true; - cb(err, result); + self.odbc.createConnection(function (err, conn) { + if (!cb) { + if (err) deferred.reject(err); + } else { + if (err) return cb(err); } - } - else - { - if(err) deferred.reject(err); - self.connected = true; - deferred.resolve(result); - } - }); //conn.open - }); // odbc.createConnection + self.conn = conn; + + if (self.connectTimeout || self.connectTimeout === 0) { + self.conn.connectTimeout = self.connectTimeout; + } + if (typeof (self.systemNaming) !== 'undefined') { + self.conn.systemNaming = self.systemNaming; + } + + self.conn.open(connStr, function (err, result) { + if (cb) { + if (err) cb(err); else { + self.connected = true; + cb(err, result); + } + } else { + if (err) deferred.reject(err); - return deferred ? deferred.promise : null; + self.connected = true; + deferred.resolve(result); + } + }); //conn.open + }); // odbc.createConnection + + return deferred ? deferred.promise : null; }; // Database.open function -Database.prototype.openSync = function (connStr) -{ - var self = this; - - self.conn = self.odbc.createConnectionSync(); - - if (self.connectTimeout || self.connectTimeout === 0) - { - self.conn.connectTimeout = self.connectTimeout; - } - if (typeof(self.systemNaming) !== 'undefined') - { - self.conn.systemNaming = self.systemNaming; - } - - if (typeof(connStr) === "object") - { - var obj = connStr; - connStr = ""; - - Object.keys(obj).forEach(function (key) { - connStr += key + "=" + obj[key] + ";"; - }); - } +Database.prototype.openSync = function (connStr) { + const self = this; + + self.conn = self.odbc.createConnectionSync(); - var result = self.conn.openSync(connStr); + if (self.connectTimeout || self.connectTimeout === 0) { + self.conn.connectTimeout = self.connectTimeout; + } + if (typeof (self.systemNaming) !== 'undefined') { + self.conn.systemNaming = self.systemNaming; + } - if (result) - { - self.connected = true; - } + if (typeof (connStr) === "object") { + const obj = connStr; + connStr = ""; - return result; -}; // Database.openSync + Object.keys(obj).forEach(function (key) { + connStr += key + "=" + obj[key] + ";"; + }); + } -Database.prototype.close = function (cb) -{ - var self = this, deferred; - if(!cb) - { - deferred = Q.defer(); - } - - self.queue.push(function (next) { - if(self.conn) - { - self.conn.close(function (err) { - self.connected = false; - delete self.conn; - - if (cb) - { - cb(err); - } else - { - deferred.resolve(err); - } - return next(); - }); + const result = self.conn.openSync(connStr); + + if (result) { + self.connected = true; } - else - { - self.connected = false; + + return result; +}; // Database.openSync + +Database.prototype.close = function (cb) { + const self = this; + let deferred; + if (!cb) { + deferred = Q.defer(); } - }); // self.queue.push - return deferred ? deferred.promise : false; + self.queue.push(function (next) { + if (self.conn) { + self.conn.close(function (err) { + self.connected = false; + delete self.conn; + + if (cb) { + cb(err); + } else { + deferred.resolve(err); + } + return next(); + }); + } else { + self.connected = false; + } + }); // self.queue.push + + return deferred ? deferred.promise : false; }; // Database.close -Database.prototype.closeSync = function () -{ - var self = this; +Database.prototype.closeSync = function () { + const self = this; - var result; - if(self.conn) result = self.conn.closeSync(); + let result; + if (self.conn) result = self.conn.closeSync(); - self.connected = false; - delete self.conn; + self.connected = false; + delete self.conn; - return result + return result }; // closeSync -Database.prototype.query = function (query, params, cb) -{ - var self = this, deferred, sql, resultset = [], multipleResultSet = false; - - exports.debug && console.log(getElapsedTime(), "odbc.js:query() => Entry"); - //support for promises - if (!cb && typeof params !== 'function') - { - deferred = Q.defer(); - !params ? params = null : ''; - } - - if (typeof(params) === 'function') - { - cb = params; - params = null; - } - - if (!self.connected) - { - deferred ? deferred.reject({ message : "Connection not open."}) : - cb({ message : "Connection not open."}, [], false); - return deferred ? deferred.promise : false; - } - - self.queue.push(function (next) { - function cbQuery (initialErr, result, outparams) - { - if(outparams) { - resultset = outparams; - multipleResultSet = true; - } - if (result && typeof(result) === 'object') { - fetchMore(); - } else { - cb && cb(initialErr, resultset); - return next(); - } - - function fetchMore() - { - if (self.fetchMode) - { - result.fetchMode = self.fetchMode; - } - - result.fetchAll(function (err, data) { - var moreResults = false, moreResultsError = null; - - // If there is any error, return it now only. - if( err || initialErr ) - { - // For pooled connection, if we get SQL30081N (IFX 27001), then close - // the connection now only and then proceed. - if(self.realClose){ - if((err && err['message'] && - err['message'].search("SQL30081N") != -1) || - (initialErr && initialErr['message'] && - initialErr['message'].search("SQL30081N") != -1)) - { - self.closeSync(); - } - } - if(multipleResultSet) resultset.push(data); - else resultset = data; - deferred ? deferred.reject(initialErr || err) : cb(initialErr || err, resultset); - result.closeSync(); - initialErr = null; - err = null; - return next(); - } - - // Get the result data - try - { - moreResults = result.moreResultsSync(); - } - catch (e) - { - moreResultsError = e; - moreResults = false; - } - - //close the result before calling back - //if there are not more result sets - if (moreResults) - { - resultset.push(data); - multipleResultSet = true; - fetchMore(); - } - else - { - result.closeSync(); - if(multipleResultSet) resultset.push(data); - else resultset = data; - - exports.debug && console.log(getElapsedTime(), "odbc.js:query() => Done."); - // send exception error and/or data to callback function. - // only once with all the results. - !cb ? deferred.resolve(resultset) : cb(moreResultsError, resultset); - } - - moreResultsError = null; - return next(); - }); - } - } //function cbQuery +Database.prototype.query = function (query, params, cb) { + const self = this; + let deferred, sql, resultset = [], multipleResultSet = false; - if(typeof query === "object") - { - sql = query.sql; - if(query.params) params = query.params; + exports.debug && console.log(getElapsedTime(), "odbc.js:query() => Entry"); + //support for promises + if (!cb && typeof params !== 'function') { + deferred = Q.defer(); + !params ? params = null : ''; } - else - { - sql = query; - } - exports.debug && console.log(getElapsedTime(), "odbc.js:query() => ", sql); - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) deferred ? deferred.reject(err) : cb(err); - } - if(typeof query === 'object') - { - query.params = params; - self.conn.query(query, cbQuery); - } - else - self.conn.query(query, params, cbQuery); + + if (typeof (params) === 'function') { + cb = params; + params = null; } - else - { - self.conn.query(query, cbQuery); + + if (!self.connected) { + deferred ? deferred.reject({message: "Connection not open."}) : cb({message: "Connection not open."}, [], false); + return deferred ? deferred.promise : false; } - }); //self.queue.push - return deferred ? deferred.promise : false; + + self.queue.push(function (next) { + function cbQuery(initialErr, result, outparams) { + if (outparams) { + resultset = outparams; + multipleResultSet = true; + } + if (result && typeof (result) === 'object') { + fetchMore(); + } else { + cb && cb(initialErr, resultset); + return next(); + } + + function fetchMore() { + if (self.fetchMode) { + result.fetchMode = self.fetchMode; + } + + result.fetchAll(function (err, data) { + let moreResults = false, moreResultsError = null; + + // If there is any error, return it now only. + if (err || initialErr) { + // For pooled connection, if we get SQL30081N (IFX 27001), then close + // the connection now only and then proceed. + if (self.realClose) { + if ((err && err['message'] && err['message'].search("SQL30081N") !== -1) || (initialErr && initialErr['message'] && initialErr['message'].search("SQL30081N") !== -1)) { + self.closeSync(); + } + } + if (multipleResultSet) resultset.push(data); else resultset = data; + deferred ? deferred.reject(initialErr || err) : cb(initialErr || err, resultset); + result.closeSync(); + initialErr = null; + err = null; + return next(); + } + + // Get the result data + try { + moreResults = result.moreResultsSync(); + } catch (e) { + moreResultsError = e; + moreResults = false; + } + + //close the result before calling back + //if there are not more result sets + if (moreResults) { + resultset.push(data); + multipleResultSet = true; + fetchMore(); + } else { + result.closeSync(); + if (multipleResultSet) resultset.push(data); else resultset = data; + + exports.debug && console.log(getElapsedTime(), "odbc.js:query() => Done."); + // send exception error and/or data to callback function. + // only once with all the results. + !cb ? deferred.resolve(resultset) : cb(moreResultsError, resultset); + } + + moreResultsError = null; + return next(); + }); + } + } //function cbQuery + + if (typeof query === "object") { + sql = query.sql; + if (query.params) params = query.params; + } else { + sql = query; + } + exports.debug && console.log(getElapsedTime(), "odbc.js:query() => ", sql); + if (params) { + if (Array.isArray(params)) { + var err = parseParams(params); + if (err) deferred ? deferred.reject(err) : cb(err); + } + if (typeof query === 'object') { + query.params = params; + self.conn.query(query, cbQuery); + } else self.conn.query(query, params, cbQuery); + } else { + self.conn.query(query, cbQuery); + } + }); //self.queue.push + return deferred ? deferred.promise : false; }; // Database.query -Database.prototype.queryResult = function (query, params, cb) -{ - var self = this, sql; - - if (typeof(params) === 'function') - { - cb = params; - params = null; - } - - if (!self.connected) - { - return cb({ message : "Connection not open."}, null); - } - - if(typeof query === "object") - { - sql = query.sql; - if(query.params) params = query.params; - } - else - { - sql = query; - } - - exports.debug && console.log(getElapsedTime(), "odbc.js:queryResult() => ", sql); - self.queue.push(function (next) { - //ODBCConnection.query() is the fastest-path querying mechanism. - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) cb(err); - } - if(typeof query === 'object') - { - query.params = params; - self.conn.query(query, cbQuery); - } - else - self.conn.query(sql, params, cbQuery); +Database.prototype.queryResult = function (query, params, cb) { + const self = this; + let sql; + + if (typeof (params) === 'function') { + cb = params; + params = null; } - else - { - self.conn.query(sql, cbQuery); + + if (!self.connected) { + return cb({message: "Connection not open."}, null); } - function cbQuery (err, result) - { - if (err) - { - cb && cb(err, null); - return next(); - } + if (typeof query === "object") { + sql = query.sql; + if (query.params) params = query.params; + } else { + sql = query; + } - if (self.fetchMode) - { - result.fetchMode = self.fetchMode; - } + exports.debug && console.log(getElapsedTime(), "odbc.js:queryResult() => ", sql); + self.queue.push(function (next) { + //ODBCConnection.query() is the fastest-path querying mechanism. + if (params) { + if (Array.isArray(params)) { + const err = parseParams(params); + if (err) cb(err); + } + if (typeof query === 'object') { + query.params = params; + self.conn.query(query, cbQuery); + } else self.conn.query(sql, params, cbQuery); + } else { + self.conn.query(sql, cbQuery); + } - cb && cb(err, result); + function cbQuery(err, result) { + if (err) { + cb && cb(err, null); + return next(); + } + + if (self.fetchMode) { + result.fetchMode = self.fetchMode; + } - return next(); - } // function cbQuery - }); //self.queue.push + cb && cb(err, result); + + return next(); + } // function cbQuery + }); //self.queue.push }; // Database.queryResult -Database.prototype.queryResultSync = function (query, params) -{ - var self = this, result, sql; - - if (!self.connected) - { - throw ({ message : "Connection not open."}); - } - - if(typeof query === "object") - { - sql = query.sql; - if(query.params) params = query.params; - } - else - { - sql = query; - } - - exports.debug && console.log(getElapsedTime(), "odbc.js:queryResultSync() => ", sql); - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) cb && cb(err); +Database.prototype.queryResultSync = function (query, params) { + const self = this; + let result, sql; + + if (!self.connected) { + throw ({message: "Connection not open."}); + } + + if (typeof query === "object") { + sql = query.sql; + if (query.params) params = query.params; + } else { + sql = query; } - if(sql.search(/^call /i)) - { - if(typeof query === 'object') - { - query.params = params; - self.conn.querySync(query); - } - else - result = self.conn.querySync(sql, params); + + exports.debug && console.log(getElapsedTime(), "odbc.js:queryResultSync() => ", sql); + if (params) { + if (sql.search(/^call /i)) { + if (typeof query === 'object') { + query.params = params; + self.conn.querySync(query); + } else result = self.conn.querySync(sql, params); + } else // Its a CALL statement. + { + result = self.conn.querySync({"sql": sql, "params": params, "noResults": true}); + return result; + } + } else { + result = self.conn.querySync(sql); } - else // Its a CALL statement. - { - result = self.conn.querySync({"sql":sql, "params":params, "noResults":true}); - return result; + + if (self.fetchMode) { + result.fetchMode = self.fetchMode; } - } - else - { - result = self.conn.querySync(sql); - } - - if (self.fetchMode) - { - result.fetchMode = self.fetchMode; - } - - return result; + + return result; }; // Database.queryResultSync -Database.prototype.querySync = function (query, params) -{ - var self = this, result, sql, outparams = null; - - if (!self.connected) - { - throw ({ message : "Connection not open."}); - } - - if(typeof query === "object") - { - sql = query.sql; - if(query.params) params = query.params; - } - else - { - sql = query; - } - - exports.debug && console.log(getElapsedTime(), "odbc.js:querySync() => ", sql); - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) return err; +Database.prototype.querySync = function (query, params) { + const self = this; + let result, sql, outparams = null; + + if (!self.connected) { + throw ({message: "Connection not open."}); } - if(typeof query === 'object') - { - query.params = params; - result = self.conn.querySync(query); + + if (typeof query === "object") { + sql = query.sql; + if (query.params) params = query.params; + } else { + sql = query; } - else - { - result = self.conn.querySync(sql, params); + + exports.debug && console.log(getElapsedTime(), "odbc.js:querySync() => ", sql); + if (params) { + if (Array.isArray(params)) { + const err = parseParams(params); + if (err) return err; + } + if (typeof query === 'object') { + query.params = params; + result = self.conn.querySync(query); + } else { + result = self.conn.querySync(sql, params); + } + } else { + result = self.conn.querySync(query); } - } - else - { - result = self.conn.querySync(query); - } - - if(Array.isArray(result)) - { - if(result[1]) { - outparams = result[1]; // INOUT and OUT param values for SP. + + if (Array.isArray(result)) { + if (result[1]) { + outparams = result[1]; // INOUT and OUT param values for SP. + } + result = result[0]; } - result = result[0]; - } - if(!result) return outparams; // For noResults. - - // Processing for resultset. - var data, resultset = [], moreResults = true, moreResultsError = null; - var nullresult = true; - - if(outparams) { - resultset = outparams; - nullresult = false; - } - if (self.fetchMode) - { - result.fetchMode = self.fetchMode; - } - - while(moreResults) - { - data = result.fetchAllSync(); - if(!data.length) { - moreResults = false; - break; - } - try - { - moreResults = result.moreResultsSync(); - } - catch (e) - { - moreResultsError = e; - moreResults = false; - break; - } - if(data.length) { - if(nullresult && !moreResults) resultset = data; - else resultset.push(data); - nullresult = false; - } - } - result.closeSync(); - - if(moreResultsError) return moreResultsError; - if(nullresult) return []; - - return resultset; -}; // Database.querySync + if (!result) return outparams; // For noResults. -Database.prototype.queryStream = function queryStream(sql, params) -{ - var self = this; - var stream = new Readable({ objectMode: true }); - var results; - stream._read = function() - { - // after the first internal call to _read, the 'results' should be set - // and the stream can continue fetching the results - if (results) return self.fetchStreamingResults(results, stream); - - // in the first call to _read the stream starts to emit data once we've - // queried for results - return self.queryResult(sql, params, function (err, result) - { - if (err) - { - return process.nextTick(function () { stream.emit('error', err); }); - } - results = result; - return self.fetchStreamingResults(results, stream); - }); - }; - return stream; -}; + // Processing for resultset. + let data, resultset = [], moreResults = true, moreResultsError = null; + let nullresult = true; -Database.prototype.fetchStreamingResults = function(results, stream) -{ - var self = this; - return results.fetch(function (err, data) - { - if (err) - { - return process.nextTick(function () { stream.emit('error', err); }); + if (outparams) { + resultset = outparams; + nullresult = false; } - // when no more data returns, return push null to indicate the end of stream - if (!data) - { - stream.push(null); + if (self.fetchMode) { + result.fetchMode = self.fetchMode; } - else { - stream.push(data); + + while (moreResults) { + data = result.fetchAllSync(); + if (!data.length) { + moreResults = false; + break; + } + try { + moreResults = result.moreResultsSync(); + } catch (e) { + moreResultsError = e; + moreResults = false; + break; + } + if (data.length) { + if (nullresult && !moreResults) resultset = data; else resultset.push(data); + nullresult = false; + } } - }); -}; + result.closeSync(); -Database.prototype.beginTransaction = function (cb) -{ - var self = this - , deferred = null - , onBeginTransaction; - if(!cb) - { - deferred = Q.defer(); - onBeginTransaction = function(err) - { - if(err) - { - deferred.reject(err); - } - else - { - deferred.resolve(true); - } + if (moreResultsError) return moreResultsError; + if (nullresult) return []; + + return resultset; +}; // Database.querySync + +Database.prototype.queryStream = function queryStream(sql, params) { + const self = this; + const stream = new Readable({objectMode: true}); + let results; + stream._read = function () { + // after the first internal call to _read, the 'results' should be set + // and the stream can continue fetching the results + if (results) return self.fetchStreamingResults(results, stream); + + // in the first call to _read the stream starts to emit data once we've + // queried for results + return self.queryResult(sql, params, function (err, result) { + if (err) { + return process.nextTick(function () { + stream.emit('error', err); + }); + } + results = result; + return self.fetchStreamingResults(results, stream); + }); }; - } + return stream; +}; + +Database.prototype.fetchStreamingResults = function (results, stream) { + return results.fetch(function (err, data) { + if (err) { + return process.nextTick(function () { + stream.emit('error', err); + }); + } + // when no more data returns, return push null to indicate the end of stream + if (!data) { + stream.push(null); + } else { + stream.push(data); + } + }); +}; + +Database.prototype.beginTransaction = function (cb) { + const self = this; + let deferred = null, onBeginTransaction; + if (!cb) { + deferred = Q.defer(); + onBeginTransaction = function (err) { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(true); + } + }; + } - self.conn.beginTransaction(deferred ? onBeginTransaction : cb); - self.conn.inTransaction = true; + self.conn.beginTransaction(deferred ? onBeginTransaction : cb); + self.conn.inTransaction = true; - return deferred ? deferred.promise : self; + return deferred ? deferred.promise : self; }; -Database.prototype.endTransaction = function (rollback, cb) -{ - var self = this; +Database.prototype.endTransaction = function (rollback, cb) { + const self = this; - self.conn.endTransaction(rollback, cb); - self.conn.inTransaction = false; + self.conn.endTransaction(rollback, cb); + self.conn.inTransaction = false; - return self; + return self; }; -Database.prototype.commitTransaction = function (cb) -{ - var self = this, deferred = null, onEndTransaction; - if(!cb) - { - deferred = Q.defer(); - onEndTransaction = function(err) - { - if(err) - { - deferred.reject(err); - } - else - { - deferred.resolve(true); - } - }; - } +Database.prototype.commitTransaction = function (cb) { + const self = this; + let deferred = null, onEndTransaction; + if (!cb) { + deferred = Q.defer(); + onEndTransaction = function (err) { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(true); + } + }; + } - //don't rollback - self.conn.endTransaction(false, deferred ? onEndTransaction : cb); - self.conn.inTransaction = false; + //don't rollback + self.conn.endTransaction(false, deferred ? onEndTransaction : cb); + self.conn.inTransaction = false; - return deferred ? deferred.promise : self; + return deferred ? deferred.promise : self; }; -Database.prototype.rollbackTransaction = function (cb) -{ - var self = this, deferred = null, onEndTransaction; - if(!cb) { - deferred = Q.defer(); - onEndTransaction = function(err) { - if(err) { - deferred.reject(err); - } - else { - deferred.resolve(true); - } - }; - } +Database.prototype.rollbackTransaction = function (cb) { + const self = this; + let deferred = null, onEndTransaction; + if (!cb) { + deferred = Q.defer(); + onEndTransaction = function (err) { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(true); + } + }; + } - self.conn.endTransaction(true, deferred ? onEndTransaction : cb); //rollback - self.conn.inTransaction = false; + self.conn.endTransaction(true, deferred ? onEndTransaction : cb); //rollback + self.conn.inTransaction = false; - return deferred ? deferred.promise : self; + return deferred ? deferred.promise : self; }; -Database.prototype.beginTransactionSync = function () -{ - var self = this; +Database.prototype.beginTransactionSync = function () { + const self = this; - self.conn.beginTransactionSync(); - self.conn.inTransaction = true; + self.conn.beginTransactionSync(); + self.conn.inTransaction = true; - return self; + return self; }; -Database.prototype.endTransactionSync = function (rollback) -{ - var self = this; +Database.prototype.endTransactionSync = function (rollback) { + const self = this; - self.conn.endTransactionSync(rollback); - self.conn.inTransaction = false; + self.conn.endTransactionSync(rollback); + self.conn.inTransaction = false; - return self; + return self; }; -Database.prototype.commitTransactionSync = function () -{ - var self = this; +Database.prototype.commitTransactionSync = function () { + const self = this; - self.conn.endTransactionSync(false); //don't rollback - self.conn.inTransaction = false; + self.conn.endTransactionSync(false); //don't rollback + self.conn.inTransaction = false; - return self; + return self; }; -Database.prototype.rollbackTransactionSync = function () -{ - var self = this; +Database.prototype.rollbackTransactionSync = function () { + const self = this; - self.conn.endTransactionSync(true); //rollback - self.conn.inTransaction = false; + self.conn.endTransactionSync(true); //rollback + self.conn.inTransaction = false; - return self; + return self; }; -Database.prototype.columns = function(catalog, schema, table, column, callback) -{ - var self = this; - if (!self.queue) self.queue = []; - - callback = callback || arguments[arguments.length - 1]; - - self.queue.push(function (next) - { - self.conn.columns(catalog, schema, table, column, function (err, result) - { - if (err) return callback(err, [], false); - - result.fetchAll(function (err, data) - { - result.closeSync(); - callback && callback(err, data); - return next(); - }); +Database.prototype.columns = function (catalog, schema, table, column, callback) { + const self = this; + if (!self.queue) self.queue = []; + + callback = callback || arguments[arguments.length - 1]; + + self.queue.push(function (next) { + self.conn.columns(catalog, schema, table, column, function (err, result) { + if (err) return callback(err, [], false); + + result.fetchAll(function (err, data) { + result.closeSync(); + callback && callback(err, data); + return next(); + }); + }); }); - }); }; -Database.prototype.tables = function(catalog, schema, table, type, callback) -{ - var self = this; - if (!self.queue) self.queue = []; - - callback = callback || arguments[arguments.length - 1]; - - self.queue.push(function (next) - { - self.conn.tables(catalog, schema, table, type, function (err, result) - { - if (err) return callback(err, [], false); - - result.fetchAll(function (err, data) - { - result.closeSync(); - callback && callback(err, data); - return next(); - }); +Database.prototype.tables = function (catalog, schema, table, type, callback) { + const self = this; + if (!self.queue) self.queue = []; + + callback = callback || arguments[arguments.length - 1]; + + self.queue.push(function (next) { + self.conn.tables(catalog, schema, table, type, function (err, result) { + if (err) return callback(err, [], false); + + result.fetchAll(function (err, data) { + result.closeSync(); + callback && callback(err, data); + return next(); + }); + }); }); - }); }; -Database.prototype.describe = function(obj, callback) -{ - var self = this; - - if (typeof(callback) !== "function") - { - throw({ - error : "[node-odbc] Missing Arguments", - message : "You must specify a callback function in order " + - "for the describe method to work." - }); +Database.prototype.describe = function (obj, callback) { + const self = this; - return false; - } - - if (typeof(obj) !== "object") - { - callback({ - error : "[node-odbc] Missing Arguments", - message : "You must pass an object as argument 0 if you want " + - "anything productive to happen in the describe method." - }, []); - - return false; - } - - if (!obj.database) - { - callback({ - error : "[node-odbc] Missing Arguments", - message : "The object you passed did not contain a database " + - "property. This is required for the describe method to work." - }, []); - - return false; - } - - //set some defaults if they weren't passed - obj.schema = obj.schema || "%"; - obj.type = obj.type || "table"; - - if (obj.table && obj.column) - { - //get the column details - self.columns(obj.database, obj.schema, obj.table, obj.column, callback); - } - else if (obj.table) - { - //get the columns in the table - self.columns(obj.database, obj.schema, obj.table, "%", callback); - } - else - { - //get the tables in the database - self.tables(obj.database, obj.schema, null, obj.type || "table", callback); - } -}; //Database.describe + if (typeof (callback) !== "function") { + throw ({ + error: "[node-odbc] Missing Arguments", + message: "You must specify a callback function in order " + "for the describe method to work." + }); + } -Database.prototype.prepare = function (sql, cb) -{ - var self = this, deferred; - - if(!cb) - { - deferred = Q.defer(); - } - - self.conn.createStatement(function (err, stmt) - { - if(err) - { - if(cb) - { - return cb(err); - } else - { - deferred.reject(err); - } + if (typeof (obj) !== "object") { + callback({ + error: "[node-odbc] Missing Arguments", + message: "You must pass an object as argument 0 if you want " + "anything productive to happen in the describe method." + }, []); + + return false; } - stmt.queue = new SimpleQueue(); + if (!obj.database) { + callback({ + error: "[node-odbc] Missing Arguments", + message: "The object you passed did not contain a database " + "property. This is required for the describe method to work." + }, []); - stmt.prepare(sql, function (err) - { - if (err) - { - if(cb) - { - return cb(err); - } else - { - deferred.reject(err) + return false; + } + + //set some defaults if they weren't passed + obj.schema = obj.schema || "%"; + obj.type = obj.type || "table"; + + if (obj.table && obj.column) { + //get the column details + self.columns(obj.database, obj.schema, obj.table, obj.column, callback); + } else if (obj.table) { + //get the columns in the table + self.columns(obj.database, obj.schema, obj.table, "%", callback); + } else { + //get the tables in the database + self.tables(obj.database, obj.schema, null, obj.type || "table", callback); + } +}; //Database.describe + +Database.prototype.prepare = function (sql, cb) { + const self = this; + let deferred; + + if (!cb) { + deferred = Q.defer(); + } + + self.conn.createStatement(function (err, stmt) { + if (err) { + if (cb) { + return cb(err); + } else { + deferred.reject(err); + } } - } - deferred ? deferred.resolve(stmt) : cb(null, stmt); + stmt.queue = new SimpleQueue(); + + stmt.prepare(sql, function (err) { + if (err) { + if (cb) { + return cb(err); + } else { + deferred.reject(err) + } + } + + deferred ? deferred.resolve(stmt) : cb(null, stmt); + }); }); - }); - return deferred ? deferred.promise : null; + return deferred ? deferred.promise : null; }; -Database.prototype.prepareSync = function (sql) -{ - var self = this; +Database.prototype.prepareSync = function (sql) { + const self = this; - var stmt = self.conn.createStatementSync(); + const stmt = self.conn.createStatementSync(); - stmt.queue = new SimpleQueue(); + stmt.queue = new SimpleQueue(); - stmt.prepareSync(sql); + stmt.prepareSync(sql); - return stmt; + return stmt; }; -Database.prototype.setIsolationLevel = function(isolationLevel) -{ - var self = this; - return (self.conn.setIsolationLevel(isolationLevel)); +Database.prototype.setIsolationLevel = function (isolationLevel) { + const self = this; + return (self.conn.setIsolationLevel(isolationLevel)); }; //Proxy all of the ODBCStatement functions so that they are queued @@ -1122,422 +920,328 @@ odbc.ODBCStatement.prototype._prepare = odbc.ODBCStatement.prototype.prepare; odbc.ODBCStatement.prototype._bind = odbc.ODBCStatement.prototype.bind; odbc.ODBCStatement.prototype._bindSync = odbc.ODBCStatement.prototype.bindSync; -odbc.ODBCStatement.prototype.execute = function (params, cb) -{ - var self = this, deferred; - // promises logic - if (!cb && typeof params !== 'function') - { - deferred = Q.defer(); - } - - self.queue = self.queue || new SimpleQueue(); - - if (!cb && typeof params === 'function') - { - cb = params; - params = null; - } - - self.queue.push(function (next) { - //If params were passed to this function, then bind them and - //then execute. - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) - { - if(!deferred) - { - cb(err); - } else - { - deferred.reject(err); - } - } - } - self._bind(params, function (err) { - if (err) { - if(!deferred) - { - cb(err); - } else - { - deferred.reject(err); - } - return next(); - } +odbc.ODBCStatement.prototype.execute = function (params, cb) { + const self = this; + let deferred; + // promises logic + if (!cb && typeof params !== 'function') { + deferred = Q.defer(); + } - self._execute(function (err, result, outparams) { - if(!deferred) - { - cb(err, result, outparams); - } else - { - if(err) - { - deferred.reject(err); - } else - { - deferred.resolve(result, outparams); - } - } + self.queue = self.queue || new SimpleQueue(); - return next(); - }); - }); + if (!cb && typeof params === 'function') { + cb = params; + params = null; } - //Otherwise execute and pop the next bind call - else - { - self._execute(function (err, result, outparams) { - if(!deferred) - { - cb(err, result, outparams); - } else - { - if(err) - { - deferred.reject(err); - } else - { - deferred.resolve(result, outparams); - } + + self.queue.push(function (next) { + //If params were passed to this function, then bind them and + //then execute. + if (params) { + if (Array.isArray(params)) { + var err = parseParams(params); + if (err) { + if (!deferred) { + cb(err); + } else { + deferred.reject(err); + } + } + } + self._bind(params, function (err) { + if (err) { + if (!deferred) { + cb(err); + } else { + deferred.reject(err); + } + return next(); + } + + self._execute(function (err, result, outparams) { + if (!deferred) { + cb(err, result, outparams); + } else { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(result, outparams); + } + } + + return next(); + }); + }); } + //Otherwise execute and pop the next bind call + else { + self._execute(function (err, result, outparams) { + if (!deferred) { + cb(err, result, outparams); + } else { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(result, outparams); + } + } - //NOTE: We only execute the next queued bind call after - // we have called execute() or executeNonQuery(). This ensures - // that we don't call a bind() a bunch of times without ever - // actually executing that bind. Not - self.bindQueue && self.bindQueue.next(); + //NOTE: We only execute the next queued bind call after + // we have called execute() or executeNonQuery(). This ensures + // that we don't call a bind() a bunch of times without ever + // actually executing that bind. Not + self.bindQueue && self.bindQueue.next(); - return next(); - }); - } - }); - return deferred ? deferred.promise : null; + return next(); + }); + } + }); + return deferred ? deferred.promise : null; }; -odbc.ODBCStatement.prototype.executeSync = function (params) -{ - var self = this, err; - - //If params are passed to this function, first bind them and - //then execute. - if (params) - { - err = self.bindSync(params); - if(err !== true) console.log(err); - } - return self._executeSync(); +odbc.ODBCStatement.prototype.executeSync = function (params) { + const self = this; + let err; + + //If params are passed to this function, first bind them and + //then execute. + if (params) { + err = self.bindSync(params); + if (err !== true) console.log(err); + } + return self._executeSync(); }; -function parseParams(params) -{ - var err, prm, paramtype, ctype, sqltype, datatype, data, len; - for (var i = 0; i < params.length; i++) - { - if(Object.prototype.toString.call(params[i]) == "[object Object]") - { +function parseParams(params) { + let err, prm, paramtype, ctype, sqltype, len; + for (let i = 0; i < params.length; i++) { + if (Object.prototype.toString.call(params[i]) === "[object Object]") { //{ParamType:"INPUT", DataType:"BLOB", Data:imgfile} //{"ParamType":"INPUT", CType:"BINARY", SQLType:"BLOB",Data:imgfile} - paramtype = 1; ctype = undefined; sqltype = undefined; - datatype = undefined; data = undefined, len = 0; + paramtype = 1; + ctype = undefined; + sqltype = undefined; + len = 0; prm = params[i]; - if(prm.ParamType) - { - if(Number.isInteger(prm.ParamType)) - { - if(prm.ParamType > 0 && prm.ParamType < 5) - paramtype = prm.ParamType; - } - else if(prm.ParamType == "OUTPUT") - paramtype = 4; // SQL_PARAM_OUTPUT - else if(prm.ParamType == "INOUT") - paramtype = 2; // SQL_PARAM_INPUT_OUTPUT - else if(prm.ParamType == "FILE") - paramtype = 3; // SQLBindFileToParam() + if (prm.ParamType) { + if (Number.isInteger(prm.ParamType)) { + if (prm.ParamType > 0 && prm.ParamType < 5) paramtype = prm.ParamType; + } else if (prm.ParamType === "OUTPUT") paramtype = 4; // SQL_PARAM_OUTPUT + else if (prm.ParamType === "INOUT") paramtype = 2; // SQL_PARAM_INPUT_OUTPUT + else if (prm.ParamType === "FILE") paramtype = 3; // SQLBindFileToParam() } - if(prm.CType) - { - if(Number.isInteger(prm.CType)) - { + if (prm.CType) { + if (Number.isInteger(prm.CType)) { ctype = prm.CType; - } - else if(prm.CType == "CHAR") - ctype = 1; - else if(prm.CType == "BINARY") - ctype = -2; - else if(prm.CType == "INTEGER") - ctype = 4; + } else if (prm.CType === "CHAR") ctype = 1; else if (prm.CType === "BINARY") ctype = -2; else if (prm.CType === "INTEGER") ctype = 4; } // Either SQLType or DataType must be entered. // If SQLType is used, DataType will be ignored. - if(prm.SQLType || prm.DataType) - { - var type = prm.SQLType || prm.DataType; - if(Number.isInteger(type)) - { + if (prm.SQLType || prm.DataType) { + const type = prm.SQLType || prm.DataType; + if (Number.isInteger(type)) { sqltype = type; - } - else if(type == "CHAR") - { + } else if (type === "CHAR") { sqltype = 1; // SQL_CHAR - if(!ctype) ctype = sqltype; - } - else if(type == "BINARY") - { + if (!ctype) ctype = sqltype; + } else if (type === "BINARY") { sqltype = -2; - if(!ctype) ctype = sqltype; - } - else if((type == "BLOB") || (type == "BYTE")) - { + if (!ctype) ctype = sqltype; + } else if ((type === "BLOB") || (type === "BYTE")) { sqltype = -4; //SQL_LONGVARBINARY - if(!ctype) ctype = -2; // SQL_C_BINARY - } - else if((type == "CLOB") || (type == "TEXT")) - { + if (!ctype) ctype = -2; // SQL_C_BINARY + } else if ((type === "CLOB") || (type === "TEXT")) { sqltype = -1; //SQL_LONGVARCHAR - if(!ctype) ctype = 1 ; //SQL_C_CHAR - } - else if(type == "XML") - { + if (!ctype) ctype = 1; //SQL_C_CHAR + } else if (type === "XML") { sqltype = -370; - if(!ctype) ctype = 1; - } - else if(type == "GRAPHIC") - { + if (!ctype) ctype = 1; + } else if (type === "GRAPHIC") { sqltype = -95; - if(!ctype) ctype = -99; //SQL_C_DBCHAR - } - else if(type == "VARGRAPHIC") - { + if (!ctype) ctype = -99; //SQL_C_DBCHAR + } else if (type === "VARGRAPHIC") { sqltype = -96; - if(!ctype) ctype = -99; //SQL_C_DBCHAR - } - else if(type == "LONGGRAPHIC") - { + if (!ctype) ctype = -99; //SQL_C_DBCHAR + } else if (type === "LONGGRAPHIC") { sqltype = -97; - if(!ctype) ctype = -99; //SQL_C_DBCHAR + if (!ctype) ctype = -99; //SQL_C_DBCHAR } } - if(prm.Length > 0 && Number.isInteger(prm.Length)) - { + if (prm.Length > 0 && Number.isInteger(prm.Length)) { len = prm.Length; } - if(prm.Data === undefined ) - { + if (prm.Data === undefined) { err = "odbc.js:parseParams =>Data is missing from " + JSON.stringify(prm); break; } - if(Number.isInteger(prm.Data)) - { - if(!ctype) ctype = 4; // SQL_C_SBIGINT - if(!sqltype) sqltype = 4; // SQL_BIGINT + if (Number.isInteger(prm.Data)) { + if (!ctype) ctype = 4; // SQL_C_SBIGINT + if (!sqltype) sqltype = 4; // SQL_BIGINT - } - else if( (paramtype == 4) && (prm.Data === "") ) - { + } else if ((paramtype === 4) && (prm.Data === "")) { prm.Data = "abc"; } - if(!ctype) ctype = 1; - if(!sqltype) sqltype = 1; - if(paramtype == 3) // For BindFileToParam() - { - err = "odbc.js:parseParams => DataType FILE is not supported " ; + if (!ctype) ctype = 1; + if (!sqltype) sqltype = 1; + if (paramtype === 3) { // For BindFileToParam() + err = "odbc.js:parseParams => DataType FILE is not supported "; break; - ctype = 1; - if(!((sqltype == -98) || (sqltype == -99) || - (sqltype == -350) || (sqltype == -370))) - { - err = "odbc.js:parseParams => DataType is missing form " + prm; - break; - } } params[i] = [paramtype, ctype, sqltype, prm.Data, len]; } - // console.log(i + "!!!th param [paramtype, ctype, sqltype, prm.Data, len]= " + params[i]); + // console.log(i + "!!!th param [paramtype, ctype, sqltype, prm.Data, len]= " + params[i]); } return err; } -if(Number.isInteger === undefined) // node.js < v0.12.0 do not support isInteger +if (Number.isInteger === undefined) // node.js < v0.12.0 do not support isInteger { - Number.isInteger = function(x) - { - if((typeof x === 'number') && (x % 1 === 0)) return true; - else return false; + Number.isInteger = function (x) { + return (typeof x === 'number') && (x % 1 === 0); }; } -odbc.ODBCStatement.prototype.executeDirect = function (sql, cb) -{ - var self = this; +odbc.ODBCStatement.prototype.executeDirect = function (sql, cb) { + const self = this; - self.queue = self.queue || new SimpleQueue(); + self.queue = self.queue || new SimpleQueue(); - self.queue.push(function (next) { - self._executeDirect(sql, function (err, result) { - cb && cb(err, result); + self.queue.push(function (next) { + self._executeDirect(sql, function (err, result) { + cb && cb(err, result); - return next(); + return next(); + }); }); - }); }; -odbc.ODBCStatement.prototype.executeNonQuery = function (params, cb) -{ - var self = this, deferred; - - if (!cb && typeof params !== 'function') - { - deferred = Q.defer(); - } - self.queue = self.queue || new SimpleQueue(); - - if (!cb) - { - cb = params; - params = null; - } - - self.queue.push(function (next) { - //If params were passed to this function, then bind them and - //then executeNonQuery. - if (params) - { - if(Array.isArray(params)) - { - var err = parseParams(params); - if(err) - { - if(!deferred) - { - cb && cb(err); - } - else - { - deferred.reject(err); - } - } - } - self._bind(params, function (err) { - if (err) { - if(!deferred) - { - cb && cb(err) - } - else - { - deferred.reject(err); - } - return next(); - } +odbc.ODBCStatement.prototype.executeNonQuery = function (params, cb) { + const self = this; + let deferred; - self._executeNonQuery(function (err, result) { - if(!deferred) - { - cb && cb(err, result); - } - else - { - if(err) - { - deferred.reject(err); - } - else - { - deferred.resolve(result); - } - } - return next(); - }); - }); + if (!cb && typeof params !== 'function') { + deferred = Q.defer(); } - //Otherwise executeNonQuery and pop the next bind call - else { - self._executeNonQuery(function (err, result) { - if(!deferred) - { - cb && cb(err, result); - } - else - { - if(err) - { - deferred.reject(err); - } - else - { - deferred.resolve(result); - } + self.queue = self.queue || new SimpleQueue(); + + if (!cb) { + cb = params; + params = null; + } + + self.queue.push(function (next) { + //If params were passed to this function, then bind them and + //then executeNonQuery. + if (params) { + if (Array.isArray(params)) { + const err = parseParams(params); + if (err) { + if (!deferred) { + cb && cb(err); + } else { + deferred.reject(err); + } + } + } + self._bind(params, function (err) { + if (err) { + if (!deferred) { + cb && cb(err) + } else { + deferred.reject(err); + } + return next(); + } + + self._executeNonQuery(function (err, result) { + if (!deferred) { + cb && cb(err, result); + } else { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(result); + } + } + return next(); + }); + }); } + //Otherwise executeNonQuery and pop the next bind call + else { + self._executeNonQuery(function (err, result) { + if (!deferred) { + cb && cb(err, result); + } else { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(result); + } + } - //NOTE: We only execute the next queued bind call after - // we have called execute() or executeNonQuery(). This ensures - // that we don't call a bind() a bunch of times without ever - // actually executing that bind. Not - self.bindQueue && self.bindQueue.next(); + //NOTE: We only execute the next queued bind call after + // we have called execute() or executeNonQuery(). This ensures + // that we don't call a bind() a bunch of times without ever + // actually executing that bind. Not + self.bindQueue && self.bindQueue.next(); - return next(); - }); - } - }); - return deferred ? deferred.promise : null; + return next(); + }); + } + }); + return deferred ? deferred.promise : null; }; odbc.ODBCStatement.prototype.prepare = function (sql, cb) { - var self = this; + const self = this; - self.queue = self.queue || new SimpleQueue(); + self.queue = self.queue || new SimpleQueue(); - self.queue.push(function (next) { - self._prepare(sql, function (err) { - cb && cb(err); + self.queue.push(function (next) { + self._prepare(sql, function (err) { + cb && cb(err); - return next(); + return next(); + }); }); - }); }; // Function to bind parameters before execute or executeSync odbc.ODBCStatement.prototype.bind = function (ary, cb) { - var self = this; + const self = this; - self.bindQueue = self.bindQueue || new SimpleQueue(); + self.bindQueue = self.bindQueue || new SimpleQueue(); - self.bindQueue.push(function () { - if(Array.isArray(ary)) - { - var err = parseParams(ary); - if(err && cb) cb(err); - } - self._bind(ary, function (err) { - cb && cb(err); + self.bindQueue.push(function () { + if (Array.isArray(ary)) { + var err = parseParams(ary); + if (err && cb) cb(err); + } + self._bind(ary, function (err) { + cb && cb(err); - //NOTE: we do not call next() here because - //we want to pop the next bind call only - //after the next execute call + //NOTE: we do not call next() here because + //we want to pop the next bind call only + //after the next execute call + }); }); - }); }; // Async Function to bind parameters before execute or executeSync odbc.ODBCStatement.prototype.bindSync = function (ary) { - var self = this; - if(Array.isArray(ary)) - { - var err = parseParams(ary); - if(err) return false; + const self = this; + if (Array.isArray(ary)) { + const err = parseParams(ary); + if (err) return false; } - return self._bindSync(ary); + return self._bindSync(ary); }; @@ -1545,220 +1249,183 @@ module.exports.Pool = Pool; Pool.count = 0; -function Pool (_options) { - var self = this; - self.options = {}; - self.maxPoolSize = 0; - if(_options) - { - if(_options.idleTimeout && !isNaN(_options.idleTimeout)) - self.options.idleTimeout = _options.idleTimeout; - if(_options.autoCleanIdle) - self.options.autoCleanIdle = _options.autoCleanIdle; - if(_options.maxPoolSize) - self.maxPoolSize = _options.maxPoolSize; - if(_options.connectTimeout) - self.options.connectTimeout = _options.connectTimeout; - if(_options.systemNaming) - self.options.systemNaming=_options.systemNaming; - } - self.index = Pool.count++; - self.availablePool = {}; - self.usedPool = {}; - self.poolSize = 0; - self.queue = self.queue || new SimpleQueue(); - self.queue.executing = true; // Do not call next, untill next is called by db.close(); - if(!ENV) ENV = new odbc.ODBC(); - self.odbc = ENV; - self.options.connectTimeout = self.options.connectTimeout || 60; +function Pool(_options) { + const self = this; + self.options = {}; + self.maxPoolSize = 0; + if (_options) { + if (_options.idleTimeout && !isNaN(_options.idleTimeout)) self.options.idleTimeout = _options.idleTimeout; + if (_options.autoCleanIdle) self.options.autoCleanIdle = _options.autoCleanIdle; + if (_options.maxPoolSize) self.maxPoolSize = _options.maxPoolSize; + if (_options.connectTimeout) self.options.connectTimeout = _options.connectTimeout; + if (_options.systemNaming) self.options.systemNaming = _options.systemNaming; + } + self.index = Pool.count++; + self.availablePool = {}; + self.usedPool = {}; + self.poolSize = 0; + self.queue = self.queue || new SimpleQueue(); + self.queue.executing = true; // Do not call next, untill next is called by db.close(); + if (!ENV) ENV = new odbc.ODBC(); + self.odbc = ENV; + self.options.connectTimeout = self.options.connectTimeout || 60; } -Pool.prototype.open = function (connStr, callback) -{ - var self = this - , db - ; - - //check to see if we already have a connection for this connection string - if (self.availablePool[connStr] && self.availablePool[connStr].length) - { - db = self.availablePool[connStr].shift(); - db.lastUsed=null; - self.usedPool[connStr] = self.usedPool[connStr] || []; - self.usedPool[connStr].push(db); - callback && callback(null, db); - } - else if((self.maxPoolSize > 0) && (self.poolSize >= self.maxPoolSize)) - { - // Move it to queue untill an existing connection is not closed. - // Call it from db.close() version of pool.open and pool.init. - self.queue.push(function (next) { - if (self.availablePool[connStr] && self.availablePool[connStr].length) - { +Pool.prototype.open = function (connStr, callback) { + const self = this; + let db; + + //check to see if we already have a connection for this connection string + if (self.availablePool[connStr] && self.availablePool[connStr].length) { db = self.availablePool[connStr].shift(); - db.lastUsed=null; + db.lastUsed = null; self.usedPool[connStr] = self.usedPool[connStr] || []; self.usedPool[connStr].push(db); callback && callback(null, db); - } - }); - } - else - { - if(typeof(self.options.odbc) === undefined) - self.options.odbc = self.odbc; - db = new Database(self.options); - self.poolSize++; - - db.realClose = db.close; - db.close = function (cb) - { - var db = this; - self.availablePool[connStr] = self.availablePool[connStr] || []; - // If conn.close is called more than once for this connection, - // nothing to do. Just call the callback function and return. - if( self.availablePool[connStr] && - self.availablePool[connStr].indexOf(db) >= 0 ) - { - cb && cb(null); - return; - } - db.lastUsed = Date.now(); - - // If this connection has some active transaction, rollback the - // transaction to free up the held resorces before moving back to - // the pool. So that, next request can get afresh connection from pool. - if(db.conn && db.conn.inTransaction) - { - db.rollbackTransaction(function(err){}); - } - - //remove this db from the usedPool - self.usedPool[connStr].splice(self.usedPool[connStr].indexOf(db), 1); - self.poolSize--; - - //move this connection back to the connection pool at the end. - if(db.conn) - { - self.availablePool[connStr].push(db); + } else if ((self.maxPoolSize > 0) && (self.poolSize >= self.maxPoolSize)) { + // Move it to queue until an existing connection is not closed. + // Call it from db.close() version of pool.open and pool.init. + self.queue.push(function () { + if (self.availablePool[connStr] && self.availablePool[connStr].length) { + db = self.availablePool[connStr].shift(); + db.lastUsed = null; + self.usedPool[connStr] = self.usedPool[connStr] || []; + self.usedPool[connStr].push(db); + callback && callback(null, db); + } + }); + } else { + if (typeof self.options.odbc === 'undefined') self.options.odbc = self.odbc; + db = new Database(self.options); self.poolSize++; - } - cb && cb(null); - - if(db.conn && self.options.autoCleanIdle) self.cleanUp(connStr); - if(exports.debug) { - process.stdout.write(getElapsedTime()); - console.log(util.inspect(self, {depth: null})); - } - return self.queue.next(); - }; // db.close function - - db.open(connStr, function (error) { - exports.debug && console.log("%s odbc.js : pool[%s] : pool.db.open new connection.", getElapsedTime(), self.index); - if(error) - { - self.poolSize--; - } - else - { - self.usedPool[connStr] = self.usedPool[connStr] || []; - db.created = Date.now(); - self.usedPool[connStr].push(db); - } - callback && callback(error, db); - }); //db.open - } -}; -Pool.prototype.init = function(count, connStr) -{ - var self = this; - var ret = false; - - //check to see if we already have a connection for this connection string - if (self.availablePool[connStr] && self.availablePool[connStr].length) - { - console.log("Pool is already initialized and it has "+ - self.availablePool[connStr].length + " available connections.\n"); - return; - } - else - { - if((self.maxPoolSize > 0) && (count > self.maxPoolSize)) - { - console.log(getElapsedTime(), " ** Can not open connection more than max pool size.\n"); - count = self.maxPoolSize; - } + db.realClose = db.close; + db.close = function (cb) { + const db = this; + self.availablePool[connStr] = self.availablePool[connStr] || []; + // If conn.close is called more than once for this connection, + // nothing to do. Just call the callback function and return. + if (self.availablePool[connStr] && self.availablePool[connStr].indexOf(db) >= 0) { + cb && cb(null); + return; + } + db.lastUsed = Date.now(); + + // If this connection has some active transaction, rollback the + // transaction to free up the held resorces before moving back to + // the pool. So that, next request can get afresh connection from pool. + if (db.conn && db.conn.inTransaction) { + db.rollbackTransaction(function () { + }); + } - if(typeof(self.options.odbc) === undefined) - self.options.odbc = self.odbc; - for(var i = 0; i < count; i++) - { - var db = new Database(self.options); - self.poolSize++; - try{ - ret = db.openSync(connStr); - } catch (ret) { + //remove this db from the usedPool + self.usedPool[connStr].splice(self.usedPool[connStr].indexOf(db), 1); self.poolSize--; - exports.debug && console.log("%s odbc.js: %d connection(s) initialized.\n", getElapsedTime(), self.poolSize); - return ret; - } - if(ret !== true) break; - exports.debug && console.log("%s odbc.js : pool[%s] : pool.init %d", getElapsedTime(), self.index, i); - self.availablePool[connStr] = self.availablePool[connStr] || []; - db.created = Date.now(); + //move this connection back to the connection pool at the end. + if (db.conn) { + self.availablePool[connStr].push(db); + self.poolSize++; + } + cb && cb(null); - db.realClose = db.close; - db.close = function (cb) - { - var db = this; - self.availablePool[connStr] = self.availablePool[connStr] || []; - // If conn.close is called more than once for this connection, - // nothing to do. Just call the callback function and return. - if( self.availablePool[connStr] && - self.availablePool[connStr].indexOf(db) >= 0 ) - { - cb && cb(null); - return; - } - db.lastUsed = Date.now(); - if(db.conn && db.conn.inTransaction) - { - db.rollbackTransaction(function(err){}); - } - self.usedPool[connStr].splice(self.usedPool[connStr].indexOf(db), 1); - self.poolSize--; - if(db.conn) - { - self.availablePool[connStr].push(db); - self.poolSize++; - } - if(cb) cb(null); - if(db.conn && self.options.autoCleanIdle) self.cleanUp(connStr); - return self.queue.next(); + if (db.conn && self.options.autoCleanIdle) self.cleanUp(connStr); + if (exports.debug) { + process.stdout.write(getElapsedTime()); + console.log(util.inspect(self, {depth: null})); + } + return self.queue.next(); }; // db.close function - self.availablePool[connStr].push(db); + + db.open(connStr, function (error) { + exports.debug && console.log("%s odbc.js : pool[%s] : pool.db.open new connection.", getElapsedTime(), self.index); + if (error) { + self.poolSize--; + } else { + self.usedPool[connStr] = self.usedPool[connStr] || []; + db.created = Date.now(); + self.usedPool[connStr].push(db); + } + callback && callback(error, db); + }); //db.open + } +}; + +Pool.prototype.init = function (count, connStr) { + const self = this; + let ret = false; + + //check to see if we already have a connection for this connection string + if (self.availablePool[connStr] && self.availablePool[connStr].length) { + console.log("Pool is already initialized and it has " + self.availablePool[connStr].length + " available connections.\n"); + + } else { + if ((self.maxPoolSize > 0) && (count > self.maxPoolSize)) { + console.log(getElapsedTime(), " ** Can not open connection more than max pool size.\n"); + count = self.maxPoolSize; + } + + if (typeof self.options.odbc === 'undefined') self.options.odbc = self.odbc; + for (let i = 0; i < count; i++) { + const db = new Database(self.options); + self.poolSize++; + try { + ret = db.openSync(connStr); + } catch (ret) { + self.poolSize--; + exports.debug && console.log("%s odbc.js: %d connection(s) initialized.\n", getElapsedTime(), self.poolSize); + return ret; + } + if (ret !== true) break; + exports.debug && console.log("%s odbc.js : pool[%s] : pool.init %d", getElapsedTime(), self.index, i); + + self.availablePool[connStr] = self.availablePool[connStr] || []; + db.created = Date.now(); + + db.realClose = db.close; + db.close = function (cb) { + const db = this; + self.availablePool[connStr] = self.availablePool[connStr] || []; + // If conn.close is called more than once for this connection, + // nothing to do. Just call the callback function and return. + if (self.availablePool[connStr] && self.availablePool[connStr].indexOf(db) >= 0) { + cb && cb(null); + return; + } + db.lastUsed = Date.now(); + if (db.conn && db.conn.inTransaction) { + db.rollbackTransaction(function () {}); + } + self.usedPool[connStr].splice(self.usedPool[connStr].indexOf(db), 1); + self.poolSize--; + if (db.conn) { + self.availablePool[connStr].push(db); + self.poolSize++; + } + if (cb) cb(null); + if (db.conn && self.options.autoCleanIdle) self.cleanUp(connStr); + return self.queue.next(); + }; // db.close function + self.availablePool[connStr].push(db); + } + self.usedPool[connStr] = self.usedPool[connStr] || []; + exports.debug && console.log(getElapsedTime(), "Max pool size = " + self.maxPoolSize); + return ret; } - self.usedPool[connStr] = self.usedPool[connStr] || []; - exports.debug && console.log(getElapsedTime(), "Max pool size = " + self.maxPoolSize); - return ret; - } };// Pool.init() // No of active connections in pool should not grow more than maxPoolSize. // Run test/test-max-pool-size.js to test this functionality. -Pool.prototype.setMaxPoolSize = function(size) -{ - var self = this; +Pool.prototype.setMaxPoolSize = function (size) { + const self = this; self.maxPoolSize = size; return true; }; -Pool.prototype.setConnectTimeout = function(timeout) -{ +Pool.prototype.setConnectTimeout = function () { // Don't use this API. Will be removed in next major release. - // It is just a place holder as of now to avoid breaking of + // It is just a placeholder as of now to avoid breaking of // existing applications that uses it. // Now there is no timeout for connection request from pool. @@ -1770,119 +1437,92 @@ Pool.prototype.setConnectTimeout = function(timeout) }; // Close idle connections -Pool.prototype.cleanUp = function(connStr) { - var self = this; - if(self.availablePool[connStr].length < 2) return; - - self.availablePool[connStr] = self.availablePool[connStr].filter(function(conn) - { - if(conn.lastUsed && - (Date.now()-conn.lastUsed > (self.options.idleTimeout || 1800 * 1000)) && - conn.realClose ) - { - conn.realClose(function() - { - if(self.poolSize) self.poolSize--; - exports.debug && console.log("odbc.js : pool[%s] : Pool.cleanUp() : " + - "pool.realClose() : Connection duration : %s", self.index, - (Date.now() - conn.created)/1000); - }); - return false; - } - else - { - return true; - } - }); +Pool.prototype.cleanUp = function (connStr) { + const self = this; + if (self.availablePool[connStr].length < 2) return; + + self.availablePool[connStr] = self.availablePool[connStr].filter(function (conn) { + if (conn.lastUsed && (Date.now() - conn.lastUsed > (self.options.idleTimeout || 1800 * 1000)) && conn.realClose) { + conn.realClose(function () { + if (self.poolSize) self.poolSize--; + exports.debug && console.log("odbc.js : pool[%s] : Pool.cleanUp() : " + "pool.realClose() : Connection duration : %s", self.index, (Date.now() - conn.created) / 1000); + }); + return false; + } else { + return true; + } + }); }; //Pool.cleanUp() -Pool.prototype.close = function (callback) -{ - var self = this - , required = 0 - , received = 0 - , connections - , key - , x - ; - - exports.debug && console.log("%s odbc.js : pool[%s] : pool.close()", getElapsedTime(), self.index); - //we set a timeout because a previous db.close() may - //have caused the a behind the scenes db.open() to prepare - //a new connection - setTimeout(function () { - //merge the available pool and the usedPool - var pools = {}; - - for (key in self.availablePool) - { - pools[key] = (pools[key] || []).concat(self.availablePool[key]); - } +Pool.prototype.close = function (callback) { + let self = this, required = 0, received = 0, connections, key, x; - for (key in self.usedPool) - { - pools[key] = (pools[key] || []).concat(self.usedPool[key]); - } + exports.debug && console.log("%s odbc.js : pool[%s] : pool.close()", getElapsedTime(), self.index); + //we set a timeout because a previous db.close() may + //have caused the a behind the scenes db.open() to prepare + //a new connection + setTimeout(function () { + //merge the available pool and the usedPool + const pools = {}; - exports.debug && console.log("%s odbc.js : pool[%s] : pool.close() - setTimeout() callback", getElapsedTime(), self.index); - //console.dir(pools); + for (key in self.availablePool) { + pools[key] = (pools[key] || []).concat(self.availablePool[key]); + } - if (Object.keys(pools).length === 0) - { - if (callback) return callback(); - else return null; - } + for (key in self.usedPool) { + pools[key] = (pools[key] || []).concat(self.usedPool[key]); + } - for (key in pools) - { - connections = pools[key]; - required += connections.length; - - if(exports.debug) { - console.log("%s odbc.js : pool[%s] : pool.close() - processing pools %s - connections: %s", - getElapsedTime(), self.index, key, connections.length); - } - - for (x = 0 ; x < connections.length; x ++) - { - (function (x) { - //call the realClose method to avoid - //automatically re-opening the connection - if(exports.debug) { - console.log("%s odbc.js : pool[%s] : pool.close() - calling realClose() for connection #%s", - getElapsedTime(), self.index, x); - } - - if(connections[x].realClose) { - connections[x].realClose(function () { - if(exports.debug) { - console.log("%s odbc.js : pool[%s] : pool.close() - realClose() callback for connection #%s", - getElapsedTime(), self.index, x); - } - module.exports.close(connections[x]); - received += 1; - if(self.poolSize) self.poolSize--; - - if (received === required) - { - if(callback) callback(); - - //prevent mem leaks - self = null; - connections = null; - required = null; - received = null; - key = null; - - return; + exports.debug && console.log("%s odbc.js : pool[%s] : pool.close() - setTimeout() callback", getElapsedTime(), self.index); + //console.dir(pools); + + if (Object.keys(pools).length === 0) { + if (callback) return callback(); else return null; + } + + for (key in pools) { + connections = pools[key]; + required += connections.length; + + if (exports.debug) { + console.log("%s odbc.js : pool[%s] : pool.close() - processing pools %s - connections: %s", getElapsedTime(), self.index, key, connections.length); } - }); // connections[x].realClose i.e. conn.close(). - } - else { - exports.debug && console.log("%s realClose is not a member of connection %s", getElapsedTime(), x); - } - })(x); - } //for loop. - } //for (key in pools) - }, 2000); //setTimeout + + for (x = 0; x < connections.length; x++) { + (function (x) { + //call the realClose method to avoid + //automatically re-opening the connection + if (exports.debug) { + console.log("%s odbc.js : pool[%s] : pool.close() - calling realClose() for connection #%s", getElapsedTime(), self.index, x); + } + + if (connections[x].realClose) { + connections[x].realClose(function () { + if (exports.debug) { + console.log("%s odbc.js : pool[%s] : pool.close() - realClose() callback for connection #%s", getElapsedTime(), self.index, x); + } + module.exports.close(connections[x]); + received += 1; + if (self.poolSize) self.poolSize--; + + if (received === required) { + if (callback) callback(); + + //prevent mem leaks + self = null; + connections = null; + required = null; + received = null; + key = null; + + + } + }); // connections[x].realClose i.e. conn.close(). + } else { + exports.debug && console.log("%s realClose is not a member of connection %s", getElapsedTime(), x); + } + })(x); + } //for loop. + } //for (key in pools) + }, 2000); //setTimeout }; //Pool.close() diff --git a/lib/simple-queue.js b/lib/simple-queue.js index c12b3ac..9bbb368 100644 --- a/lib/simple-queue.js +++ b/lib/simple-queue.js @@ -1,47 +1,40 @@ module.exports = SimpleQueue; -function SimpleQueue() -{ - var self = this; - - self.fifo = []; - self.executing = false; +function SimpleQueue() { + const self = this; + + self.fifo = []; + self.executing = false; } -SimpleQueue.prototype.push = function (fn) -{ - var self = this; - - self.fifo.push(fn); - - self.maybeNext(); +SimpleQueue.prototype.push = function (fn) { + const self = this; + + self.fifo.push(fn); + + self.maybeNext(); }; -SimpleQueue.prototype.maybeNext = function () -{ - var self = this; - - if (!self.executing) - { - self.next(); - } +SimpleQueue.prototype.maybeNext = function () { + const self = this; + + if (!self.executing) { + self.next(); + } }; -SimpleQueue.prototype.next = function () -{ - var self = this; - - if (self.fifo.length) - { - var fn = self.fifo.shift(); - - self.executing = true; - - fn(function () - { - self.executing = false; - - self.maybeNext(); - }); - } -}; \ No newline at end of file +SimpleQueue.prototype.next = function () { + const self = this; + + if (self.fifo.length) { + const fn = self.fifo.shift(); + + self.executing = true; + + fn(function () { + self.executing = false; + + self.maybeNext(); + }); + } +}; diff --git a/package-lock.json b/package-lock.json index 3037b06..cbffcb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2004 +1,1414 @@ { "name": "informixdb", "version": "2.2.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "ajv": { + "packages": { + "": { + "name": "informixdb", + "version": "2.2.1", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "q": "^1.5.1" + }, + "devDependencies": { + "@eslint/js": "^9.15.0", + "async": "^2.6.4", + "axios": "^1.7.7", + "bluebird": "^3.7.2", + "eslint": "^9.15.0", + "fstream": "^1.0.12", + "globals": "^15.12.0", + "moment": "^2.30.1", + "nan": "^2.22.0", + "targz": "^1.0.1", + "unzipper": "^0.12.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { + "dev": true, + "license": "MIT", + "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, - "dependencies": { - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - } + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" }, - "async": { + "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, - "requires": { + "license": "MIT", + "dependencies": { "lodash": "^4.17.14" } }, - "asynckit": { + "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, - "big-integer": { - "version": "1.6.43", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.43.tgz", - "integrity": "sha512-9dULc9jsKmXl0Aeunug8wbF+58n+hQoFjqClN7WeZwGLh0XJUWyJJ9Ee+Ep+Ql/J9fRsTVaeThp8MhiCCrY0Jg==" - }, - "binary": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", - "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", - "requires": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" + "node_modules/axios/node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" } }, - "bindings": { + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=", - "requires": { + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { "file-uri-to-path": "1.0.0" } }, - "bluebird": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", - "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==", - "dev": true + "node_modules/bl": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "license": "MIT" }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { + "dev": true, + "license": "MIT", + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "buffer-alloc": { + "node_modules/buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { + "dev": true, + "license": "MIT", + "dependencies": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" } }, - "buffer-alloc-unsafe": { + "node_modules/buffer-alloc-unsafe": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true, + "license": "MIT" }, - "buffer-fill": { + "node_modules/buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, - "buffer-indexof-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz", - "integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8=" + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "dev": true, + "license": "MIT" }, - "buffer-shims": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "buffers": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", - "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=" + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "license": "ISC" }, - "chainsaw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", - "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", - "requires": { - "traverse": ">=0.3.0 <0.4" + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "chownr": { + "node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "delayed-stream": { + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } }, - "duplexer2": { + "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "requires": { + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { "readable-stream": "^2.0.2" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "end-of-stream": { + "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { + "dev": true, + "license": "MIT", + "dependencies": { "once": "^1.4.0" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha1-Touo7i1Ivk99DeUFRVVI6uWTIEU=", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" + "node_modules/eslint": { + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.5", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" } }, - "inherits": { + "node_modules/esutils": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", "dependencies": { - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - } + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" } }, - "listenercount": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", - "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=" - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" } }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "requires": { - "minimist": "^1.2.5" - } - }, - "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "dev": true - }, - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" - }, - "npm": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-8.11.0.tgz", - "integrity": "sha512-4qmtwHa28J4SPmwCNoQI07KIF/ljmBhhuqG+xNXsIIRpwdKB5OXkMIGfH6KlThR6kzusxlkgR7t1haFDB88dcQ==", - "requires": { - "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^5.0.4", - "@npmcli/ci-detect": "^2.0.0", - "@npmcli/config": "^4.1.0", - "@npmcli/fs": "^2.1.0", - "@npmcli/map-workspaces": "^2.0.3", - "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^3.0.1", - "abbrev": "~1.1.1", - "archy": "~1.0.0", - "cacache": "^16.1.0", - "chalk": "^4.1.2", - "chownr": "^2.0.0", - "cli-columns": "^4.0.0", - "cli-table3": "^0.6.2", - "columnify": "^1.6.0", - "fastest-levenshtein": "^1.0.12", - "glob": "^8.0.1", - "graceful-fs": "^4.2.10", - "hosted-git-info": "^5.0.0", - "ini": "^3.0.0", - "init-package-json": "^3.0.2", - "is-cidr": "^4.0.2", - "json-parse-even-better-errors": "^2.3.1", - "libnpmaccess": "^6.0.2", - "libnpmdiff": "^4.0.2", - "libnpmexec": "^4.0.2", - "libnpmfund": "^3.0.1", - "libnpmhook": "^8.0.2", - "libnpmorg": "^4.0.2", - "libnpmpack": "^4.0.2", - "libnpmpublish": "^6.0.2", - "libnpmsearch": "^5.0.2", - "libnpmteam": "^4.0.2", - "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.1.5", - "minipass": "^3.1.6", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "mkdirp-infer-owner": "^2.0.0", - "ms": "^2.1.2", - "node-gyp": "^9.0.0", - "nopt": "^5.0.0", - "npm-audit-report": "^3.0.0", - "npm-install-checks": "^5.0.0", - "npm-package-arg": "^9.0.2", - "npm-pick-manifest": "^7.0.1", - "npm-profile": "^6.0.3", - "npm-registry-fetch": "^13.1.1", - "npm-user-validate": "^1.0.1", - "npmlog": "^6.0.2", - "opener": "^1.5.2", - "pacote": "^13.4.1", - "parse-conflict-json": "^2.0.2", - "proc-log": "^2.0.1", - "qrcode-terminal": "^0.12.0", - "read": "~1.0.7", - "read-package-json": "^5.0.1", - "read-package-json-fast": "^2.0.3", - "readdir-scoped-modules": "^1.1.0", - "rimraf": "^3.0.2", - "semver": "^7.3.7", - "ssri": "^9.0.1", - "tar": "^6.1.11", - "text-table": "~0.2.0", - "tiny-relative-date": "^1.3.0", - "treeverse": "^2.0.0", - "validate-npm-package-name": "^4.0.0", - "which": "^2.0.2", - "write-file-atomic": "^4.0.1" + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" }, - "dependencies": { - "@colors/colors": { - "version": "1.5.0", - "bundled": true, - "optional": true - }, - "@gar/promisify": { - "version": "1.1.3", - "bundled": true - }, - "@isaacs/string-locale-compare": { - "version": "1.1.0", - "bundled": true - }, - "@npmcli/arborist": { - "version": "5.2.0", - "bundled": true, - "requires": { - "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/map-workspaces": "^2.0.3", - "@npmcli/metavuln-calculator": "^3.0.1", - "@npmcli/move-file": "^2.0.0", - "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^2.0.0", - "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^3.0.0", - "bin-links": "^3.0.0", - "cacache": "^16.0.6", - "common-ancestor-path": "^1.0.1", - "json-parse-even-better-errors": "^2.3.1", - "json-stringify-nice": "^1.1.4", - "mkdirp": "^1.0.4", - "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", - "npm-install-checks": "^5.0.0", - "npm-package-arg": "^9.0.0", - "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.0", - "npmlog": "^6.0.2", - "pacote": "^13.0.5", - "parse-conflict-json": "^2.0.1", - "proc-log": "^2.0.0", - "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.1", - "read-package-json-fast": "^2.0.2", - "readdir-scoped-modules": "^1.1.0", - "rimraf": "^3.0.2", - "semver": "^7.3.7", - "ssri": "^9.0.0", - "treeverse": "^2.0.0", - "walk-up-path": "^1.0.0" - } - }, - "@npmcli/ci-detect": { - "version": "2.0.0", - "bundled": true - }, - "@npmcli/config": { - "version": "4.1.0", - "bundled": true, - "requires": { - "@npmcli/map-workspaces": "^2.0.2", - "ini": "^3.0.0", - "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", - "proc-log": "^2.0.0", - "read-package-json-fast": "^2.0.3", - "semver": "^7.3.5", - "walk-up-path": "^1.0.0" - } - }, - "@npmcli/disparity-colors": { - "version": "2.0.0", - "bundled": true, - "requires": { - "ansi-styles": "^4.3.0" - } - }, - "@npmcli/fs": { - "version": "2.1.0", - "bundled": true, - "requires": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - } - }, - "@npmcli/git": { - "version": "3.0.1", - "bundled": true, - "requires": { - "@npmcli/promise-spawn": "^3.0.0", - "lru-cache": "^7.4.4", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^7.0.0", - "proc-log": "^2.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" - } - }, - "@npmcli/installed-package-contents": { - "version": "1.0.7", - "bundled": true, - "requires": { - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "@npmcli/map-workspaces": { - "version": "2.0.3", - "bundled": true, - "requires": { - "@npmcli/name-from-folder": "^1.0.1", - "glob": "^8.0.1", - "minimatch": "^5.0.1", - "read-package-json-fast": "^2.0.3" - } - }, - "@npmcli/metavuln-calculator": { - "version": "3.1.0", - "bundled": true, - "requires": { - "cacache": "^16.0.0", - "json-parse-even-better-errors": "^2.3.1", - "pacote": "^13.0.3", - "semver": "^7.3.5" - } - }, - "@npmcli/move-file": { - "version": "2.0.0", - "bundled": true, - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - } - }, - "@npmcli/name-from-folder": { - "version": "1.0.1", - "bundled": true - }, - "@npmcli/node-gyp": { - "version": "2.0.0", - "bundled": true - }, - "@npmcli/package-json": { - "version": "2.0.0", - "bundled": true, - "requires": { - "json-parse-even-better-errors": "^2.3.1" - } - }, - "@npmcli/promise-spawn": { - "version": "3.0.0", - "bundled": true, - "requires": { - "infer-owner": "^1.0.4" - } - }, - "@npmcli/run-script": { - "version": "3.0.2", - "bundled": true, - "requires": { - "@npmcli/node-gyp": "^2.0.0", - "@npmcli/promise-spawn": "^3.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^2.0.3" - } - }, - "@tootallnate/once": { - "version": "2.0.0", - "bundled": true - }, - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "agent-base": { - "version": "6.0.2", - "bundled": true, - "requires": { - "debug": "4" - } - }, - "agentkeepalive": { - "version": "4.2.1", - "bundled": true, - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - } - }, - "aggregate-error": { - "version": "3.1.0", - "bundled": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ansi-regex": { - "version": "5.0.1", - "bundled": true - }, - "ansi-styles": { - "version": "4.3.0", - "bundled": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "aproba": { - "version": "2.0.0", - "bundled": true - }, - "archy": { - "version": "1.0.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "3.0.0", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "asap": { - "version": "2.0.6", - "bundled": true - }, - "balanced-match": { - "version": "1.0.2", - "bundled": true - }, - "bin-links": { - "version": "3.0.1", - "bundled": true, - "requires": { - "cmd-shim": "^5.0.0", - "mkdirp-infer-owner": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^3.0.0", - "rimraf": "^3.0.0", - "write-file-atomic": "^4.0.0" - } - }, - "binary-extensions": { - "version": "2.2.0", - "bundled": true - }, - "brace-expansion": { - "version": "2.0.1", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "builtins": { - "version": "5.0.1", - "bundled": true, - "requires": { - "semver": "^7.0.0" - } - }, - "cacache": { - "version": "16.1.0", - "bundled": true, - "requires": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^1.1.1" - } - }, - "chalk": { - "version": "4.1.2", - "bundled": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chownr": { - "version": "2.0.0", - "bundled": true - }, - "cidr-regex": { - "version": "3.1.1", - "bundled": true, - "requires": { - "ip-regex": "^4.1.0" - } - }, - "clean-stack": { - "version": "2.2.0", - "bundled": true - }, - "cli-columns": { - "version": "4.0.0", - "bundled": true, - "requires": { - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - } - }, - "cli-table3": { - "version": "0.6.2", - "bundled": true, - "requires": { - "@colors/colors": "1.5.0", - "string-width": "^4.2.0" - } - }, - "clone": { - "version": "1.0.4", - "bundled": true - }, - "cmd-shim": { - "version": "5.0.0", - "bundled": true, - "requires": { - "mkdirp-infer-owner": "^2.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "bundled": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "bundled": true - }, - "color-support": { - "version": "1.1.3", - "bundled": true - }, - "columnify": { - "version": "1.6.0", - "bundled": true, - "requires": { - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.0" - } - }, - "common-ancestor-path": { - "version": "1.0.1", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, + "peerDependenciesMeta": { "debug": { - "version": "4.3.4", - "bundled": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "bundled": true - } - } - }, - "debuglog": { - "version": "1.0.1", - "bundled": true - }, - "defaults": { - "version": "1.0.3", - "bundled": true, - "requires": { - "clone": "^1.0.2" - } - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "depd": { - "version": "1.1.2", - "bundled": true - }, - "dezalgo": { - "version": "1.0.4", - "bundled": true, - "requires": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, - "diff": { - "version": "5.0.0", - "bundled": true - }, - "emoji-regex": { - "version": "8.0.0", - "bundled": true - }, - "encoding": { - "version": "0.1.13", - "bundled": true, - "optional": true, - "requires": { - "iconv-lite": "^0.6.2" - } - }, - "env-paths": { - "version": "2.2.1", - "bundled": true - }, - "err-code": { - "version": "2.0.3", - "bundled": true - }, - "fastest-levenshtein": { - "version": "1.0.12", - "bundled": true - }, - "fs-minipass": { - "version": "2.1.0", - "bundled": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "function-bind": { - "version": "1.1.1", - "bundled": true - }, - "gauge": { - "version": "4.0.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - } - }, - "glob": { - "version": "8.0.1", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.10", - "bundled": true - }, - "has": { - "version": "1.0.3", - "bundled": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "bundled": true - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "hosted-git-info": { - "version": "5.0.0", - "bundled": true, - "requires": { - "lru-cache": "^7.5.1" - } - }, - "http-cache-semantics": { - "version": "4.1.0", - "bundled": true - }, - "http-proxy-agent": { - "version": "5.0.0", - "bundled": true, - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - } - }, - "https-proxy-agent": { - "version": "5.0.1", - "bundled": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "humanize-ms": { - "version": "1.2.1", - "bundled": true, - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.6.3", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ignore-walk": { - "version": "5.0.1", - "bundled": true, - "requires": { - "minimatch": "^5.0.1" - } - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true - }, - "indent-string": { - "version": "4.0.0", - "bundled": true - }, - "infer-owner": { - "version": "1.0.4", - "bundled": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true - }, - "ini": { - "version": "3.0.0", - "bundled": true - }, - "init-package-json": { - "version": "3.0.2", - "bundled": true, - "requires": { - "npm-package-arg": "^9.0.1", - "promzard": "^0.3.0", - "read": "^1.0.7", - "read-package-json": "^5.0.0", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^4.0.0" - } - }, - "ip": { - "version": "1.1.8", - "bundled": true - }, - "ip-regex": { - "version": "4.3.0", - "bundled": true - }, - "is-cidr": { - "version": "4.0.2", - "bundled": true, - "requires": { - "cidr-regex": "^3.1.1" - } - }, - "is-core-module": { - "version": "2.9.0", - "bundled": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "bundled": true - }, - "is-lambda": { - "version": "1.0.1", - "bundled": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "bundled": true - }, - "json-stringify-nice": { - "version": "1.1.4", - "bundled": true - }, - "jsonparse": { - "version": "1.3.1", - "bundled": true - }, - "just-diff": { - "version": "5.0.2", - "bundled": true - }, - "just-diff-apply": { - "version": "5.2.0", - "bundled": true - }, - "libnpmaccess": { - "version": "6.0.3", - "bundled": true, - "requires": { - "aproba": "^2.0.0", - "minipass": "^3.1.1", - "npm-package-arg": "^9.0.1", - "npm-registry-fetch": "^13.0.0" - } - }, - "libnpmdiff": { - "version": "4.0.3", - "bundled": true, - "requires": { - "@npmcli/disparity-colors": "^2.0.0", - "@npmcli/installed-package-contents": "^1.0.7", - "binary-extensions": "^2.2.0", - "diff": "^5.0.0", - "minimatch": "^5.0.1", - "npm-package-arg": "^9.0.1", - "pacote": "^13.0.5", - "tar": "^6.1.0" - } - }, - "libnpmexec": { - "version": "4.0.5", - "bundled": true, - "requires": { - "@npmcli/arborist": "^5.0.0", - "@npmcli/ci-detect": "^2.0.0", - "@npmcli/run-script": "^3.0.0", - "chalk": "^4.1.0", - "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^9.0.1", - "npmlog": "^6.0.2", - "pacote": "^13.0.5", - "proc-log": "^2.0.0", - "read": "^1.0.7", - "read-package-json-fast": "^2.0.2", - "walk-up-path": "^1.0.0" - } - }, - "libnpmfund": { - "version": "3.0.2", - "bundled": true, - "requires": { - "@npmcli/arborist": "^5.0.0" - } - }, - "libnpmhook": { - "version": "8.0.3", - "bundled": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^13.0.0" - } - }, - "libnpmorg": { - "version": "4.0.3", - "bundled": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^13.0.0" - } - }, - "libnpmpack": { - "version": "4.1.0", - "bundled": true, - "requires": { - "@npmcli/run-script": "^3.0.0", - "npm-package-arg": "^9.0.1", - "pacote": "^13.5.0" - } - }, - "libnpmpublish": { - "version": "6.0.4", - "bundled": true, - "requires": { - "normalize-package-data": "^4.0.0", - "npm-package-arg": "^9.0.1", - "npm-registry-fetch": "^13.0.0", - "semver": "^7.3.7", - "ssri": "^9.0.0" - } - }, - "libnpmsearch": { - "version": "5.0.3", - "bundled": true, - "requires": { - "npm-registry-fetch": "^13.0.0" - } - }, - "libnpmteam": { - "version": "4.0.3", - "bundled": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^13.0.0" - } - }, - "libnpmversion": { - "version": "3.0.4", - "bundled": true, - "requires": { - "@npmcli/git": "^3.0.0", - "@npmcli/run-script": "^3.0.0", - "json-parse-even-better-errors": "^2.3.1", - "proc-log": "^2.0.0", - "semver": "^7.3.7" - } - }, - "lru-cache": { - "version": "7.9.0", - "bundled": true - }, - "make-fetch-happen": { - "version": "10.1.5", - "bundled": true, - "requires": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.1.1", - "ssri": "^9.0.0" - } - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "minipass": { - "version": "3.1.6", - "bundled": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "minipass-collect": { - "version": "1.0.2", - "bundled": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-fetch": { - "version": "2.1.0", - "bundled": true, - "requires": { - "encoding": "^0.1.13", - "minipass": "^3.1.6", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" - } - }, - "minipass-flush": { - "version": "1.0.5", - "bundled": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-json-stream": { - "version": "1.0.1", - "bundled": true, - "requires": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" - } - }, - "minipass-pipeline": { - "version": "1.2.4", - "bundled": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-sized": { - "version": "1.0.3", - "bundled": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "bundled": true, - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "bundled": true - }, - "mkdirp-infer-owner": { - "version": "2.0.0", - "bundled": true, - "requires": { - "chownr": "^2.0.0", - "infer-owner": "^1.0.4", - "mkdirp": "^1.0.3" - } - }, - "ms": { - "version": "2.1.3", - "bundled": true - }, - "mute-stream": { - "version": "0.0.8", - "bundled": true - }, - "negotiator": { - "version": "0.6.3", - "bundled": true - }, - "node-gyp": { - "version": "9.0.0", - "bundled": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.2.0", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "nopt": { - "version": "5.0.0", - "bundled": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "4.0.0", - "bundled": true, - "requires": { - "hosted-git-info": "^5.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - } - }, - "npm-audit-report": { - "version": "3.0.0", - "bundled": true, - "requires": { - "chalk": "^4.0.0" - } - }, - "npm-bundled": { - "version": "1.1.2", - "bundled": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-install-checks": { - "version": "5.0.0", - "bundled": true, - "requires": { - "semver": "^7.1.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true - }, - "npm-package-arg": { - "version": "9.0.2", - "bundled": true, - "requires": { - "hosted-git-info": "^5.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" - } - }, - "npm-packlist": { - "version": "5.1.0", - "bundled": true, - "requires": { - "glob": "^8.0.1", - "ignore-walk": "^5.0.1", - "npm-bundled": "^1.1.2", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-pick-manifest": { - "version": "7.0.1", - "bundled": true, - "requires": { - "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^1.0.1", - "npm-package-arg": "^9.0.0", - "semver": "^7.3.5" - } - }, - "npm-profile": { - "version": "6.0.3", - "bundled": true, - "requires": { - "npm-registry-fetch": "^13.0.1", - "proc-log": "^2.0.0" - } - }, - "npm-registry-fetch": { - "version": "13.1.1", - "bundled": true, - "requires": { - "make-fetch-happen": "^10.0.6", - "minipass": "^3.1.6", - "minipass-fetch": "^2.0.3", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^9.0.1", - "proc-log": "^2.0.0" - } - }, - "npm-user-validate": { - "version": "1.0.1", - "bundled": true - }, - "npmlog": { - "version": "6.0.2", - "bundled": true, - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "opener": { - "version": "1.5.2", - "bundled": true - }, - "p-map": { - "version": "4.0.0", - "bundled": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "pacote": { - "version": "13.5.0", - "bundled": true, - "requires": { - "@npmcli/git": "^3.0.0", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/run-script": "^3.0.1", - "cacache": "^16.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "infer-owner": "^1.0.4", - "minipass": "^3.1.6", - "mkdirp": "^1.0.4", - "npm-package-arg": "^9.0.0", - "npm-packlist": "^5.1.0", - "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.1", - "proc-log": "^2.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^5.0.0", - "read-package-json-fast": "^2.0.3", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11" - } - }, - "parse-conflict-json": { - "version": "2.0.2", - "bundled": true, - "requires": { - "json-parse-even-better-errors": "^2.3.1", - "just-diff": "^5.0.1", - "just-diff-apply": "^5.2.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "proc-log": { - "version": "2.0.1", - "bundled": true - }, - "promise-all-reject-late": { - "version": "1.0.1", - "bundled": true - }, - "promise-call-limit": { - "version": "1.0.1", - "bundled": true - }, - "promise-inflight": { - "version": "1.0.1", - "bundled": true - }, - "promise-retry": { - "version": "2.0.1", - "bundled": true, - "requires": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - } - }, - "promzard": { - "version": "0.3.0", - "bundled": true, - "requires": { - "read": "1" - } - }, - "qrcode-terminal": { - "version": "0.12.0", - "bundled": true - }, - "read": { - "version": "1.0.7", - "bundled": true, - "requires": { - "mute-stream": "~0.0.4" - } - }, - "read-cmd-shim": { - "version": "3.0.0", - "bundled": true - }, - "read-package-json": { - "version": "5.0.1", - "bundled": true, - "requires": { - "glob": "^8.0.1", - "json-parse-even-better-errors": "^2.3.1", - "normalize-package-data": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "read-package-json-fast": { - "version": "2.0.3", - "bundled": true, - "requires": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "bundled": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdir-scoped-modules": { - "version": "1.1.0", - "bundled": true, - "requires": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" - } - }, - "retry": { - "version": "0.12.0", - "bundled": true - }, - "rimraf": { - "version": "3.0.2", - "bundled": true, - "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.2.0", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "safe-buffer": { - "version": "5.2.1", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, "optional": true - }, - "semver": { - "version": "7.3.7", - "bundled": true, - "requires": { - "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "bundled": true, - "requires": { - "yallist": "^4.0.0" - } - } - } - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.7", - "bundled": true - }, - "smart-buffer": { - "version": "4.2.0", - "bundled": true - }, - "socks": { - "version": "2.6.2", - "bundled": true, - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.2.0" - } - }, - "socks-proxy-agent": { - "version": "6.2.0", - "bundled": true, - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - } - }, - "spdx-correct": { - "version": "3.1.1", - "bundled": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "bundled": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "bundled": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.11", - "bundled": true - }, - "ssri": { - "version": "9.0.1", - "bundled": true, - "requires": { - "minipass": "^3.1.1" - } - }, - "string-width": { - "version": "4.2.3", - "bundled": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "bundled": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-ansi": { - "version": "6.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "7.2.0", - "bundled": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar": { - "version": "6.1.11", - "bundled": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "bundled": true - }, - "tiny-relative-date": { - "version": "1.3.0", - "bundled": true - }, - "treeverse": { - "version": "2.0.0", - "bundled": true - }, - "unique-filename": { - "version": "1.1.1", - "bundled": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "bundled": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "bundled": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "validate-npm-package-name": { - "version": "4.0.0", - "bundled": true, - "requires": { - "builtins": "^5.0.0" - } - }, - "walk-up-path": { - "version": "1.0.0", - "bundled": true - }, - "wcwidth": { - "version": "1.0.1", - "bundled": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "which": { - "version": "2.0.2", - "bundled": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.5", - "bundled": true, - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "write-file-atomic": { - "version": "4.0.1", - "bundled": true, - "requires": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - } - }, - "yallist": { - "version": "4.0.0", - "bundled": true } } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "deprecated": "This package is no longer supported.", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "15.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", + "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "once": { + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nan": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", + "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { "wrappy": "1" } }, - "path-is-absolute": { + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "q": { + "node_modules/q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", + "license": "MIT", + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", @@ -2008,256 +1418,282 @@ "util-deprecate": "~1.0.1" } }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "requires": { + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "string_decoder": { + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { + "dev": true, + "license": "MIT", + "dependencies": { "safe-buffer": "~5.1.0" } }, - "targz": { + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", + "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chownr": "^1.0.1", + "mkdirp": "^0.5.1", + "pump": "^1.0.0", + "tar-stream": "^1.1.2" + } + }, + "node_modules/tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/targz": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/targz/-/targz-1.0.1.tgz", - "integrity": "sha1-j3alI2lM3t+7XWCkB2/27uzFOY8=", - "requires": { - "tar-fs": "^1.8.1" - }, + "integrity": "sha512-6q4tP9U55mZnRuMTBqnqc3nwYQY3kv+QthCFZuMk+Tn1qYUnMPmL/JZ/mzgXINzFpSqfU+242IFmFU9VPvqaQw==", + "dev": true, + "license": "MIT", "dependencies": { - "bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "tar-fs": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", - "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "requires": { - "chownr": "^1.0.1", - "mkdirp": "^0.5.1", - "pump": "^1.0.0", - "tar-stream": "^1.1.2" - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - } - } + "tar-fs": "^1.8.1" } }, - "to-buffer": { + "node_modules/to-buffer": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true, + "license": "MIT" }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "traverse": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", - "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "unzipper": { - "version": "0.8.14", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.8.14.tgz", - "integrity": "sha1-reBSTNL8FNEbjeJYviL50kfT95s=", - "requires": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "~1.0.10", - "listenercount": "~1.0.1", - "readable-stream": "~2.1.5", - "setimmediate": "~1.0.4" - }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unzipper": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.12.3.tgz", + "integrity": "sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==", + "dev": true, + "license": "MIT", "dependencies": { - "bluebird": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", - "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=" - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "readable-stream": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", - "requires": { - "buffer-shims": "^1.0.0", - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } + "bluebird": "~3.7.2", + "duplexer2": "~0.1.4", + "fs-extra": "^11.2.0", + "graceful-fs": "^4.2.2", + "node-int64": "^0.4.0" } }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { "punycode": "^2.1.0" } }, - "util-deprecate": { + "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" }, - "xtend": { + "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 8aaf0e9..f78b97d 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,10 @@ "description": "Informix native node.js driver", "version": "2.2.1", "main": "lib/odbc.js", - "homepage": "https://github.com/OpenInformix/node-informixdb", + "homepage": "https://github.com/dawizz/node-informixdb", "repository": { "type": "git", - "url": "git://https://github.com/OpenInformix/node-informixdb.git" - }, - "bugs": { - "url": "https://github.com/OpenInformix/node-informixdb/issues" + "url": "https://github.com/dawizz/node-informixdb.git" }, "contributors": [ "OpenInformix", @@ -18,28 +15,29 @@ "Rohit Pandey", "Sathyanesh Krishnan", "Javier Sagrera", - "IBM" + "IBM", + "Dawizz" + ], + "files": [ + "binding.gyp", + "installer/*.js", + "lib/*.js", + "src/" ], "directories": { "example": "examples", "test": "test" }, "engines": { - "node": ">=10.0.0" + "node": ">=20" }, "scripts": { "install": "node installer/driverInstall.js", "test": "echo \"No test specified\"" }, "dependencies": { - "bindings": "^1.3.0", - "fstream": "^1.0.12", - "nan": "^2.11.0", - "npm": "^8.11.0", - "q": "^1.5.1", - "request": "^2.88.0", - "targz": "^1.0.1", - "unzipper": "^0.8.14" + "bindings": "^1.5.0", + "q": "^1.5.1" }, "keywords": [ "node", @@ -57,8 +55,16 @@ "author": "Rohit Pandey", "license": "MIT", "devDependencies": { - "async": "^2.6.1", - "bluebird": "^3.5.2", - "moment": "^2.22.2" + "@eslint/js": "^9.15.0", + "async": "^2.6.4", + "axios": "^1.7.7", + "bluebird": "^3.7.2", + "eslint": "^9.15.0", + "globals": "^15.12.0", + "moment": "^2.30.1", + "nan": "^2.22.0", + "fstream": "^1.0.12", + "targz": "^1.0.1", + "unzipper": "^0.12.3" } } diff --git a/test/SampleApp1.js b/test/SampleApp1.js index 8bbcbdd..f4b0fb9 100644 --- a/test/SampleApp1.js +++ b/test/SampleApp1.js @@ -41,7 +41,7 @@ function DoSomeWork(err, conn) var rows = conn.querySync("SELECT * FROM t1"); console.log(); console.log(rows); -}; +} var MyAsynchronousTask = function (err, conn) @@ -91,7 +91,7 @@ function informixdb_OpenSync(ConStr) function main_func() { - // In case of connection problem first check whether the server is + // In case of connection problem first check whether the server is // really listening to the port on the right IP. // netstat -a | findstr 9088 var ConnectionString = "SERVER=ids0;DATABASE=db1;HOST=127.0.0.1;SERVICE=9088;UID=informix;PWD=xxxxx;"; diff --git a/test/common.js b/test/common.js index cb2f501..8ae06de 100644 --- a/test/common.js +++ b/test/common.js @@ -32,9 +32,9 @@ if (process.env.IFX_SCHEMA !== 'undefined') { exports.connectionObject.CURRENTSCHEMA = process.env.IFX_SCHEMA || exports.connectionObject.CURRENTSCHEMA; } -for(key in exports.connectionObject) +for(let key in exports.connectionObject) { - if(exports.connectionObject[key] != undefined) + if(exports.connectionObject[key] !== undefined) exports.connectionString = exports.connectionString + key + "=" + exports.connectionObject[key] + ";" ; } @@ -43,7 +43,7 @@ for(key in exports.connectionObject) // exports.connectionString = process.argv[2]; //} -exports.testConnectionStrings = [{ title : "Informix", +exports.testConnectionStrings = [{ title : "Informix", connectionString : exports.connectionString }]; exports.benchConnectionStrings = exports.testConnectionStrings; @@ -51,7 +51,7 @@ if (process.argv.length === 3) { //look through the testConnectionStrings to see if there is a title that matches //what was requested. var lookup = process.argv[2]; - + exports.testConnectionStrings.forEach(function (connectionString) { if (connectionString && connectionString.title && connectionString.title == lookup) { exports.connectionString = connectionString.connectionString diff --git a/test/nodeEE-leak-huge-query.js b/test/nodeEE-leak-huge-query.js index 219704e..64a0f87 100644 --- a/test/nodeEE-leak-huge-query.js +++ b/test/nodeEE-leak-huge-query.js @@ -1,6 +1,6 @@ -var common = require("./common"), - odbc = require("../"), - db = new odbc.Database(), +var common = require("./common"), + odbc = require("../"), + db = new odbc.Database(), assert = require("assert"), util = require('util'), tableOne = "leaktable1", @@ -13,21 +13,21 @@ var common = require("./common"), insertCallBackCount=0, initialMemHeap = 0, maxDiff = 1000000; - + try { global.gc(); initialMemHeap = util.inspect(process.memoryUsage().heapUsed); db.open(common.connectionString, function(err) { - + createTablesQuery(); - while(insertCount < tableLimit) + while(insertCount < tableLimit) { insertCount++; insertQueries(); } - + if(insertCount === tableLimit) { finalQueries(); @@ -41,9 +41,9 @@ var common = require("./common"), db.close(function () { console.log("Connection closed on error"); }); - + } - + function createTablesQuery() { db.query("create table " + tableOne + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -51,10 +51,10 @@ var common = require("./common"), { //console.log("Table " + tableOne + " created"); } - + else { - console.log(err); + console.log(err); } }); @@ -63,17 +63,17 @@ var common = require("./common"), { //console.log("Table " + tableTwo + " created"); } - + else { - console.log(err); + console.log(err); } }); } function insertQueries() { - query = "values ('" + insertCount + "', '" + maxVarChar + "', '" + maxVarChar + "', '" + maxVarChar + "')"; + let query = "values ('" + insertCount + "', '" + maxVarChar + "', '" + maxVarChar + "', '" + maxVarChar + "')"; db.query("insert into " + tableOne + " " + query, icback); db.query("insert into " + tableTwo + " " + query, icback); } @@ -89,45 +89,45 @@ var common = require("./common"), function icback(err, data) { - + if (err == null) { insertCallBackCount++; //console.log("INSERT", insertCallBackCount); } - + else { - console.log(err); + console.log(err); } } function scback(err, data) { - + if (err == null) { //console.log ("SELECT STATEMENT SUCCESSFUL"); } - + else { - console.log(err); + console.log(err); } } function drcback(err, data) { - + dropCount++; if (err == null) { //console.log ("DROP TABLE " + this.tableName + " SUCCESSFUL"); } - + else { - console.log(err); + console.log(err); } if(dropCount == 2) @@ -146,7 +146,7 @@ var common = require("./common"), function checkMemory() { global.gc(); - diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; + let diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; //console.log("DIFFERENCE ", diffHeapUse); assert(diffHeapUse < maxDiff); } diff --git a/test/nodeEE-leak-multiple-query-multiple-connections.js b/test/nodeEE-leak-multiple-query-multiple-connections.js index d225120..c6a3402 100644 --- a/test/nodeEE-leak-multiple-query-multiple-connections.js +++ b/test/nodeEE-leak-multiple-query-multiple-connections.js @@ -1,4 +1,4 @@ -var common = require("./common"), +var common = require("./common"), odbc = require("../"), maxConnections = 5, connections = [], @@ -8,15 +8,16 @@ var common = require("./common"), initialMemHeap = 0, maxDiff = 1000000, closedConnectionCount = 0; + let db; try { global.gc(); initialMemHeap = util.inspect(process.memoryUsage().heapUsed); - for (var i = 0; i < maxConnections; i++) + for (let i = 0; i < maxConnections; i++) { (function (i) { - var db = new odbc.Database(); + db = new odbc.Database(); connections.push(db); - + db.open(common.connectionString, function(err) { runQueries(db, "T1Leak" + i); }); @@ -26,11 +27,11 @@ var common = require("./common"), catch(e) { console.log(e); - db.close(function () { + if (db) db.close(function () { console.log("Connection closed on error"); }); } - + function runQueries(db, tableName) { db.query("create table "+ tableName + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -38,21 +39,21 @@ var common = require("./common"), { console.log("Table "+ tableName + " created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("INSERT into " + tableName + " values (1, 'PersonA', 'LastNameA', 'QA')", icback); db.query("INSERT into " + tableName + " values (2, 'PersonB', 'LastNameB', 'Dev')", icback); db.query("INSERT into " + tableName + " values (3, 'PersonC', 'LastNameC', 'QA')", icback); db.query("INSERT into " + tableName + " values (4, 'PersonD', 'LastNameD', 'QA')", icback); db.query("INSERT into " + tableName + " values (5, 'PersonE', 'LastNameE', 'QA')", icback); - + db.query("SELECT * from " + tableName, scback); - + db.query("UPDATE " + tableName + " SET C3 = 'QA Intern' where C2 = 'LastNameD'", ucback); db.query("SELECT * from " + tableName + " where C3 = 'QA Intern'", scback); db.query("SELECT count(*) from " + tableName + " where PID = 7", scback); @@ -66,34 +67,34 @@ var common = require("./common"), { if (err == null) { - } + } else { - console.log(err); + console.log(err); } } - + function scback(err, data) { if (err == null) { console.log("Select statement successful"); - } + } else { - console.log(err); + console.log(err); } } - + function ucback(err, data) { if (err == null) { console.log("Update statement successful"); - } + } else { - console.log(err); + console.log(err); } } @@ -102,10 +103,10 @@ var common = require("./common"), if (err == null) { console.log("Delete row(s) successful"); - } + } else { - console.log(err); + console.log(err); } } @@ -114,14 +115,14 @@ var common = require("./common"), if (err == null) { console.log("Drop table " + this.tableName + " successful"); - } + } else { - console.log(err); + console.log(err); } dropCallback++; - if(dropCallback == maxConnections) + if(dropCallback === maxConnections) { closedbConnections(); } @@ -133,7 +134,7 @@ var common = require("./common"), db.close(function () { console.log("Database Connection " + ix + " Closed"); closedConnectionCount++ - if(closedConnectionCount == maxConnections) + if(closedConnectionCount === maxConnections) { checkMemory(); } @@ -143,7 +144,7 @@ var common = require("./common"), function checkMemory() { global.gc(); - diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; + let diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; console.log("DIFFERENCE ", diffHeapUse); assert(diffHeapUse < maxDiff); - } \ No newline at end of file + } diff --git a/test/nodeEE-leak-multiple-query-pool-connections.js b/test/nodeEE-leak-multiple-query-pool-connections.js index f5dffa4..feb0049 100644 --- a/test/nodeEE-leak-multiple-query-pool-connections.js +++ b/test/nodeEE-leak-multiple-query-pool-connections.js @@ -1,4 +1,4 @@ -var common = require("./common"), +var common = require("./common"), odbc = require("../"), pool = new odbc.Pool(), maxConnections = 10, @@ -13,7 +13,7 @@ var common = require("./common"), initialMemHeap = util.inspect(process.memoryUsage().heapUsed); for (var i = 0; i <= maxConnections; i++) { (function (i) { - if (i == maxConnections) + if (i == maxConnections) { closeConnections(); } @@ -21,11 +21,11 @@ var common = require("./common"), { console.log("Opening connection #", i); pool.open(common.connectionString, function (err, connection) { - if (err) + if (err) { console.error("error: ", err.message); } - + else { runQueries(connection, "T1Leak" + i); @@ -38,12 +38,12 @@ var common = require("./common"), catch(e) { console.log(e); - pool.close(function () + pool.close(function () { console.log("pool closed on error"); }); } - + function runQueries(connection, tableName) { connection.query("create table "+ tableName + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -51,10 +51,10 @@ var common = require("./common"), { console.log("Table "+ tableName + " created"); } - + else { - console.log(err); + console.log(err); } }); connection.query("INSERT into " + tableName + " values (1, 'PersonA', 'LastNameA', 'QA')", icback); @@ -62,9 +62,9 @@ var common = require("./common"), connection.query("INSERT into " + tableName + " values (3, 'PersonC', 'LastNameC', 'QA')", icback); connection.query("INSERT into " + tableName + " values (4, 'PersonD', 'LastNameD', 'QA')", icback); connection.query("INSERT into " + tableName + " values (5, 'PersonE', 'LastNameE', 'QA')", icback); - + connection.query("SELECT * from " + tableName, scback); - + connection.query("UPDATE " + tableName + " SET C3 = 'QA Intern' where C2 = 'LastNameD'", ucback); connection.query("SELECT * from " + tableName + " where C3 = 'QA Intern'", scback); connection.query("SELECT count(*) from " + tableName + " where PID = 7", scback); @@ -79,36 +79,36 @@ var common = require("./common"), if (err == null) { } - + else { - console.log(err); + console.log(err); } } - + function scback(err, data) { if (err == null) { console.log("Select statement successful"); } - + else { - console.log(err); + console.log(err); } } - + function ucback(err, data) { if (err == null) { console.log("Update statement successful"); } - + else { - console.log(err); + console.log(err); } } @@ -118,10 +118,10 @@ var common = require("./common"), { console.log("Delete row(s) successful"); } - + else { - console.log(err); + console.log(err); } } @@ -131,25 +131,25 @@ var common = require("./common"), { console.log("Drop table " + this.tableName + " successful"); } - + else { - console.log(err); + console.log(err); } } - function closeConnections() + function closeConnections() { pool.close(function () { console.log("Database connection pool closed"); checkMemory(); }); } - + function checkMemory() { global.gc(); - diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; + let diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; console.log("DIFFERENCE ", diffHeapUse); assert(diffHeapUse < maxDiff); - } \ No newline at end of file + } diff --git a/test/nodeEE-leak-multiple-query.js b/test/nodeEE-leak-multiple-query.js index 6a50e64..8ae7854 100644 --- a/test/nodeEE-leak-multiple-query.js +++ b/test/nodeEE-leak-multiple-query.js @@ -1,6 +1,6 @@ -var common = require("./common"), - odbc = require("../"), - db = new odbc.Database(), +var common = require("./common"), + odbc = require("../"), + db = new odbc.Database(), assert = require("assert"), util = require('util'), initialMemHeap = 0, @@ -21,9 +21,9 @@ var common = require("./common"), db.close(function () { console.log("Connection closed on error"); }); - + } - + function runQueries() { db.query("create table T1Leak (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -31,21 +31,21 @@ var common = require("./common"), { console.log("Table T1Leak created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("INSERT into T1Leak values (1, 'PersonA', 'LastNameA', 'QA')", icback); db.query("INSERT into T1Leak values (2, 'PersonB', 'LastNameB', 'Dev')", icback); db.query("INSERT into T1Leak values (3, 'PersonC', 'LastNameC', 'QA')", icback); db.query("INSERT into T1Leak values (4, 'PersonD', 'LastNameD', 'QA')", icback); db.query("INSERT into T1Leak values (5, 'PersonE', 'LastNameE', 'QA')", icback); - + db.query("SELECT * from T1Leak", scback); - + db.query("UPDATE T1Leak SET C3 = 'QA Intern' where C2 = 'LastNameD'", ucback); db.query("SELECT * from T1Leak where C3 = 'QA Intern'", scback); db.query("SELECT count(*) from T1Leak where PID = 7", scback); @@ -61,23 +61,23 @@ var common = require("./common"), { insertCount++; } - + else { - console.log(err); + console.log(err); } } - + function scback(err, data) { if (err == null) { console.log("Select statement successful"); } - + else { - console.log(err); + console.log(err); } } function ucback(err, data) @@ -86,10 +86,10 @@ var common = require("./common"), { console.log("Update statement successful"); } - + else { - console.log(err); + console.log(err); } } function dcback(err, data) @@ -98,10 +98,10 @@ var common = require("./common"), { console.log("Delete row(s) successful"); } - + else { - console.log(err); + console.log(err); } } function drcback(err, data) @@ -109,11 +109,11 @@ var common = require("./common"), if (err == null) { console.log("Drop table T1Leak successful"); - - } + + } else { - console.log(err); + console.log(err); } closedbConnection(); @@ -128,7 +128,7 @@ var common = require("./common"), function checkMemory() { global.gc(); - diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; + let diffHeapUse = util.inspect(process.memoryUsage().heapUsed) - initialMemHeap; console.log("DIFFERENCE ", diffHeapUse); assert(diffHeapUse < maxDiff); - } \ No newline at end of file + } diff --git a/test/nodeEE-stress-async-waterfall-multiple-connections.js b/test/nodeEE-stress-async-waterfall-multiple-connections.js index c673dcc..bafec43 100644 --- a/test/nodeEE-stress-async-waterfall-multiple-connections.js +++ b/test/nodeEE-stress-async-waterfall-multiple-connections.js @@ -1,4 +1,4 @@ -var common = require("./common"), +var common = require("./common"), odbc = require("../"), maxConnections = 5, connections = [], @@ -10,46 +10,44 @@ var common = require("./common"), expected1 = [{ PID: '1', C1: 'PersonA', C2: 'LastNameA', C3: 'QA' }, { PID: '2', C1: 'PersonB', C2: 'LastNameB', C3: 'Dev' }, { PID: '3', C1: 'PersonC', C2: 'LastNameC', C3: 'QA' }, { PID: '4', C1: 'PersonD', C2: 'LastNameD', C3: 'QA' }, { PID: '5', C1: 'PersonE', C2: 'LastNameE', C3: 'QA' }], expected2 = [{ PID: '6', C1: 'PersonF', C2: 'LastNameF', C3: 'QA Lead' }, { PID: '7', C1: 'PersonG', C2: 'LastNameG', C3: 'Dev Lead' }], expected3 = [{ PID: '4', C1: 'PersonD', C2: 'LastNameD', C3: 'QA Intern' }]; - - var funcArr = []; - funcArr.push(main); + + const funcArr = []; + funcArr.push(main); async.waterfall(funcArr, function (err, result) { - if (err == null) - { - consol.log('Waterfall successful'); - } - else - { + if (err == null) { + console.log('Waterfall successful'); + } else { console.error(err); } }); + let db; function main() { try { - for (var i = 0; i < maxConnections; i++) + for (let i = 0; i < maxConnections; i++) { (function (i) { - var db = new odbc.Database(); + db = new odbc.Database(); connections.push(db); db.open(common.connectionString, function(err) { runQueries(db, "T1" + i, "T2" + i); }); })(i); - + } } catch(e) { console.log(e); - db.close(function () { + if (db) db.close(function () { console.log("Connection closed on error"); }); } - + } - + function runQueries(db, tableOne, tableTwo) { db.query("create table " + tableOne + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -57,49 +55,49 @@ var common = require("./common"), { console.log("Table " + tableOne + " created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("create table " + tableTwo + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ if (err == null) { console.log("Table " + tableTwo + " created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("INSERT into " + tableOne + " values (1, 'PersonA', 'LastNameA', 'QA')", icback); db.query("INSERT into " + tableOne + " values (2, 'PersonB', 'LastNameB', 'Dev')", icback); db.query("INSERT into " + tableOne + " values (3, 'PersonC', 'LastNameC', 'QA')", icback); db.query("INSERT into " + tableOne + " values (4, 'PersonD', 'LastNameD', 'QA')", icback); db.query("INSERT into " + tableOne + " values (5, 'PersonE', 'LastNameE', 'QA')", icback); - + db.query("INSERT into " + tableTwo + " values (6, 'PersonF', 'LastNameF', 'QA Lead')", icback); db.query("INSERT into " + tableTwo + " values (7, 'PersonG', 'LastNameG', 'Dev Lead')", icback); - + db.query("SELECT * from " + tableOne, scback.bind({expected: expected1})); db.query("SELECT * from " + tableTwo , scback.bind({expected: expected2})); - + db.query("UPDATE " + tableOne + " SET C3 = 'QA Intern' where C2 = 'LastNameD'", ucback); db.query("SELECT * from " + tableOne + " where C3 = 'QA Intern'", scback.bind({expected: expected3})); - + db.query("DELETE from " + tableTwo + " where PID = 7", dcback); db.query("SELECT * from " + tableTwo + " where PID = 7", scback.bind({expected: []})); - db.query("DROP table " + tableTwo, drcback.bind({tableName: tableTwo})); + db.query("DROP table " + tableTwo, drcback.bind({tableName: tableTwo})); db.query("SELECT tabname from syscat.tables where tabschema='ELKOREHP' and TABNAME='" + tableTwo + "'", scback.bind({expected: []})); db.query("DELETE from " + tableOne + " where PID = 5", dcback); db.query("SELECT * from " + tableOne + " where PID = 5", scback.bind({expected: []})); db.query("DROP table " + tableOne , drcback.bind({tableName: tableTwo})); db.query("SELECT tabname from syscat.tables where tabschema='ELKOREHP' and TABNAME='" + tableOne + "'", scback.bind({expected: []})); - + queryCallback++; if(queryCallback == maxConnections) { @@ -115,10 +113,10 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } } - + function scback(err, data) { assert.deepEqual(data, this.expected); @@ -128,19 +126,19 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } } - + function ucback(err, data) { if (err == null) { console.log("Update statement successful"); - } + } else { - console.log(err); + console.log(err); } } function dcback(err, data) @@ -151,18 +149,18 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } } function drcback(err, data){ if (err == null) { console.log("Drop table " + this.tableName + " successful"); - + } else { - console.log(err); + console.log(err); } } function closedbConnections() @@ -172,4 +170,4 @@ var common = require("./common"), console.log("Database Connection " + ix + " Closed"); }); }); - } \ No newline at end of file + } diff --git a/test/nodeEE-stress-mixed-query-multiple-connections.js b/test/nodeEE-stress-mixed-query-multiple-connections.js index 43c2fef..0c2fdc8 100644 --- a/test/nodeEE-stress-mixed-query-multiple-connections.js +++ b/test/nodeEE-stress-mixed-query-multiple-connections.js @@ -1,4 +1,4 @@ -var common = require("./common"), +var common = require("./common"), odbc = require("../"), maxConnections = 5, connections = [], @@ -9,29 +9,31 @@ var common = require("./common"), expected1 = [{ PID: '1', C1: 'PersonA', C2: 'LastNameA', C3: 'QA' }, { PID: '2', C1: 'PersonB', C2: 'LastNameB', C3: 'Dev' }, { PID: '3', C1: 'PersonC', C2: 'LastNameC', C3: 'QA' }, { PID: '4', C1: 'PersonD', C2: 'LastNameD', C3: 'QA' }, { PID: '5', C1: 'PersonE', C2: 'LastNameE', C3: 'QA' }], expected2 = [{ PID: '6', C1: 'PersonF', C2: 'LastNameF', C3: 'QA Lead' }, { PID: '7', C1: 'PersonG', C2: 'LastNameG', C3: 'Dev Lead' }], expected3 = [{ PID: '4', C1: 'PersonD', C2: 'LastNameD', C3: 'QA Intern' }]; + + let db; try { - for (var i = 0; i < maxConnections; i++) + for (let i = 0; i < maxConnections; i++) { (function (i) { - var db = new odbc.Database(); + db = new odbc.Database(); connections.push(db); db.open(common.connectionString, function(err) { runQueries(db, "T1" + i, "T2" + i); }); })(i); - + } } catch(e) { console.log(e); - db.close(function () { + if (db) db.close(function () { console.log("Connection closed on error"); }); - + } - + function runQueries(db, tableOne, tableTwo) { db.query("create table " + tableOne + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ @@ -39,43 +41,43 @@ var common = require("./common"), { console.log("Table " + tableOne + " created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("create table " + tableTwo + " (PID INTEGER, C1 VARCHAR(255), C2 VARCHAR(255), C3 VARCHAR(255))", function(err, data){ if (err == null) { console.log("Table " + tableTwo + " created"); } - + else { - console.log(err); + console.log(err); } }); - + db.query("INSERT into " + tableOne + " values (1, 'PersonA', 'LastNameA', 'QA')", icback); db.query("INSERT into " + tableOne + " values (2, 'PersonB', 'LastNameB', 'Dev')", icback); db.query("INSERT into " + tableOne + " values (3, 'PersonC', 'LastNameC', 'QA')", icback); db.query("INSERT into " + tableOne + " values (4, 'PersonD', 'LastNameD', 'QA')", icback); db.query("INSERT into " + tableOne + " values (5, 'PersonE', 'LastNameE', 'QA')", icback); - + db.query("INSERT into " + tableTwo + " values (6, 'PersonF', 'LastNameF', 'QA Lead')", icback); db.query("INSERT into " + tableTwo + " values (7, 'PersonG', 'LastNameG', 'Dev Lead')", icback); - + db.query("SELECT * from " + tableOne, scback.bind({done: false, expected: expected1})); db.query("SELECT * from " + tableTwo , scback.bind({done: false, expected: expected2})); - + db.query("UPDATE " + tableOne + " SET C3 = 'QA Intern' where C2 = 'LastNameD'", ucback); db.query("SELECT * from " + tableOne + " where C3 = 'QA Intern'", scback.bind({done: false, expected: expected3})); - + db.query("DELETE from " + tableTwo + " where PID = 7", dcback); db.query("SELECT * from " + tableTwo + " where PID = 7", scback.bind({done: false, expected: []})); - db.query("DROP table " + tableTwo, drcback.bind({tableName: tableTwo})); + db.query("DROP table " + tableTwo, drcback.bind({tableName: tableTwo})); db.query("SELECT tabname from syscat.tables where tabschema='ELKOREHP' and TABNAME='" + tableTwo + "'", scback.bind({done: false, expected: []})); db.query("DELETE from " + tableOne + " where PID = 5", dcback); db.query("SELECT * from " + tableOne + " where PID = 5", scback.bind({done: false, expected: []})); @@ -91,10 +93,10 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } } - + function scback(err, data) { assert.deepEqual(data, this.expected); @@ -104,7 +106,7 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } if(this.done) @@ -116,16 +118,16 @@ var common = require("./common"), } } } - + function ucback(err, data) { if (err == null) { console.log("Update statement successful"); - } + } else { - console.log(err); + console.log(err); } } function dcback(err, data) @@ -136,18 +138,18 @@ var common = require("./common"), } else { - console.log(err); + console.log(err); } } function drcback(err, data){ if (err == null) { console.log("Drop table " + this.tableName + " successful"); - + } else { - console.log(err); + console.log(err); } } function closedbConnections() @@ -157,4 +159,4 @@ var common = require("./common"), console.log("Database Connection " + ix + " Closed"); }); }); - } \ No newline at end of file + } diff --git a/test/run-nodeEE.js b/test/run-nodeEE.js index 86cd35d..1b4e48a 100644 --- a/test/run-nodeEE.js +++ b/test/run-nodeEE.js @@ -44,24 +44,24 @@ doNextConnectionString(); function doTest(file, connectionString) { fs.open('logs/' + file + '.log', 'wx', function(err, fd) { - var test = spawn("node", ['--expose_gc',file, connectionString.connectionString], {stdio: ['pipe', fd, fd]}) - , timer = null - , timedOut = false; - ; - + var test = spawn("node", ['--expose_gc', file, connectionString.connectionString], {stdio: ['pipe', fd, fd]}) + ;let timer = null; + var timedOut = false; + + process.stdout.write("Running test for [\033[01;29m" + connectionString.title + "\033[01;0m] : " + file.replace(/\.js$/, "")); process.stdout.write(" ... "); testCount += 1; - + test.on("exit", function (code, signal) { clearTimeout(timer); - + if (code != 0) { errorCount += 1; - + process.stdout.write("\033[01;31mfail \033[01;0m "); - + if (timedOut) { process.stdout.write("(Timed Out)"); } @@ -69,23 +69,23 @@ function doTest(file, connectionString) { else { process.stdout.write("\033[01;32msuccess \033[01;0m "); } - + process.stdout.write("\n"); - + doNextTest(connectionString); }); - - var timer = setTimeout(function () { + + timer = setTimeout(function () { timedOut = true; test.kill(); - },testTimeout); + }, testTimeout); }); } function doNextTest(connectionString) { if (files.length) { - var testFile = files.shift(); - + const testFile = files.shift(); + doTest(testFile, connectionString); } else { @@ -97,7 +97,7 @@ function doNextTest(connectionString) { function doNextConnectionString() { if (connectionStrings.length) { var connectionString = connectionStrings.shift(); - + if (requestedTest) { files = [requestedTest]; } @@ -111,7 +111,7 @@ function doNextConnectionString() { files.sort(); } - + doNextTest(connectionString); } else { @@ -122,7 +122,7 @@ function doNextConnectionString() { else { console.log("Results : All tests were successful. Total %s tests executed.", testCount); } - console.log("Total execution time = %s min %s sec.", + console.log("Total execution time = %s min %s sec.", parseInt(totalTime/60), parseInt(totalTime%60)); if (errorCount) { diff --git a/test/run-tests.js b/test/run-tests.js index 445d33b..1129a1d 100644 --- a/test/run-tests.js +++ b/test/run-tests.js @@ -37,10 +37,10 @@ doNextConnectionString(); function doTest(file, connectionString) { - var test = spawn("node", ['--expose_gc',file, connectionString.connectionString]) - , timer = null - , timedOut = false; - ; + var test = spawn("node", ['--expose_gc', file, connectionString.connectionString]) + ;let timer = null; + var timedOut = false; + var testOut = '', testErr = ''; test.stdout.on('data', function(data) { @@ -82,15 +82,15 @@ function doTest(file, connectionString) { doNextTest(connectionString); }); - var timer = setTimeout(function () { + timer = setTimeout(function () { timedOut = true; test.kill(); - },testTimeout); + }, testTimeout); } function doNextTest(connectionString) { if (files.length) { - var testFile = files.shift(); + const testFile = files.shift(); doTest(testFile, connectionString); } diff --git a/test/test-basic-test.js b/test/test-basic-test.js index 65d6e11..2342081 100644 --- a/test/test-basic-test.js +++ b/test/test-basic-test.js @@ -27,29 +27,32 @@ informixdb.open(cn, {"fetchMode": 3}, function(err, conn) { // 3 means FETCH_ARR } //Bind and Execute the statment asynchronously stmt.executeNonQuery([42, 'bimal'], function (err, ret) { - if( err ) console.log(err); + if( err ) console.log(err); //else ret.closeSync(); // call closeSync() for execute(). else console.log("Inserted row count = " + ret); assert.equal(ret, 1); - + conn.prepare("select * from mytab1", function (err, stmt) { if(err) { console.log(err); return conn.closeSync(); } stmt.execute([], function(err, result) { - if(err) console.log(err); + let data; + if (err) console.log(err); else { data = result.fetchAllSync(); // Use fetchAllSync({fetchMode:3}) to get data as array. - console.log("Fetched Data = " ); + console.log("Fetched Data = "); console.log(data); result.closeSync(); conn.querySync("drop table mytab1"); - assert.deepEqual(data, [ { c1: 42, c2: 'bimal' } ]); - conn.close(function () { console.log('done'); }); + assert.deepEqual(data, [{c1: 42, c2: 'bimal'}]); + conn.close(function () { + console.log('done'); + }); } }); - }); + }); }); }); }); diff --git a/test/test-binding-transaction-commit.js b/test/test-binding-transaction-commit.js index fb52456..1760b0d 100644 --- a/test/test-binding-transaction-commit.js +++ b/test/test-binding-transaction-commit.js @@ -6,12 +6,12 @@ var common = require("./common") ; db.createConnection(function (err, conn) { - + conn.openSync(common.connectionString); - + common.createTables(conn, function (err, data) { test1() - + function test1() { conn.beginTransaction(function (err) { if (err) { @@ -19,7 +19,7 @@ db.createConnection(function (err, conn) { console.log(err); exitCode = 1 } - + var result = conn.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); //rollback @@ -29,17 +29,17 @@ db.createConnection(function (err, conn) { console.log(err); exitCode = 2 } - + result = conn.querySync("select * from " + common.tableName); data = result.fetchAllSync(); - + assert.deepEqual(data, []); - + test2(); }); }); } - + function test2 () { //Start a new transaction conn.beginTransaction(function (err) { @@ -48,8 +48,8 @@ db.createConnection(function (err, conn) { console.log(err); exitCode = 3 } - - result = conn.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); + + let result = conn.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); //commit conn.endTransaction(false, function (err) { @@ -58,18 +58,18 @@ db.createConnection(function (err, conn) { console.log(err); exitCode = 3 } - + result = conn.querySync("select * from " + common.tableName); data = result.fetchAllSync(); - + assert.deepEqual(data, [ { colint: 42, coldatetime: null, coltext: null } ]); result.closeSync(); - + finish(); }); }); } - + function finish() { common.dropTables(conn, function (err) { if (err) { diff --git a/test/test-blob-insert.js b/test/test-blob-insert.js index 7b8c065..c3d2b88 100644 --- a/test/test-blob-insert.js +++ b/test/test-blob-insert.js @@ -9,20 +9,20 @@ var common = require("./common") , outputfile2 = 'desc2.txt' ; -informixdb.open(cn, function (err,conn) +informixdb.open(cn, function (err,conn) { - if (err) + if (err) { console.log(err); } assert.equal(err, null); try { conn.querySync("drop table mytab"); - } catch (e) {}; + } catch (e) {} try { conn.querySync("create table mytab (empId int, photo BLOB, desc CLOB)"); - } catch (e) {}; - + } catch (e) {} + var img1= fs.readFileSync(inputfile1,'binary'); var text= fs.readFileSync(inputfile2,'ascii'); @@ -31,53 +31,54 @@ informixdb.open(cn, function (err,conn) console.log( "img1.length = " + len1); console.log( "text.length = " + len2); - conn.prepare("insert into mytab(empId, photo, desc) VALUES (?, ?, ?)", - function (err, stmt) + conn.prepare("insert into mytab(empId, photo, desc) VALUES (?, ?, ?)", + function (err, stmt) { - if (err) + if (err) { console.log(err); return conn.closeSync(); } - + var photo = {DataType: "BLOB", "Data":img1}; var desc = {DataType: "CLOB", Data: text}; - stmt.execute([18, photo, desc], function (err, result) + stmt.execute([18, photo, desc], function (err, result) { - if( err ) console.log(err); + if( err ) console.log(err); else result.closeSync(); - + conn.prepare("select * from mytab", function (err, stmt) { - if(err) + if(err) { console.log(err); return conn.closeSync(); } stmt.execute([], function(err, result) { - if(err) console.log(err); - else - { + let data; + if (err) console.log(err); + else { data = result.fetchAllSync(); fs.writeFileSync(outputfile1, data[0].photo, 'binary'); fs.writeFileSync(outputfile2, data[0].desc, 'ascii'); result.closeSync(); try { - // conn.querySync("drop table mytab"); - } catch (e) {}; - - + // conn.querySync("drop table mytab"); + } catch (e) { + } + + var size1 = fs.statSync(outputfile1)["size"]; var size2 = fs.statSync(outputfile2)["size"]; - console.log("Lengths before = " + len1+ ", " + len2); - console.log("Lengths after = " + size1+ ", " + size2); + console.log("Lengths before = " + len1 + ", " + len2); + console.log("Lengths after = " + size1 + ", " + size2); assert(len1, size1); assert(len2, size2); - // fs.unlinkSync(outputfile1); - // fs.unlink(outputfile2, function () { console.log('done'); }); + // fs.unlinkSync(outputfile1); + // fs.unlink(outputfile2, function () { console.log('done'); }); } }); }); diff --git a/test/test-blocking-issue210.js b/test/test-blocking-issue210.js index 9bcb5c6..f48840e 100644 --- a/test/test-blocking-issue210.js +++ b/test/test-blocking-issue210.js @@ -8,7 +8,7 @@ var common = require("./common") var startTime1, startTime2, totalTime1, totalTime2, dropTable = 0; var elapsedTime = informixdb.getElapsedTime; -var ret = pool.init(connectCount, connectionString); +var ret = pool.init(connectCount, connectionString); if(typeof ret === 'object') assert.equal(ret.message, undefined); //moment().format("YYYY-MM-DD HH:mm:ss.SSS")); @@ -16,7 +16,7 @@ console.log(elapsedTime(), "Started pool.open, populate a table MTAB1 of 40K row pool.open(connectionString, function( err, conn) { console.log(elapsedTime(), "pool.open"); try { conn.querySync("drop table mtab1"); - conn.querySync("drop table mtab2"); } catch(e) {}; + conn.querySync("drop table mtab2"); } catch(e) {} conn.querySync("create table mtab1(c1 varchar(30), c2 varchar(20))"); conn.querySync("create table mtab2(c1 varchar(30), c2 varchar(20))"); conn.querySync("Insert into mtab1 select * from table (list{ row('1', 'bimal'),row('2','kumar'),row('3', 'jhaaa'), row('4', 'kamal'), row('5', 'infmx') })"); @@ -25,7 +25,7 @@ pool.open(connectionString, function( err, conn) { conn.querySync("insert into mtab2 select * from mtab1"); conn.querySync("insert into mtab1 select * from mtab2"); } - + conn.querySync("drop table mtab2"); console.log( "Inserted rows in mtab1 = ", conn.querySync("select count(*) from systables")[0]['1']); conn.close(function(err){}); @@ -41,7 +41,7 @@ pool.open(connectionString, function (err, connection) { if(err) console.log(err); totalTime1 = (new Date() - startTime1)/1000; q1time = parseInt(totalTime1%60); - console.log(elapsedTime(), "Total execution time for Query1 = ", q1time, "sec."); + console.log(elapsedTime(), "Total execution time for Query1 = ", q1time, "sec."); dropTable++; if(dropTable == 2) { assert.equal(q1time > 10, false); @@ -56,7 +56,7 @@ pool.open(connectionString, function (err, connection) { if(err) console.log(err); totalTime2 = (new Date() - startTime2)/1000; q2time = parseInt(totalTime2%60); - console.log(elapsedTime(), "Total execution time for Query2 = ", q2time, "sec."); + console.log(elapsedTime(), "Total execution time for Query2 = ", q2time, "sec."); dropTable++; if(dropTable == 2) { assert.equal(q2time > 10, false); diff --git a/test/test-byte-insert.js b/test/test-byte-insert.js index 2a32af5..6de06a1 100644 --- a/test/test-byte-insert.js +++ b/test/test-byte-insert.js @@ -4,20 +4,20 @@ var common = require("./common") , fs = require('fs') , cn = common.connectionString; -informixdb.open(cn, function (err,conn) +informixdb.open(cn, function (err,conn) { - if (err) + if (err) { console.log(err); process.exit(-1); } try { conn.querySync("drop table mytab"); - } catch (e) {}; + } catch (e) {} try { conn.querySync("create table mytab (empId int, photo BYTE, desc TEXT)"); - } catch (e) {}; - + } catch (e) {} + var fimg1= 'data/phool.jpg'; var ftext= 'data/desc.txt'; @@ -25,52 +25,55 @@ informixdb.open(cn, function (err,conn) var text= fs.readFileSync(ftext,'ascii'); var len1 = fs.statSync(fimg1)["size"]; var len2 = fs.statSync(ftext)["size"]; - - conn.prepare("insert into mytab(empId, photo, desc) VALUES (?, ?, ?)", - function (err, stmt) + + conn.prepare("insert into mytab(empId, photo, desc) VALUES (?, ?, ?)", + function (err, stmt) { - if (err) + if (err) { console.log(err); return conn.closeSync(); } var photo = {DataType: "BYTE", Data:img1}; var desc = {DataType: "TEXT", Data: text}; - stmt.execute([18, photo, desc], function (err, result) + stmt.execute([18, photo, desc], function (err, result) { - if( err ) console.log(err); + if( err ) console.log(err); else result.closeSync(); - + conn.prepare("select * from mytab", function (err, stmt) { - if(err) + if(err) { console.log(err); return conn.closeSync(); } stmt.execute([], function(err, result) { - if(err) console.log(err); - else - { + let data; + if (err) console.log(err); + else { data = result.fetchAllSync(); fs.writeFileSync('phool2.jpg', data[0].photo, 'binary'); fs.writeFileSync('desc2.txt', data[0].desc, 'ascii'); - - result.closeSync(); + + result.closeSync(); try { - conn.querySync("drop table mytab"); - } catch (e) {}; - - var size1 = fs.statSync("phool2.jpg")["size"]; - var size2 = fs.statSync("desc2.txt")["size"]; - console.log("Lengths before = " + len1+ ", " + len2); - console.log("Lengths after = " + size1+ ", " + size2); + conn.querySync("drop table mytab"); + } catch (e) { + } + + const size1 = fs.statSync("phool2.jpg")["size"]; + const size2 = fs.statSync("desc2.txt")["size"]; + console.log("Lengths before = " + len1 + ", " + len2); + console.log("Lengths after = " + size1 + ", " + size2); assert(len1, size1); assert(len2, size2); fs.unlinkSync("phool2.jpg"); - fs.unlink("desc2.txt", function () { console.log('done'); }); + fs.unlink("desc2.txt", function () { + console.log('done'); + }); } }); }); diff --git a/test/test-call-async.js b/test/test-call-async.js index eb88086..9014178 100644 --- a/test/test-call-async.js +++ b/test/test-call-async.js @@ -17,13 +17,13 @@ informixdb.open(cn, function (err, conn) try { conn.querySync("drop procedure " + schema + ".proc1(INT, INT, VARCHAR(20))"); } catch(e) {} - + conn.querySync("create procedure " + schema + ".proc1 " + "(v1 INTEGER, OUT v2 INTEGER, INOUT v3 VARCHAR(20)); " + "let v2 = v1 + 1; let v3 = 'verygood'; end procedure"); console.log("created proc1...\n"); conn.commitTransactionSync(); - var param1 = {ParamType:"INPUT", DataType:"INTEGER", Data:3}; + let param1 = {ParamType: "INPUT", DataType: "INTEGER", Data: 3}; var param2 = {ParamType:"OUTPUT", DataType:"INTEGER", Data:0}; var param3 = {ParamType:"INOUT", DataType:"CHAR", Data:"abc", Length:30}; @@ -41,7 +41,7 @@ informixdb.open(cn, function (err, conn) } catch(e) {} conn.querySync("create procedure " + schema + ".proc2 (v1 INTEGER); end procedure"); - var param1 = {ParamType:"INPUT", DataType:"INTEGER", Data:3}; + param1 = {ParamType: "INPUT", DataType: "INTEGER", Data: 3}; query = "call " + schema + ".proc2(?)"; conn.query({"sql":query, "params" : [param1]}, function(err, result){ if(err) console.log(err); diff --git a/test/test-call-stmt.js b/test/test-call-stmt.js index d4edc9d..06bc417 100644 --- a/test/test-call-stmt.js +++ b/test/test-call-stmt.js @@ -19,11 +19,11 @@ informixdb.open(cn, function (err, conn) conn.querySync("create procedure " + schema + ".proc1 " + "(v1 INTEGER, OUT v2 INTEGER, INOUT v3 VARCHAR(20)) " + "let v2 = v1 + 1; let v3 = 'verygood'; end procedure"); - var param1 = {ParamType:"INPUT", DataType:1, Data:0}; - var param2 = {ParamType:"OUTPUT", DataType:1, Data:0}; - var param3 = {ParamType:"INOUT", DataType:1, Data:"abc", Length:30}; + const param1 = {ParamType: "INPUT", DataType: 1, Data: 0}; + const param2 = {ParamType: "OUTPUT", DataType: 1, Data: 0}; + const param3 = {ParamType: "INOUT", DataType: 1, Data: "abc", Length: 30}; - result = conn.querySync(query, [param1, param2, param3]); + let result = conn.querySync(query, [param1, param2, param3]); assert.deepEqual(result, [ 1, 'verygood' ]); console.log("Output Parameters V2 = ", result[0], ", V3 = ", result[1]); diff --git a/test/test-ibm-db-issue14.js b/test/test-ibm-db-issue14.js index 8e5fc04..89fa8dd 100644 --- a/test/test-ibm-db-issue14.js +++ b/test/test-ibm-db-issue14.js @@ -1,15 +1,17 @@ /* Test program to access Informix sample database */ /*require the informixdb module*/ -var common = require("./common") - , assert = require("assert") - , informixdb = require("../"); +const common = require("./common") + , assert = require("assert") + , informixdb = require("../"); -var testTable = 'BIGINTTEST'; -var testValues = [10205152031467301, 10205152031467303]; +const testTable = 'BIGINTTEST'; + +// eslint-disable-next-line no-loss-of-precision +const testValues = [10205152031467301, 10205152031467303]; /*Connect to the database server - param 1: The DSN string which has the details of database name to connect to, user id, password, hostname, portnumber + param 1: The DSN string which has the details of database name to connect to, user id, password, hostname, portnumber param 2: The Callback function to execute when connection attempt to the specified database is completed */ informixdb.open(common.connectionString, function(err, conn) @@ -20,10 +22,10 @@ informixdb.open(common.connectionString, function(err, conn) } else { console.log('Connection to Informix machine successful'); - + try { conn.querySync("create table " + testTable + " (COLINT BIGINT)"); - } catch (e) {}; + } catch (e) {} for(var i=0;i"); if(Array.isArray(result)) @@ -38,7 +39,7 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { assert.deepEqual(result[1], ['success']); result = result[0]; } - data = result.fetchAllSync(); + let data = result.fetchAllSync(); if(data.length) console.log(data); result.closeSync(); stmt.closeSync(); @@ -46,7 +47,7 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { conn.prepare(query, function (err, stmt) { if (err) console.log(err); stmt.execute(['1', param2], function(err, result, outparams) { - if( err ) console.log(err); + if( err ) console.log(err); else { result.closeSync(); console.log("Result for Async call of PROC2 (1 OUT param and no Result Set) ==>"); @@ -57,7 +58,7 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { try { conn.querySync("drop procedure "+ schema +".proc2;"); - } catch (e) {}; + } catch (e) {} // Create SP with only Result Set and no OUT or INPUT param. conn.querySync(proc3); // Call SP Synchronously. @@ -84,7 +85,7 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { conn.prepare(query, function (err, stmt) { if (err) console.log(err); stmt.execute(['1', 'abc'], function(err, result, outparams) { - if( err ) console.log(err); + if( err ) console.log(err); else { data = result.fetchAllSync(); console.log("Result for Async call of PROC3 (only 2 Result Sets) ==>"); diff --git a/test/test-sp-resultset.js b/test/test-sp-resultset.js index b113f82..3b9268f 100644 --- a/test/test-sp-resultset.js +++ b/test/test-sp-resultset.js @@ -14,12 +14,14 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { console.log(err); process.exit(-1); } - param2 = {ParamType:"INOUT", DataType:1, Data:"abc", Length:50}; + + let param2 = {ParamType:"INOUT", DataType:1, Data:"abc", Length:50}; try { conn.querySync("drop procedure "+ schema +".proc2;"); - } catch (e) {}; - + } catch (e) { + } + // Create SP with only OUT param and no resultset. conn.querySync(proc2); // Call SP Synchronously. @@ -38,7 +40,8 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { try { conn.querySync("drop procedure "+ schema +".proc2;"); - } catch (e) {}; + } catch (e) { + } // Create SP with only Result Set and no OUT or INPUT param. conn.querySync(proc3); // Call SP Synchronously. @@ -61,4 +64,4 @@ informixdb.open(common.connectionString, {fetchMode : 3}, function (err, conn) { conn.close(function (err) { console.log("done.");}); }); }); -}); \ No newline at end of file +}); diff --git a/test/test-transaction-commit-sync.js b/test/test-transaction-commit-sync.js index 78ee76d..3c19b29 100644 --- a/test/test-transaction-commit-sync.js +++ b/test/test-transaction-commit-sync.js @@ -1,54 +1,48 @@ -var common = require("./common") - , odbc = require("../") - , db = new odbc.Database() - , assert = require("assert") - , exitCode = 0 - ; +let common = require("./common"), odbc = require("../"), db = new odbc.Database(), assert = require("assert"), + exitCode = 0; db.openSync(common.connectionString); common.createTables(db, function (err, data) { - try { - db.beginTransactionSync(); - - var results = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); - - db.rollbackTransactionSync(); - - results = db.querySync("select * from " + common.tableName); - - assert.deepEqual(results, []); - } - catch (e) { - console.log("Failed when rolling back"); - console.log(e); - exitCode = 1 - } - - try { - //Start a new transaction - db.beginTransactionSync(); - - result = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); - - db.commitTransactionSync(); //commit - - result = db.querySync("select * from " + common.tableName); - - assert.deepEqual(result, [ { colint: 42, coldatetime: null, coltext: null } ]); - } - catch (e) { - console.log("Failed when committing"); - console.log(e); - - exitCode = 2; - } - - common.dropTables(db, function (err) { - db.closeSync(); - process.exit(exitCode); - }); + try { + db.beginTransactionSync(); + + let results = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)"); + + db.rollbackTransactionSync(); + + results = db.querySync("select * from " + common.tableName); + + assert.deepEqual(results, []); + } catch (e) { + console.log("Failed when rolling back"); + console.log(e); + exitCode = 1 + } + + try { + //Start a new transaction + db.beginTransactionSync(); + + let result = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)"); + + db.commitTransactionSync(); //commit + + result = db.querySync("select * from " + common.tableName); + + assert.deepEqual(result, [{colint: 42, coldatetime: null, coltext: null}]); + } catch (e) { + console.log("Failed when committing"); + console.log(e); + + exitCode = 2; + } + + common.dropTables(db, function (err) { + db.closeSync(); + process.exit(exitCode); + }); }); diff --git a/test/test-transaction-commit.js b/test/test-transaction-commit.js index 6469633..517c74d 100644 --- a/test/test-transaction-commit.js +++ b/test/test-transaction-commit.js @@ -10,7 +10,7 @@ db.openSync(common.connectionString); common.createTables(db, function (err, data) { test1() - + function test1() { db.beginTransaction(function (err) { if (err) { @@ -18,7 +18,7 @@ common.createTables(db, function (err, data) { console.log(err); exitCode = 1 } - + var result = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); //rollback @@ -28,16 +28,16 @@ common.createTables(db, function (err, data) { console.log(err); exitCode = 2 } - + data = db.querySync("select * from " + common.tableName); - + assert.deepEqual(data, []); - + test2(); }); }); } - + function test2 () { //Start a new transaction db.beginTransaction(function (err) { @@ -46,9 +46,9 @@ common.createTables(db, function (err, data) { console.log(err); exitCode = 3 } - - result = db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)" ); - + + db.querySync("insert into " + common.tableName + " (COLINT, COLDATETIME, COLTEXT) VALUES (42, null, null)"); + //commit db.endTransaction(false, function (err) { if (err) { @@ -56,16 +56,16 @@ common.createTables(db, function (err, data) { console.log(err); exitCode = 3 } - + data = db.querySync("select * from " + common.tableName); - + assert.deepEqual(data, [ { colint: 42, coldatetime: null, coltext: null } ]); - + finish(); }); }); } - + function finish() { common.dropTables(db, function (err) { db.closeSync(); diff --git a/test/webapp.js b/test/webapp.js index 44ea881..5846339 100644 --- a/test/webapp.js +++ b/test/webapp.js @@ -21,23 +21,23 @@ function getConnection() { pool.open(cn, function(err, conn) { if(err) { console.log(err); - exit(1); + // exit(1); } try{ conn.querySync("drop table imgtab"); - } catch (e) {}; + } catch (e) {} try{ conn.querySync("create table imgtab (id int, filename varchar(50), image BLOB(200K))"); - } catch (e) {}; - + } catch (e) {} + conn.prepare("insert into imgtab (id, filename, image) values(?, ? , ?)", function(err, stmt){ if(err) return console.log(err); - stmt.execute([1, 'img1.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img1}], + stmt.execute([1, 'img1.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img1}], function(err, result){ if(err) return console.log(err); console.log("image 1 inserted."); - stmt.execute([2, 'img2.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img2}], + stmt.execute([2, 'img2.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img2}], function(err, result){ if(err) return console.log(err); else {result.closeSync();