Skip to content

cityssm/node-faster-report-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FASTER Web Report Exporter

npm (scoped) DeepSource Maintainability

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-exporter

Usage

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.

Even more open source projects related to FASTER Web