0.6.1 • Published 10 months ago
@cityssm/faster-report-exporter v0.6.1
FASTER Web Report Exporter
On demand exports of selected reports from the FASTER Web Fleet Management System.
This module uses a headless Puppeteer browser to log into FASTER Web, navigate to the appropriate report, and select the preferred export format. Once downloaded, the module returns the path to the downloaded file.
Installation
npm install @cityssm/faster-report-exporterUsage
import { FasterReportExporter } from '@cityssm/faster-report-exporter'
const reportExporter = new FasterReportExporter(
fasterTenant,
fasterUserName,
fasterPassword
)
reportExporter.setDownloadFolderPath('C:\\Temp')
/*
* Part Orders
*/
const partOrderReport =
await reportExporter.exportPartOrderPrint(partOrderNumber)
console.log(partOrderReport)
// => "C:\Temp\70578b74-261c-499c-bdfe-1ca6c17967b1.pdf"
/*
* Work Orders
*/
const technicianReport =
await reportExporter.exportWorkOrderTechnicianPrint(workOrderNumber)
const customerReport =
await reportExporter.exportWorkOrderCustomerPrint(workOrderNumber)
/*
* Message Logger
*/
const messageLoggerReport = await reportExporter.exportMessageLogger(
startDate,
endDate
)
/*
* Scheduled Reports
*/
const scheduledReport = await reportExporter.exportScheduledReport(
scheduleName,
startDate,
endDate
)Enabling Debug Output
This package uses the debug package for debugging output. For convenience, the debug namespace used by this pacakge, and full namespace enable string are exported.
Debug output can be enabled programmatically, as shown in the example below.
import { DEBUG_ENABLE_NAMESPACES } from '@cityssm/faster-report-exporter/debug'
import Debug from 'debug'
Debug.enable(DEBUG_ENABLE_NAMESPACES)Debugging output can also be enabled using environment variables, decribed in the debug package documentation.
More Code for FASTER Web
FASTER Web Report Parser Parses select Excel and CSV reports from FASTER Web into usable data objects.