Resolve source map issue and rename additional files.

This commit is contained in:
Patrick Fic
2025-12-11 10:52:49 -08:00
parent d0d487abe8
commit d75f8a3155
7 changed files with 97 additions and 32 deletions

15
package-lock.json generated
View File

@@ -18,6 +18,7 @@
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"electron-log": "^5.4.3", "electron-log": "^5.4.3",
"electron-updater": "^6.6.2", "electron-updater": "^6.6.2",
"source-map-support": "^0.5.21",
"winax": "^3.6.2" "winax": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {
@@ -34,6 +35,7 @@
"@types/node-cron": "^3.0.11", "@types/node-cron": "^3.0.11",
"@types/react": "^19.2.7", "@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@types/source-map-support": "^0.5.10",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"@vitejs/plugin-react": "^5.1.2", "@vitejs/plugin-react": "^5.1.2",
"antd": "^6.1.0", "antd": "^6.1.0",
@@ -5427,6 +5429,16 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/source-map-support": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.10.tgz",
"integrity": "sha512-tgVP2H469x9zq34Z0m/fgPewGhg/MLClalNOiPIzQlXrSS2YrKu/xCdSCKnEDwkFha51VKEKB6A9wW26/ZNwzA==",
"dev": true,
"license": "MIT",
"dependencies": {
"source-map": "^0.6.0"
}
},
"node_modules/@types/tedious": { "node_modules/@types/tedious": {
"version": "4.0.14", "version": "4.0.14",
"resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz",
@@ -6804,7 +6816,6 @@
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/builder-util": { "node_modules/builder-util": {
@@ -13895,7 +13906,6 @@
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
@@ -13915,7 +13925,6 @@
"version": "0.5.21", "version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"buffer-from": "^1.0.0", "buffer-from": "^1.0.0",

View File

@@ -31,6 +31,7 @@
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"electron-log": "^5.4.3", "electron-log": "^5.4.3",
"electron-updater": "^6.6.2", "electron-updater": "^6.6.2",
"source-map-support": "^0.5.21",
"winax": "^3.6.2" "winax": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {
@@ -47,6 +48,7 @@
"@types/node-cron": "^3.0.11", "@types/node-cron": "^3.0.11",
"@types/react": "^19.2.7", "@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@types/source-map-support": "^0.5.10",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"@vitejs/plugin-react": "^5.1.2", "@vitejs/plugin-react": "^5.1.2",
"antd": "^6.1.0", "antd": "^6.1.0",

View File

@@ -157,15 +157,15 @@ async function ImportJob(filepath: string): Promise<void> {
uploadNotification.show(); uploadNotification.show();
//Scrub the estimate //Scrub the estimate
const scrubResults = ScrubEstimate({ job: jobObject }); const scrubResults = await ScrubEstimate({ job: jobObject });
console.log("Scrub Results:", scrubResults);
UploadEmsToS3({ // UploadEmsToS3({
extensionlessFilePath, // extensionlessFilePath,
bodyshopid: newAvailableJob.bodyshopid, // bodyshopid: newAvailableJob.bodyshopid,
ciecaid: jobObject.ciecaid ?? "", // ciecaid: jobObject.ciecaid ?? "",
clm_no: jobObject.clm_no ?? "", // clm_no: jobObject.clm_no ?? "",
ownr_ln: jobObject.ownr_ln ?? "", // ownr_ln: jobObject.ownr_ln ?? "",
}); // });
} catch (error) { } catch (error) {
log.error("Error encountered while decoding job. ", errorTypeCheck(error)); log.error("Error encountered while decoding job. ", errorTypeCheck(error));
const uploadNotificationFailure = new Notification({ const uploadNotificationFailure = new Notification({

View File

@@ -67,8 +67,8 @@ async function ScrubEstimate({ job }): Promise<string | undefined> {
job.sending_entity_id = sendingEntityId; job.sending_entity_id = sendingEntityId;
job.sending_entity_accept_terms_of_use = true; job.sending_entity_accept_terms_of_use = true;
job.association_switch = "ATAM"; job.association_switch = "ATAM";
job.rf_zip = job.bodyshop.zip_post; job.rf_zip = "R0G 1Z0" || job.bodyshop?.zip_post; //TODO: REPLACE WITH BODYSHOP ZIP IF AVAILABLE
job.rf_ph1 = job.bodyshop.phone; job.rf_ph1 = "2043792253" || job.bodyshop?.phone; //TODO: REPLACE WITH BODYSHOP PHONE IF AVAILABLE
job.g_ttl_amt = job.clm_total; job.g_ttl_amt = job.clm_total;
job.source_system = "M"; //Requested by Steven. job.source_system = "M"; //Requested by Steven.
job.v_mileage = job.v_mileage?.toString() || ""; //Requested by Steven to be a string. job.v_mileage = job.v_mileage?.toString() || ""; //Requested by Steven to be a string.
@@ -125,20 +125,21 @@ async function ScrubEstimate({ job }): Promise<string | undefined> {
`${fileName}.json`, `${fileName}.json`,
); );
const result = await axios.post( // const result = await axios.post(
`${estimateScrubberUrl}/api/sendems`, // `${estimateScrubberUrl}/api/sendems`,
formData, // formData,
{ // {
auth: { // auth: {
username: basicAuthUser, // username: basicAuthUser,
password: basicAuthpassword, // password: basicAuthpassword,
}, // },
headers: { // headers: {
...(formData.getHeaders ? formData.getHeaders() : {}), // ...(formData.getHeaders ? formData.getHeaders() : {}),
APIkey: esApiKey, // APIkey: esApiKey,
}, // },
}, // },
); // );
const result = null;
const resultPDFUrl = result?.data?.report_link; const resultPDFUrl = result?.data?.report_link;
const reportIssueUrl = `https://insurtechtoolkit.com/pcontactUs.aspx?apiKey=${esApiKey}&file=${fileName}.json`; const reportIssueUrl = `https://insurtechtoolkit.com/pcontactUs.aspx?apiKey=${esApiKey}&file=${fileName}.json`;

View File

@@ -1,3 +1,4 @@
import "source-map-support/register";
import { is, optimizer, platform } from "@electron-toolkit/utils"; import { is, optimizer, platform } from "@electron-toolkit/utils";
import Sentry from "@sentry/electron/main"; import Sentry from "@sentry/electron/main";
import { import {

View File

@@ -16,7 +16,7 @@ export async function setupKeepAliveAgent(): Promise<void> {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>Label</key> <key>Label</key>
<string>com.convenientbrands.bodyshop-desktop.keepalive</string> <string>com.imex.esdp.keepalive</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>Shop Partner Keep Alive</string> <string>Shop Partner Keep Alive</string>
@@ -31,7 +31,7 @@ export async function setupKeepAliveAgent(): Promise<void> {
const plistPath = join( const plistPath = join(
homedir(), homedir(),
"/Library/LaunchAgents/com.convenientbrands.bodyshop-desktop.keepalive.plist", "/Library/LaunchAgents/com.imex.esdp.keepalive.plist",
); );
try { try {
@@ -50,7 +50,7 @@ export async function setupKeepAliveAgent(): Promise<void> {
export async function isKeepAliveAgentInstalled(): Promise<boolean> { export async function isKeepAliveAgentInstalled(): Promise<boolean> {
const plistPath = join( const plistPath = join(
homedir(), homedir(),
"/Library/LaunchAgents/com.convenientbrands.bodyshop-desktop.keepalive.plist", "/Library/LaunchAgents/com.imex.esdp.keepalive.plist",
); );
const maxRetries = 3; const maxRetries = 3;
const retryDelay = 500; // 500ms delay between retries const retryDelay = 500; // 500ms delay between retries
@@ -59,7 +59,7 @@ export async function isKeepAliveAgentInstalled(): Promise<boolean> {
try { try {
await fs.access(plistPath, fs.constants.F_OK); await fs.access(plistPath, fs.constants.F_OK);
const { stdout } = await execPromise( const { stdout } = await execPromise(
`launchctl list | grep com.convenientbrands.bodyshop-desktop.keepalive`, `launchctl list | grep com.imex.esdp.keepalive`,
); );
return !!stdout; // Return true if plist exists and agent is loaded return !!stdout; // Return true if plist exists and agent is loaded
} catch (error) { } catch (error) {

52
src/main/util/opCodes.ts Normal file
View File

@@ -0,0 +1,52 @@
//Hard coded as these values don't change.
const opCodes = {
OP0: { desc: "REMOVE / REPLACE PARTIAL", opcode: "OP11", partcode: "PAA" },
OP1: { desc: "REFINISH / REPAIR", opcode: "OP1", partcode: "PAE" },
OP2: { desc: "REMOVE / INSTALL", opcode: "OP2", partcode: "PAE" },
OP3: { desc: "ADDITIONAL LABOR", opcode: "OP9", partcode: "PAE" },
OP4: { desc: "ALIGNMENT", opcode: "OP4", partcode: "PAS" },
OP5: { desc: "OVERHAUL", opcode: "OP5", partcode: "PAE" },
OP6: { desc: "REFINISH", opcode: "OP6", partcode: "PAE" },
OP7: { desc: "INSPECT", opcode: "OP7", partcode: "PAE" },
OP8: { desc: "CHECK / ADJUST", opcode: "OP8", partcode: "PAE" },
OP9: { desc: "REPAIR", opcode: "OP9", partcode: "PAE" },
OP10: { desc: "REPAIR , PARTIAL", opcode: "OP9", partcode: "PAE" },
OP11: { desc: "REMOVE / REPLACE", opcode: "OP11", partcode: "PAN" },
OP12: { desc: "REMOVE / REPLACE PARTIAL", opcode: "OP11", partcode: "PAN" },
OP13: { desc: "ADDITIONAL COSTS", opcode: "OP13", partcode: "PAE" },
OP14: { desc: "ADDITIONAL OPERATIONS", opcode: "OP14", partcode: "PAE" },
OP15: { desc: "BLEND", opcode: "OP15", partcode: "PAE" },
OP16: { desc: "SUBLET", opcode: "OP16", partcode: "PAS" },
OP17: { desc: "POLICY LIMIT ADJUSTMENT", opcode: "OP9", partcode: "PAE" },
OP18: { desc: "APPEAR ALLOWANCE", opcode: "OP7", partcode: "PAE" },
OP20: { desc: "REMOVE AND REINSTALL", opcode: "OP20", partcode: "PAE" },
OP24: { desc: "CHIPGUARD", opcode: "OP6", partcode: "PAE" },
OP25: { desc: "TWO TONE", opcode: "OP6", partcode: "PAE" },
OP26: { desc: "PAINTLESS DENT REPAIR", opcode: "OP16", partcode: "PAE" },
OP100: { desc: "REPLACE PRE-PRICED", opcode: "OP11", partcode: "PAA" },
OP101: {
desc: "REMOVE/REPLACE RECYCLED PART",
opcode: "OP11",
partcode: "PAL",
},
OP103: { desc: "REMOVE / REPLACE PARTIAL", opcode: "OP11", partcode: "PAA" },
OP104: {
desc: "REMOVE / REPLACE PARTIAL LABOUR",
opcode: "OP11",
partcode: "PAA",
},
OP105: { desc: "!!ADJUST MANUALLY!!", opcode: "OP99", partcode: "PAE" },
OP106: { desc: "REPAIR , PARTIAL", opcode: "OP9", partcode: "PAE" },
OP107: { desc: "CHIPGUARD", opcode: "OP6", partcode: "PAE" },
OP108: { desc: "MULTI TONE", opcode: "OP6", partcode: "PAE" },
OP109: { desc: "REPLACE PRE-PRICED", opcode: "OP11", partcode: "PAA" },
OP110: { desc: "REFINISH / REPAIR", opcode: "OP1", partcode: "PAE" },
OP111: { desc: "REMOVE / REPLACE", opcode: "OP11", partcode: "PAN" },
OP112: { desc: "REMOVE / REPLACE", opcode: "OP11", partcode: "PAA" },
OP113: { desc: "REPLACE PRE-PRICED", opcode: "OP11", partcode: "PAA" },
OP114: { desc: "REPLACE PRE-PRICED", opcode: "OP11", partcode: "PAA" },
OP120: { desc: "REPAIR , PARTIAL", opcode: "OP9", partcode: "PAE" },
OP260: { desc: "SUBLET", opcode: "OP16", partcode: "PAE" },
};
export default opCodes;