Compare commits
6 Commits
a96b85bc53
...
3193e07e47
| Author | SHA1 | Date | |
|---|---|---|---|
| 3193e07e47 | |||
| 40bc19aa6f | |||
| 90920e8fba | |||
| f8cf0851a8 | |||
| efdab5bafc | |||
| 700346d809 |
@@ -0,0 +1,16 @@
|
|||||||
|
meta {
|
||||||
|
name: ti Intergration
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
get {
|
||||||
|
url: {{urlv2}}/api/notify/tiTrigger
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
vars {
|
vars {
|
||||||
url: http://localhost:4200
|
url: https://usflo1prod.alpla.net
|
||||||
session_cookie:
|
session_cookie:
|
||||||
urlv2: http://usmcd1vms036:3000
|
urlv2: http://usbow1vms006:3000
|
||||||
jwtV2:
|
jwtV2:
|
||||||
userID:
|
userID:
|
||||||
}
|
}
|
||||||
|
|||||||
13
app/main.ts
13
app/main.ts
@@ -3,16 +3,14 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|||||||
import { toNodeHandler } from "better-auth/node";
|
import { toNodeHandler } from "better-auth/node";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import fs from "fs";
|
|
||||||
import { createServer } from "http";
|
import { createServer } from "http";
|
||||||
import { createProxyMiddleware, fixRequestBody } from "http-proxy-middleware";
|
import { createProxyMiddleware } from "http-proxy-middleware";
|
||||||
import morgan from "morgan";
|
import morgan from "morgan";
|
||||||
import os from "os";
|
import os from "os";
|
||||||
import { dirname, join } from "path";
|
import { dirname, join } from "path";
|
||||||
import swaggerJsdoc from "swagger-jsdoc";
|
import swaggerJsdoc from "swagger-jsdoc";
|
||||||
import swaggerUi from "swagger-ui-express";
|
import swaggerUi from "swagger-ui-express";
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
import { userMigrate } from "./src/internal/auth/controller/userMigrate.js";
|
|
||||||
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
|
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
|
||||||
import { setupMobileRoutes } from "./src/internal/mobile/route.js";
|
import { setupMobileRoutes } from "./src/internal/mobile/route.js";
|
||||||
import { printers } from "./src/internal/ocp/printers/printers.js";
|
import { printers } from "./src/internal/ocp/printers/printers.js";
|
||||||
@@ -22,6 +20,7 @@ import { baseSettings } from "./src/internal/system/controller/settings/baseSett
|
|||||||
import {
|
import {
|
||||||
addListeners,
|
addListeners,
|
||||||
manualFixes,
|
manualFixes,
|
||||||
|
settingsMigrate,
|
||||||
} from "./src/internal/system/utlis/addListeners.js";
|
} from "./src/internal/system/utlis/addListeners.js";
|
||||||
import { swaggerOptions } from "./src/pkg/apiDocs/swaggerOptions.js";
|
import { swaggerOptions } from "./src/pkg/apiDocs/swaggerOptions.js";
|
||||||
import { auth } from "./src/pkg/auth/auth.js";
|
import { auth } from "./src/pkg/auth/auth.js";
|
||||||
@@ -77,6 +76,7 @@ const main = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// connect to the prod sql
|
// connect to the prod sql
|
||||||
|
console.log("Connecting to the sql server");
|
||||||
await initializeProdPool();
|
await initializeProdPool();
|
||||||
|
|
||||||
// express app
|
// express app
|
||||||
@@ -218,11 +218,16 @@ const main = async () => {
|
|||||||
v1Listener();
|
v1Listener();
|
||||||
addListeners();
|
addListeners();
|
||||||
//userMigrate();
|
//userMigrate();
|
||||||
|
|
||||||
// some temp fixes
|
// some temp fixes
|
||||||
|
// above 230 remove these
|
||||||
manualFixes();
|
manualFixes();
|
||||||
|
settingsMigrate();
|
||||||
}, 5 * 1000);
|
}, 5 * 1000);
|
||||||
|
|
||||||
|
// setTimeout(() => {
|
||||||
|
// startHonoServer();
|
||||||
|
// }, 8 * 1000);
|
||||||
|
|
||||||
// start the server up
|
// start the server up
|
||||||
server.listen(PORT, "0.0.0.0", () =>
|
server.listen(PORT, "0.0.0.0", () =>
|
||||||
log.info(
|
log.info(
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { Client } from "pg";
|
import { Client } from "pg";
|
||||||
|
import { db } from "../../../pkg/db/db.js";
|
||||||
|
import { type NewSetting, settings } from "../../../pkg/db/schema/settings.js";
|
||||||
import { createLogger } from "../../../pkg/logger/logger.js";
|
import { createLogger } from "../../../pkg/logger/logger.js";
|
||||||
|
import { tryCatch } from "../../../pkg/utils/tryCatch.js";
|
||||||
|
|
||||||
export const addListeners = async () => {
|
export const addListeners = async () => {
|
||||||
const log = createLogger({ module: "utils", subModule: "listeners" });
|
const log = createLogger({ module: "utils", subModule: "listeners" });
|
||||||
@@ -60,6 +63,7 @@ export const addListeners = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// all the migration stuff that will need to be moved later build 230 and above will need to remove
|
||||||
export const manualFixes = async () => {
|
export const manualFixes = async () => {
|
||||||
const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
|
const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
|
||||||
|
|
||||||
@@ -77,3 +81,48 @@ export const manualFixes = async () => {
|
|||||||
log.info({ error: e }, "Fix was not completed");
|
log.info({ error: e }, "Fix was not completed");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const settingsMigrate = async () => {
|
||||||
|
const log = createLogger({ module: "utils", subModule: "v1Migration" });
|
||||||
|
const client = new Client({
|
||||||
|
connectionString: process.env.DATABASE_URL_V1,
|
||||||
|
});
|
||||||
|
|
||||||
|
await client.connect();
|
||||||
|
|
||||||
|
let settingsV1: NewSetting[] = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
log.info({}, "Running the manual fix");
|
||||||
|
const s = await client.query("SELECT * FROM settings");
|
||||||
|
|
||||||
|
settingsV1 = s.rows.map((i) => {
|
||||||
|
return {
|
||||||
|
name: i.name,
|
||||||
|
value: i.value,
|
||||||
|
description: i.description,
|
||||||
|
moduleName: i.moduleName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
log.error({ error: e }, "There was an error getting the settings.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data, error } = await tryCatch(
|
||||||
|
db
|
||||||
|
.insert(settings)
|
||||||
|
.values(settingsV1)
|
||||||
|
.onConflictDoNothing()
|
||||||
|
.returning({ name: settings.name }),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
log.error({ error }, "There was an error adding new settings");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
log.info({ newSettingsAdded: data }, "New settings added");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// migrations after 230 go below here so we can keep this inline.
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ export const prodEndpoint = async <T>(
|
|||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: "There was an error processing the endpoint",
|
message: "There was an error processing the endpoint",
|
||||||
data: apiError.response.data,
|
data: apiError.response
|
||||||
|
? apiError.response.data
|
||||||
|
: [{ error: "There was an internal error." }],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -253,12 +253,60 @@ process.on("beforeExit", async () => {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// const port =
|
||||||
|
// process.env.NODE_ENV === "development"
|
||||||
|
// ? process.env.VITE_SERVER_PORT
|
||||||
|
// : process.env.PROD_PORT;
|
||||||
|
|
||||||
|
// const ocmeport = process.env.OCME_PORT;
|
||||||
|
|
||||||
|
// serve(
|
||||||
|
// {
|
||||||
|
// fetch: app.fetch,
|
||||||
|
// port: Number(port),
|
||||||
|
// hostname: "0.0.0.0",
|
||||||
|
// },
|
||||||
|
// (info) => {
|
||||||
|
// createLog(
|
||||||
|
// "info",
|
||||||
|
// "LST",
|
||||||
|
// "server",
|
||||||
|
// `Server is running on http://${info.address}:${info.port}`,
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * Only for ocme until we get them switched over to the single port setup.
|
||||||
|
// */
|
||||||
|
// // const setting = await db.select().from(settings);
|
||||||
|
// const setting = serverSettings;
|
||||||
|
// const isActive = setting.filter((n) => n.name === "ocmeService");
|
||||||
|
// if (ocmeport && isActive[0]?.value === "1") {
|
||||||
|
// serve(
|
||||||
|
// {
|
||||||
|
// fetch: app.fetch,
|
||||||
|
// port: Number(ocmeport),
|
||||||
|
// hostname: "0.0.0.0",
|
||||||
|
// },
|
||||||
|
// (info) => {
|
||||||
|
// createLog(
|
||||||
|
// "info",
|
||||||
|
// "LST",
|
||||||
|
// "server",
|
||||||
|
// `Ocme section is listening on http://${info.address}:${info.port}`,
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
const port =
|
const port =
|
||||||
process.env.NODE_ENV === "development"
|
process.env.NODE_ENV === "development"
|
||||||
? process.env.VITE_SERVER_PORT
|
? process.env.VITE_SERVER_PORT
|
||||||
: process.env.PROD_PORT;
|
: process.env.PROD_PORT;
|
||||||
|
|
||||||
const ocmeport = process.env.OCME_PORT;
|
const ocmeport = process.env.OCME_PORT;
|
||||||
|
|
||||||
serve(
|
serve(
|
||||||
{
|
{
|
||||||
fetch: app.fetch,
|
fetch: app.fetch,
|
||||||
@@ -275,10 +323,6 @@ serve(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* Only for ocme until we get them switched over to the single port setup.
|
|
||||||
*/
|
|
||||||
// const setting = await db.select().from(settings);
|
|
||||||
const setting = serverSettings;
|
const setting = serverSettings;
|
||||||
const isActive = setting.filter((n) => n.name === "ocmeService");
|
const isActive = setting.filter((n) => n.name === "ocmeService");
|
||||||
if (ocmeport && isActive[0]?.value === "1") {
|
if (ocmeport && isActive[0]?.value === "1") {
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ export let xmlPayloadTI = `
|
|||||||
</ContactMethods>
|
</ContactMethods>
|
||||||
</Contact>
|
</Contact>
|
||||||
</Contacts>
|
</Contacts>
|
||||||
|
<!-- Delivery Comments -->
|
||||||
|
<!-- <Comments>[customerSpecificInstructions]</Comments> -->
|
||||||
</Address>
|
</Address>
|
||||||
<Shipments>
|
<Shipments>
|
||||||
<ReferenceNumbers>
|
<ReferenceNumbers>
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ export const createPlcMonitor = (config: any) => {
|
|||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
if (tag.value === 0) return;
|
if (tag.value === 0) return;
|
||||||
const macId = await getMac(tag.value);
|
const macId = await getMac(tag.value);
|
||||||
|
|
||||||
|
// temp work around until we can get the zechetti 2 to play nice with lst
|
||||||
|
if (cfg.id === "Zecchetti_2") return;
|
||||||
// const { data, error } = (await tryCatch(
|
// const { data, error } = (await tryCatch(
|
||||||
// query(
|
// query(
|
||||||
// getCurrentLabel
|
// getCurrentLabel
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* has no value and just here until; we remove everything
|
||||||
|
*/
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import { db } from "../../../../../database/dbclient.js";
|
import { db } from "../../../../../database/dbclient.js";
|
||||||
import {settings} from "../../../../../database/schema/settings.js";
|
|
||||||
import {createLog} from "../../../logger/logger.js";
|
|
||||||
import {userRoles} from "../../../../../database/schema/userRoles.js";
|
|
||||||
import { modules } from "../../../../../database/schema/modules.js";
|
import { modules } from "../../../../../database/schema/modules.js";
|
||||||
|
import { settings } from "../../../../../database/schema/settings.js";
|
||||||
|
import { userRoles } from "../../../../../database/schema/userRoles.js";
|
||||||
|
import { createLog } from "../../../logger/logger.js";
|
||||||
|
|
||||||
export const addSetting = async (data: any, user_id: string) => {
|
export const addSetting = async (data: any, user_id: string) => {
|
||||||
createLog("info", "lst", "server", "Adding a new setting");
|
createLog("info", "lst", "server", "Adding a new setting");
|
||||||
@@ -12,12 +15,17 @@ export const addSetting = async (data: any, user_id: string) => {
|
|||||||
const sysAdmin = await db
|
const sysAdmin = await db
|
||||||
.select()
|
.select()
|
||||||
.from(userRoles)
|
.from(userRoles)
|
||||||
.where(and(eq(userRoles.user_id, user_id), eq(userRoles.role, "systemAdmin")));
|
.where(
|
||||||
|
and(eq(userRoles.user_id, user_id), eq(userRoles.role, "systemAdmin")),
|
||||||
|
);
|
||||||
|
|
||||||
if (sysAdmin) {
|
if (sysAdmin) {
|
||||||
createLog("info", "lst", "server", `Setting ${data.name} is being added`);
|
createLog("info", "lst", "server", `Setting ${data.name} is being added`);
|
||||||
try {
|
try {
|
||||||
const moduleId = await db.select().from(modules).where(eq(modules.name, data.module));
|
const moduleId = await db
|
||||||
|
.select()
|
||||||
|
.from(modules)
|
||||||
|
.where(eq(modules.name, data.module));
|
||||||
|
|
||||||
// filter out the module and add in the module id
|
// filter out the module and add in the module id
|
||||||
//delete data.module;
|
//delete data.module;
|
||||||
@@ -31,6 +39,8 @@ export const addSetting = async (data: any, user_id: string) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
createLog("error", "lst", "server", "This user cannot add new roles");
|
createLog("error", "lst", "server", "This user cannot add new roles");
|
||||||
throw new Error("The user trying to add a setting dose not have the correct permissions");
|
throw new Error(
|
||||||
|
"The user trying to add a setting dose not have the correct permissions",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* This is only used now to get the settings from the new server
|
||||||
|
*/
|
||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { db } from "../../../../../database/dbclient.js";
|
import { Client } from "pg";
|
||||||
import { settings } from "../../../../../database/schema/settings.js";
|
|
||||||
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
||||||
import { createLog } from "../../../logger/logger.js";
|
|
||||||
import type { Settings } from "../../../../types/settings.js";
|
import type { Settings } from "../../../../types/settings.js";
|
||||||
|
import { createLog } from "../../../logger/logger.js";
|
||||||
|
|
||||||
export let serverSettings: Settings[];
|
export let serverSettings: Settings[];
|
||||||
export const getSettings = async () => {
|
export const getSettings = async () => {
|
||||||
@@ -13,45 +17,56 @@ export const getSettings = async () => {
|
|||||||
"info",
|
"info",
|
||||||
"lst",
|
"lst",
|
||||||
"server",
|
"server",
|
||||||
`Settings are being grabbed from: ${
|
`Settings are being grabbed from the app now`,
|
||||||
settingsType === "true" ? "Go backend" : "Localbackend"
|
|
||||||
}`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const baseUrl = process.env.LST_BASE_URL;
|
//if (settingsType !== "true") {
|
||||||
|
|
||||||
if (settingsType === "true") {
|
|
||||||
const { data, error } = (await tryCatch(
|
|
||||||
axios.get(`${baseUrl}/api/v1/settings`)
|
|
||||||
)) as any;
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
createLog(
|
|
||||||
"error",
|
|
||||||
"lst",
|
|
||||||
"server",
|
|
||||||
"There was an error getting the settings"
|
|
||||||
);
|
|
||||||
throw new Error("There was an error getting the settings");
|
|
||||||
}
|
|
||||||
|
|
||||||
serverSettings = data.data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settingsType !== "true") {
|
|
||||||
try {
|
try {
|
||||||
serverSettings = (await db.select().from(settings)) as any;
|
// serverSettings = (await db.select().from(settings)) as any;
|
||||||
|
const dbUrl = String(process.env.DATABASE_URL).replace("lst_db", "lst");
|
||||||
|
const client = new Client({
|
||||||
|
connectionString: dbUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
await client.connect();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const s = await client.query("SELECT * FROM settings");
|
||||||
|
|
||||||
|
serverSettings = s.rows;
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
//.where(sql`${userRole} = ANY(roles)`);
|
//.where(sql`${userRole} = ANY(roles)`);
|
||||||
|
|
||||||
|
// const { data, error } = (await tryCatch(
|
||||||
|
// axios.get(
|
||||||
|
// `http://localhost:${process.env.VITE_SERVER_PORT}/lst/api/system/settings`,
|
||||||
|
// ),
|
||||||
|
// )) as any;
|
||||||
|
|
||||||
|
// if (error) {
|
||||||
|
// createLog(
|
||||||
|
// "error",
|
||||||
|
// "lst",
|
||||||
|
// "server",
|
||||||
|
// "There was an error getting the settings",
|
||||||
|
// );
|
||||||
|
// throw new Error("There was an error getting the settings");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//serverSettings = data.data.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createLog(
|
createLog(
|
||||||
"error",
|
"error",
|
||||||
"lst",
|
"lst",
|
||||||
"server",
|
"server",
|
||||||
"There was an error getting the settings"
|
"There was an error getting the settings",
|
||||||
);
|
);
|
||||||
throw new Error("There was an error getting the settings");
|
throw new Error("There was an error getting the settings");
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
//console.log(serverSettings);
|
||||||
return serverSettings;
|
return serverSettings;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* has no value and just here until; we remove everything
|
||||||
|
*/
|
||||||
|
|
||||||
import { and, eq, sql } from "drizzle-orm";
|
import { and, eq, sql } from "drizzle-orm";
|
||||||
import { db } from "../../../../../database/dbclient.js";
|
import { db } from "../../../../../database/dbclient.js";
|
||||||
import { settings } from "../../../../../database/schema/settings.js";
|
import { settings } from "../../../../../database/schema/settings.js";
|
||||||
import {createLog} from "../../../logger/logger.js";
|
|
||||||
import { userRoles } from "../../../../../database/schema/userRoles.js";
|
import { userRoles } from "../../../../../database/schema/userRoles.js";
|
||||||
import { users } from "../../../../../database/schema/users.js";
|
import { users } from "../../../../../database/schema/users.js";
|
||||||
|
import { createLog } from "../../../logger/logger.js";
|
||||||
|
|
||||||
export const updateSetting = async (data: any, user_id: string) => {
|
export const updateSetting = async (data: any, user_id: string) => {
|
||||||
createLog("info", "lst", "server", "Adding a new setting");
|
createLog("info", "lst", "server", "Adding a new setting");
|
||||||
@@ -12,19 +16,28 @@ export const updateSetting = async (data: any, user_id: string) => {
|
|||||||
const sysAdmin = await db
|
const sysAdmin = await db
|
||||||
.select()
|
.select()
|
||||||
.from(userRoles)
|
.from(userRoles)
|
||||||
.where(and(eq(userRoles.user_id, user_id), eq(userRoles.role, "systemAdmin")));
|
.where(
|
||||||
|
and(eq(userRoles.user_id, user_id), eq(userRoles.role, "systemAdmin")),
|
||||||
|
);
|
||||||
|
|
||||||
if (sysAdmin) {
|
if (sysAdmin) {
|
||||||
createLog("info", "lst", "server", `Setting ${data.name} is being updated`);
|
createLog("info", "lst", "server", `Setting ${data.name} is being updated`);
|
||||||
|
|
||||||
//get the username so we can update the correct field
|
//get the username so we can update the correct field
|
||||||
const user = await db.select().from(users).where(eq(users.user_id, user_id));
|
const user = await db
|
||||||
|
.select()
|
||||||
|
.from(users)
|
||||||
|
.where(eq(users.user_id, user_id));
|
||||||
try {
|
try {
|
||||||
//const settingID = await db.select().from(settings).where(eq(settings.name, data.module));
|
//const settingID = await db.select().from(settings).where(eq(settings.name, data.module));
|
||||||
|
|
||||||
const updateSetting = await db
|
const updateSetting = await db
|
||||||
.update(settings)
|
.update(settings)
|
||||||
.set({value: data.value, upd_user: user[0].username, upd_date: sql`NOW()`})
|
.set({
|
||||||
|
value: data.value,
|
||||||
|
upd_user: user[0].username,
|
||||||
|
upd_date: sql`NOW()`,
|
||||||
|
})
|
||||||
.where(eq(settings.name, data.name));
|
.where(eq(settings.name, data.name));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createLog("error", "lst", "server", "Error updating setting");
|
createLog("error", "lst", "server", "Error updating setting");
|
||||||
@@ -32,6 +45,8 @@ export const updateSetting = async (data: any, user_id: string) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
createLog("error", "lst", "server", "This user cannot add new roles");
|
createLog("error", "lst", "server", "This user cannot add new roles");
|
||||||
throw new Error("The user trying to add a setting dose not have the correct permissions");
|
throw new Error(
|
||||||
|
"The user trying to add a setting dose not have the correct permissions",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -44,16 +44,13 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dotenvx/dotenvx": "^1.51.0",
|
"@dotenvx/dotenvx": "^1.51.0",
|
||||||
"@tanstack/react-table": "^8.21.3",
|
|
||||||
"@types/cors": "^2.8.19",
|
"@types/cors": "^2.8.19",
|
||||||
"axios": "^1.12.2",
|
"axios": "^1.12.2",
|
||||||
"better-auth": "^1.3.28",
|
"better-auth": "^1.3.28",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"date-fns-tz": "^3.2.0",
|
"date-fns-tz": "^3.2.0",
|
||||||
"drizzle-kit": "^0.31.5",
|
|
||||||
"drizzle-orm": "^0.44.6",
|
"drizzle-orm": "^0.44.6",
|
||||||
"drizzle-zod": "^0.8.3",
|
|
||||||
"express": "^5.1.0",
|
"express": "^5.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"http-proxy-middleware": "^3.0.5",
|
"http-proxy-middleware": "^3.0.5",
|
||||||
@@ -61,7 +58,6 @@
|
|||||||
"mssql": "^12.0.0",
|
"mssql": "^12.0.0",
|
||||||
"nodemailer": "^7.0.9",
|
"nodemailer": "^7.0.9",
|
||||||
"nodemailer-express-handlebars": "^7.0.0",
|
"nodemailer-express-handlebars": "^7.0.0",
|
||||||
"npm-check-updates": "^19.1.1",
|
|
||||||
"pg": "^8.16.3",
|
"pg": "^8.16.3",
|
||||||
"pino": "^10.1.0",
|
"pino": "^10.1.0",
|
||||||
"pino-pretty": "^13.1.2",
|
"pino-pretty": "^13.1.2",
|
||||||
@@ -69,7 +65,8 @@
|
|||||||
"socket.io": "^4.8.1",
|
"socket.io": "^4.8.1",
|
||||||
"swagger-jsdoc": "^6.2.8",
|
"swagger-jsdoc": "^6.2.8",
|
||||||
"swagger-ui-express": "^5.0.1",
|
"swagger-ui-express": "^5.0.1",
|
||||||
"zod": "^4.1.12"
|
"zod": "^4.1.12",
|
||||||
|
"drizzle-zod": "^0.8.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.2.6",
|
"@biomejs/biome": "2.2.6",
|
||||||
@@ -91,7 +88,9 @@
|
|||||||
"standard-version": "^9.5.0",
|
"standard-version": "^9.5.0",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"tsx": "^4.20.6",
|
"tsx": "^4.20.6",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3",
|
||||||
|
"drizzle-kit": "^0.31.5",
|
||||||
|
"npm-check-updates": "^19.1.1"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"commitizen": {
|
"commitizen": {
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ function Update-Server {
|
|||||||
@{ Key = "BETTER_AUTH_SECRET"; Value = "3d2b7d64ac2f9ebd6854325a84390666f4bbd2c7c3f537bb60fca3740f081e1e"; Comment = "used for better auth secrets" },
|
@{ Key = "BETTER_AUTH_SECRET"; Value = "3d2b7d64ac2f9ebd6854325a84390666f4bbd2c7c3f537bb60fca3740f081e1e"; Comment = "used for better auth secrets" },
|
||||||
@{ Key = "BETTER_AUTH_URL"; Value = "https://$Server.alpla.net"; Comment = "The better auth url" }
|
@{ Key = "BETTER_AUTH_URL"; Value = "https://$Server.alpla.net"; Comment = "The better auth url" }
|
||||||
@{ Key = "NODE_ENV"; Value = "production"; Comment = "Just making sure this is in there." }
|
@{ Key = "NODE_ENV"; Value = "production"; Comment = "Just making sure this is in there." }
|
||||||
|
@{ Key = "VITE_SERVER_PORT"; Value = "4000"; Comment = "Reusing a env that could possibly already be here so we can continue the migration to a single app." }
|
||||||
)
|
)
|
||||||
|
|
||||||
$envFile = "$LocalPath\.env"
|
$envFile = "$LocalPath\.env"
|
||||||
|
|||||||
Reference in New Issue
Block a user