@teqed/interact-ibmi
Advanced tools
Comparing version 1.0.37 to 1.0.38
@@ -1,9 +0,31 @@ | ||
import getRows from '../../util/odbc/get-rows-odbc.js'; | ||
import { genericGetCommand } from '../generic.js'; | ||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-return */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { queryOdbc } from '../../util/odbc/odbc-util.js'; | ||
export default async () => { | ||
const inputCommand = await genericGetCommand({ | ||
message: `Enter SQL query:`, | ||
const jobInfo = (await queryOdbc(`SELECT \ | ||
ORDINAL_POSITION, JOB_NAME, JOB_NAME_SHORT, \ | ||
JOB_USER, JOB_NUMBER, SUBSYSTEM, \ | ||
SUBSYSTEM_LIBRARY_NAME, AUTHORIZATION_NAME, \ | ||
TEMPORARY_STORAGE, CPU_TIME, TOTAL_DISK_IO_COUNT, \ | ||
JOB_DESCRIPTION, JOB_DESCRIPTION_LIBRARY, \ | ||
JOB_QUEUE, JOB_QUEUE_LIBRARY, OUTPUT_QUEUE, \ | ||
OUTPUT_QUEUE_LIBRARY, CCSID, JOB_ENTERED_SYSTEM_TIME, \ | ||
CLIENT_IP_ADDRESS \ | ||
FROM TABLE(QSYS2.ACTIVE_JOB_INFO(JOB_NAME_FILTER =>'*'))`)); | ||
const jobName = jobInfo[0].JOB_NAME; | ||
const jobMessages = (await queryOdbc(`select \ | ||
MESSAGE_ID, \ | ||
MESSAGE_TYPE, \ | ||
MESSAGE_TIMESTAMP, \ | ||
FROM_PROGRAM, \ | ||
MESSAGE_TEXT, \ | ||
MESSAGE_SECOND_LEVEL_TEXT \ | ||
from table(qsys2.joblog_info('${jobName}'))`)); | ||
// Log each element of the array | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
jobMessages.forEach((element) => { | ||
console.log(element); | ||
}); | ||
const result = await getRows(inputCommand); | ||
return result; | ||
return 0; | ||
}; |
@@ -22,3 +22,3 @@ { | ||
"@types/inquirer": "^9.0.1", | ||
"@types/mocha": "^9.1.1", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.7.16", | ||
@@ -87,3 +87,3 @@ "@types/ora": "^3.2.0", | ||
"type": "module", | ||
"version": "1.0.37", | ||
"version": "1.0.38", | ||
"engines": { | ||
@@ -90,0 +90,0 @@ "node": ">=16.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75265
1560