Linting fixes.
This commit is contained in:
@@ -11,11 +11,11 @@ export interface ActiveBodyshopQueryResult {
|
||||
}>;
|
||||
}
|
||||
// No variables needed for this query
|
||||
interface ActiveBodyshopQueryVariables {}
|
||||
|
||||
// Transform the string query into a TypedQueryDocumentNode
|
||||
export const QUERY_ACTIVE_BODYSHOP_TYPED: TypedQueryDocumentNode<
|
||||
ActiveBodyshopQueryResult,
|
||||
ActiveBodyshopQueryVariables
|
||||
Record<never, never>
|
||||
> = parse(gql`
|
||||
query QUERY_ACTIVE_BODYSHOP {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
@@ -24,10 +24,7 @@ export const QUERY_ACTIVE_BODYSHOP_TYPED: TypedQueryDocumentNode<
|
||||
region_config
|
||||
}
|
||||
}
|
||||
`) as TypedQueryDocumentNode<
|
||||
ActiveBodyshopQueryResult,
|
||||
ActiveBodyshopQueryVariables
|
||||
>;
|
||||
`) as TypedQueryDocumentNode<ActiveBodyshopQueryResult, Record<never, never>>;
|
||||
|
||||
export interface MasterdataQueryResult {
|
||||
masterdata: Array<{
|
||||
|
||||
@@ -2,15 +2,17 @@ import cors from "cors";
|
||||
import { app } from "electron";
|
||||
import log from "electron-log/main";
|
||||
import express from "express";
|
||||
import { handleQuickBookRequest } from "../quickbooks-desktop/quickbooks-desktop";
|
||||
import http from "http";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { handleQuickBookRequest } from "../quickbooks-desktop/quickbooks-desktop";
|
||||
|
||||
export default class LocalServer {
|
||||
private app: express.Application;
|
||||
private server: any;
|
||||
private server: http.Server | null;
|
||||
private PORT = 1337;
|
||||
|
||||
constructor() {
|
||||
this.server = null;
|
||||
this.app = express();
|
||||
this.configureMiddleware();
|
||||
this.configureRoutes();
|
||||
@@ -96,10 +98,10 @@ export default class LocalServer {
|
||||
|
||||
private configureRoutes(): void {
|
||||
// Basic health check endpoint
|
||||
this.app.get("/health", (req: express.Request, res: express.Response) => {
|
||||
this.app.get("/health", (_req: express.Request, res: express.Response) => {
|
||||
res.status(200).json({ status: "ok" });
|
||||
});
|
||||
this.app.post("/ping", (req, res) => {
|
||||
this.app.post("/ping", (_req, res) => {
|
||||
res.status(200).json({
|
||||
appVer: app.getVersion(),
|
||||
qbPath: app.getPath("userData"), //TODO: Resolve to actual QB file path.
|
||||
@@ -112,9 +114,11 @@ export default class LocalServer {
|
||||
|
||||
public start(): void {
|
||||
try {
|
||||
this.server = this.app.listen(this.PORT, (error: Error) => {
|
||||
this.server = this.app.listen(this.PORT, (error: Error | undefined) => {
|
||||
if (error) {
|
||||
log.error(`[HTTP Server] Error starting server: ${error}`);
|
||||
log.error(
|
||||
`[HTTP Server] Error starting server: ${errorTypeCheck(error)}`,
|
||||
);
|
||||
} else {
|
||||
log.info(
|
||||
`[HTTP Server] Local HTTP server running on port ${this.PORT}`,
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
removeWatcherPath,
|
||||
StartWatcher,
|
||||
StopWatcher,
|
||||
watcher,
|
||||
} from "../watcher/watcher";
|
||||
|
||||
const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
@@ -31,7 +30,7 @@ const SettingsWatchedFilePathsAdd = async (): Promise<string[]> => {
|
||||
return Store.get("settings.filepaths");
|
||||
};
|
||||
const SettingsWatchedFilePathsRemove = async (
|
||||
event: IpcMainInvokeEvent,
|
||||
_event: IpcMainInvokeEvent,
|
||||
path: string,
|
||||
): Promise<string[]> => {
|
||||
Store.set(
|
||||
@@ -56,7 +55,7 @@ const SettingsWatcherPollingGet = async (): Promise<{
|
||||
return { enabled: pollingEnabled.enabled, interval: pollingEnabled.interval };
|
||||
};
|
||||
const SettingsWatcherPollingSet = async (
|
||||
event: IpcMainInvokeEvent,
|
||||
_event: IpcMainInvokeEvent,
|
||||
pollingSettings: {
|
||||
enabled: boolean;
|
||||
interval: number;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import log from "electron-log/main";
|
||||
|
||||
import { Request, Response } from "express";
|
||||
import { UUID } from "crypto";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { Request, Response } from "express";
|
||||
import _ from "lodash";
|
||||
import store from "../store/store";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let Winax: any; // Declare Winax as any to avoid TypeScript errors on non-Windows platforms
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
Winax = require("winax");
|
||||
}
|
||||
|
||||
@@ -99,11 +100,11 @@ export function TestQB(): void {
|
||||
let requestProcessor, ticket;
|
||||
try {
|
||||
requestProcessor = new Winax.Object("QBXMLRP.RequestProcessor.1");
|
||||
const connection = requestProcessor.OpenConnection("", "ShopPartnerOneoFf");
|
||||
requestProcessor.OpenConnection("", "ShopPartnerOneoFf");
|
||||
|
||||
ticket = requestProcessor.BeginSession("", 2); //2 indicated qbFileOFpenModeDoNotCare
|
||||
ticket = requestProcessor.BeginSession("", 2); //2 indicated qbFileOOpenModeDoNotCare
|
||||
|
||||
const qbre = requestProcessor.ProcessRequest(
|
||||
requestProcessor.ProcessRequest(
|
||||
ticket,
|
||||
`<?qbxml version="16.0"?>
|
||||
<QBXML>
|
||||
|
||||
Reference in New Issue
Block a user