Implement relational owner securing logic and persistence
Deploy Bürgerwind / deploy (push) Successful in 17s
Details
Deploy Bürgerwind / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
9164281cfb
commit
b824c8ea73
129
app.js
129
app.js
|
|
@ -1271,12 +1271,23 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
selectFirstName.innerHTML = optionsHtml;
|
||||
selectLastName.innerHTML = optionsHtml;
|
||||
|
||||
// Smart Defaults: Try to find keys starting with V for First Name and N for Last Name
|
||||
const vMatch = sortedKeys.find(k => k.toLowerCase().startsWith('v'));
|
||||
const nMatch = sortedKeys.find(k => k.toLowerCase().startsWith('n'));
|
||||
// Smart Defaults: Prefer VNA for First Name and NBA (or GNA/Name) for Last Name
|
||||
const vnaMatch = sortedKeys.find(k => k.toLowerCase() === 'vna');
|
||||
const nbaMatch = sortedKeys.find(k => k.toLowerCase() === 'nba');
|
||||
const gnaMatch = sortedKeys.find(k => k.toLowerCase() === 'gna');
|
||||
|
||||
if (vnaMatch) selectFirstName.value = vnaMatch;
|
||||
else {
|
||||
const vMatch = sortedKeys.find(k => k.toLowerCase().startsWith('v'));
|
||||
if (vMatch) selectFirstName.value = vMatch;
|
||||
}
|
||||
|
||||
if (nbaMatch) selectLastName.value = nbaMatch;
|
||||
else if (gnaMatch) selectLastName.value = gnaMatch;
|
||||
else {
|
||||
const nMatch = sortedKeys.find(k => k.toLowerCase().startsWith('n'));
|
||||
if (nMatch) selectLastName.value = nMatch;
|
||||
}
|
||||
} else {
|
||||
selectFirstName.innerHTML = '<option value="">Keine Spalten gefunden</option>';
|
||||
selectLastName.innerHTML = '<option value="">Keine Spalten gefunden</option>';
|
||||
|
|
@ -1306,8 +1317,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
const last = p[state.ownerMapping.lastName] || '';
|
||||
const fullName = `${first} ${last}`.trim() || "Unbekannt";
|
||||
|
||||
if (!owners[fullName]) owners[fullName] = 0;
|
||||
owners[fullName]++;
|
||||
if (!owners[fullName]) {
|
||||
owners[fullName] = { count: 0, first, last };
|
||||
}
|
||||
owners[fullName].count++;
|
||||
});
|
||||
|
||||
renderOwnerRows(owners);
|
||||
|
|
@ -1325,12 +1338,12 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
function renderOwnerRows(owners) {
|
||||
ownerTableBody.innerHTML = '';
|
||||
Object.keys(owners).sort().forEach(name => {
|
||||
const count = owners[name];
|
||||
const data = owners[name];
|
||||
const status = state.ownerStatuses[name] || 'none';
|
||||
const row = document.createElement('tr');
|
||||
row.innerHTML = `
|
||||
<td><b>${name}</b></td>
|
||||
<td>${count} Flurstücke</td>
|
||||
<td>${data.count} Flurstücke</td>
|
||||
<td>
|
||||
<select class="status-select" data-owner="${name}">
|
||||
<option value="none" ${status === 'none' ? 'selected' : ''}>Kein Status</option>
|
||||
|
|
@ -1341,17 +1354,26 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
<option value="undecided" ${status === 'undecided' ? 'selected' : ''}>Unentschlossen</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn-secure" data-first="${data.first}" data-last="${data.last}" style="padding: 4px 8px; font-size: 0.75rem; background: var(--primary-color); color: white; border: none; border-radius: 4px; cursor: pointer;">Sichern</button>
|
||||
</td>
|
||||
`;
|
||||
ownerTableBody.appendChild(row);
|
||||
});
|
||||
|
||||
// Add event listeners to dropdowns
|
||||
document.querySelectorAll('.status-select').forEach(sel => {
|
||||
sel.onchange = (e) => {
|
||||
sel.onchange = async (e) => {
|
||||
const name = e.target.dataset.owner;
|
||||
const status = e.target.value;
|
||||
state.ownerStatuses[name] = status;
|
||||
|
||||
// Sync with DB
|
||||
const data = owners[name];
|
||||
if (data) {
|
||||
await secureOwner(data.first, data.last, e.target, status);
|
||||
}
|
||||
|
||||
// Refresh map style
|
||||
const ownerLayerName = Object.keys(overlays).find(k => k.toLowerCase().includes('eigentümer'));
|
||||
if (ownerLayerName) {
|
||||
|
|
@ -1359,6 +1381,68 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
}
|
||||
};
|
||||
});
|
||||
|
||||
// Add event listeners to secure buttons
|
||||
document.querySelectorAll('.btn-secure').forEach(btn => {
|
||||
btn.onclick = async (e) => {
|
||||
const first = e.target.dataset.first;
|
||||
const last = e.target.dataset.last;
|
||||
await secureOwner(first, last, e.target);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function secureOwner(vorname, nachname, element, status = 'Gesichert') {
|
||||
const isButton = element.tagName === 'BUTTON';
|
||||
const originalText = isButton ? element.innerText : "";
|
||||
if (isButton) {
|
||||
element.innerText = "Wait...";
|
||||
element.disabled = true;
|
||||
}
|
||||
|
||||
const projekt_id = "BWSamern-Ohne";
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/sicherung', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ vorname, nachname, projekt_id, status })
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
if (response.ok) {
|
||||
if (isButton) {
|
||||
element.style.background = '#2ecc71';
|
||||
element.innerText = "✓ Gesichert";
|
||||
}
|
||||
console.log(result.message);
|
||||
|
||||
const fullName = `${vorname} ${nachname}`.trim();
|
||||
state.ownerStatuses[fullName] = status;
|
||||
|
||||
const ownerLayerName = Object.keys(overlays).find(k => k.toLowerCase().includes('eigentümer'));
|
||||
if (ownerLayerName) {
|
||||
overlays[ownerLayerName].setStyle(overlays[ownerLayerName].options.style);
|
||||
}
|
||||
|
||||
const select = document.querySelector(`.status-select[data-owner="${fullName}"]`);
|
||||
if (select) select.value = status;
|
||||
|
||||
} else {
|
||||
throw new Error(result.error || "Fehler");
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
if (isButton) {
|
||||
element.style.background = '#e74c3c';
|
||||
element.innerText = "Error";
|
||||
setTimeout(() => {
|
||||
element.style.background = '';
|
||||
element.innerText = originalText;
|
||||
element.disabled = false;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function handleFileSelection(fileList) {
|
||||
|
|
@ -1411,9 +1495,34 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
}
|
||||
});
|
||||
|
||||
initDynamicLayers();
|
||||
async function loadOwnerStatusesFromDB() {
|
||||
const projekt_id = "BWSamern-Ohne";
|
||||
console.log("Lade Eigentümer-Status aus Datenbank...");
|
||||
try {
|
||||
const response = await fetch(`/api/sicherung/${projekt_id}`);
|
||||
if (response.ok) {
|
||||
const statuses = await response.json();
|
||||
statuses.forEach(s => {
|
||||
const fullName = `${s.vorname} ${s.nachname}`.trim();
|
||||
state.ownerStatuses[fullName] = s.status;
|
||||
});
|
||||
console.log(`${statuses.length} Eigentümer-Status geladen.`);
|
||||
|
||||
console.log("Messwerkzeuge bereit.");
|
||||
// Refresh map style if owner layer exists
|
||||
const ownerLayerName = Object.keys(overlays).find(k => k.toLowerCase().includes('eigentümer'));
|
||||
if (ownerLayerName && overlays[ownerLayerName]) {
|
||||
overlays[ownerLayerName].setStyle(overlays[ownerLayerName].options.style);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Fehler beim Laden der Status:", err);
|
||||
}
|
||||
}
|
||||
|
||||
initDynamicLayers().then(() => {
|
||||
loadOwnerStatusesFromDB();
|
||||
loadTurbinesFromDB();
|
||||
});
|
||||
|
||||
// Project Persistence
|
||||
const btnSave = document.getElementById('btnSaveProject');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
DB_HOST=87.106.21.21
|
||||
DB_PORT=5432
|
||||
DB_NAME=ihre_datenbank
|
||||
DB_USER=ihr_benutzer
|
||||
DB_PASSWORD=ihr_passwort
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
await client.query("ALTER TABLE geodaten.wea_standorte ADD COLUMN IF NOT EXISTS variante VARCHAR(10)");
|
||||
console.log('Column variante added successfully');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
await client.query("ALTER TABLE geodaten.wea_standorte ALTER COLUMN ksf_drehung TYPE DOUBLE PRECISION");
|
||||
console.log('Changed ksf_drehung to DOUBLE PRECISION');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'wind_projekt_bwscheddebrock' AND table_name = 'wea';
|
||||
`);
|
||||
console.log("Columns for wind_projekt_bwscheddebrock.wea:");
|
||||
res.rows.forEach(r => console.log(`${r.column_name}: ${r.data_type}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query("SELECT column_name FROM information_schema.columns WHERE table_schema = 'geodaten' AND table_name = 'wea_standorte'");
|
||||
console.log(res.rows);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query("SELECT * FROM geodaten.wea_standorte");
|
||||
console.log(`Found ${res.rowCount} rows.`);
|
||||
console.log(res.rows);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name, column_default
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'flaecheneigentuemer_status'
|
||||
AND column_name = 'id';
|
||||
`);
|
||||
console.log("Default for id:", res.rows[0].column_default);
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT * FROM geodaten.wea_standorte;
|
||||
`);
|
||||
console.log("Entries in geodaten.wea_standorte:");
|
||||
console.log(JSON.stringify(res.rows, null, 2));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'geodata'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_name ILIKE '%wea%';
|
||||
`);
|
||||
console.log("Tables with 'wea' in geodata database:");
|
||||
res.rows.forEach(r => console.log(`${r.table_schema}.${r.table_name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query("SELECT column_name, column_default FROM information_schema.columns WHERE table_schema = 'geodaten' AND table_name = 'wea_standorte' AND column_name = 'id'");
|
||||
console.log(res.rows);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_name LIKE '%projekt%'
|
||||
AND table_schema NOT IN ('information_schema', 'pg_catalog');
|
||||
`);
|
||||
console.log("Project related tables:");
|
||||
res.rows.forEach(r => console.log(`${r.table_schema}.${r.table_name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT * FROM geodaten.flaecheneigentuemer_alkis LIMIT 5;
|
||||
`);
|
||||
console.log(JSON.stringify(res.rows, null, 2));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT srid FROM geometry_columns
|
||||
WHERE f_table_schema = 'geodaten' AND f_table_name = 'wea_standorte';
|
||||
`);
|
||||
console.log("SRID of geodaten.wea_standorte.geom:");
|
||||
res.rows.forEach(r => console.log(r.srid));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function clean() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
console.log("Cleaning up test entries...");
|
||||
const res = await client.query("DELETE FROM geodaten.wea_standorte WHERE projekt_id LIKE '%Test%' OR wea_nummer = 'TEST-1'");
|
||||
console.log(`Cleaned ${res.rowCount} rows.`);
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
clean();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
database: 'enwelo',
|
||||
user: 'postgres',
|
||||
password: ''
|
||||
});
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'wea';
|
||||
`);
|
||||
console.log(res.rows);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
require('dotenv').config();
|
||||
const postgres = require('postgres');
|
||||
|
||||
const sql = postgres({
|
||||
host: process.env.DB_HOST || '87.106.21.21',
|
||||
port: process.env.DB_PORT || 5432,
|
||||
database: process.env.DB_NAME || 'enwelo',
|
||||
username: process.env.DB_USER || 'postgres',
|
||||
password: process.env.DB_PASSWORD || ''
|
||||
});
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const res = await sql`
|
||||
SELECT column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'wea';
|
||||
`;
|
||||
console.log(res);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
await sql.end();
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function inspect() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const tables = [
|
||||
'geodaten.flaecheneigentuemer_alkis',
|
||||
'geodaten.flaecheneigentuemer_alkis_zuweisung',
|
||||
'geodaten.flaecheneigentuemer_status'
|
||||
];
|
||||
|
||||
for (const table of tables) {
|
||||
const [schema, name] = table.split('.');
|
||||
console.log(`\n--- Structure of ${table} ---`);
|
||||
const res = await client.query(`
|
||||
SELECT column_name, data_type, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = $1 AND table_name = $2
|
||||
ORDER BY ordinal_position;
|
||||
`, [schema, name]);
|
||||
res.rows.forEach(r => console.log(`${r.column_name}: ${r.data_type} (${r.is_nullable})`));
|
||||
}
|
||||
|
||||
console.log(`\n--- Views in geodaten ---`);
|
||||
const viewsRes = await client.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.views
|
||||
WHERE table_schema = 'geodaten';
|
||||
`);
|
||||
viewsRes.rows.forEach(r => console.log(r.table_name));
|
||||
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
inspect();
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function inspect() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name, data_type, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'projekte'
|
||||
ORDER BY ordinal_position;
|
||||
`);
|
||||
res.rows.forEach(r => console.log(`${r.column_name}: ${r.data_type} (${r.is_nullable})`));
|
||||
|
||||
console.log("\nSample data:");
|
||||
const data = await client.query("SELECT id, name FROM geodaten.projekte LIMIT 5");
|
||||
data.rows.forEach(r => console.log(`${r.id}: ${r.name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
inspect();
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name, data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'v_projekt_sicherung'
|
||||
ORDER BY ordinal_position;
|
||||
`);
|
||||
console.log("Columns in v_projekt_sicherung:");
|
||||
res.rows.forEach(r => console.log(`${r.column_name}: ${r.data_type}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT schemaname, tablename
|
||||
FROM pg_tables
|
||||
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
|
||||
ORDER BY schemaname, tablename;
|
||||
`);
|
||||
console.log("ALL Tables in enwelo database:");
|
||||
res.rows.forEach(r => console.log(`${r.schemaname}.${r.tablename}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'geodaten' AND table_name = 'flaecheneigentuemer_alkis';
|
||||
`);
|
||||
console.log(res.rows.map(r => r.column_name).join(', '));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'geodata'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema NOT IN ('information_schema', 'pg_catalog');
|
||||
`);
|
||||
console.log("Tables in geodata database:");
|
||||
res.rows.forEach(r => console.log(`${r.table_schema}.${r.table_name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'public';
|
||||
`);
|
||||
console.log("Tables in public schema:");
|
||||
res.rows.forEach(r => console.log(r.table_name));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'wind_tool_standortprüfung';
|
||||
`);
|
||||
console.log("Tables in wind_tool_standortprüfung:");
|
||||
res.rows.forEach(r => console.log(r.table_name));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'wind_tool_trassenplaner';
|
||||
`);
|
||||
console.log("Tables in wind_tool_trassenplaner:");
|
||||
res.rows.forEach(r => console.log(r.table_name));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,999 @@
|
|||
{
|
||||
"name": "backend",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.2",
|
||||
"dotenv": "^17.4.2",
|
||||
"express": "^5.2.1",
|
||||
"pg": "^8.20.0",
|
||||
"postgres": "^3.4.9"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
||||
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "^3.0.0",
|
||||
"negotiator": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",
|
||||
"integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.1",
|
||||
"raw-body": "^3.0.1",
|
||||
"type-is": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
|
||||
"integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "17.4.2",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
|
||||
"integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
|
||||
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.1",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
|
||||
"integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"parseurl": "^1.3.3",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz",
|
||||
"integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
|
||||
"integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
|
||||
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
|
||||
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
|
||||
"integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
||||
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/pg": {
|
||||
"version": "8.20.0",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-8.20.0.tgz",
|
||||
"integrity": "sha512-ldhMxz2r8fl/6QkXnBD3CR9/xg694oT6DZQ2s6c/RI28OjtSOpxnPrUCGOBJ46RCUxcWdx3p6kw/xnDHjKvaRA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"pg-connection-string": "^2.12.0",
|
||||
"pg-pool": "^3.13.0",
|
||||
"pg-protocol": "^1.13.0",
|
||||
"pg-types": "2.2.0",
|
||||
"pgpass": "1.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"pg-cloudflare": "^1.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"pg-native": ">=3.0.1"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"pg-native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/pg-cloudflare": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.3.0.tgz",
|
||||
"integrity": "sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/pg-connection-string": {
|
||||
"version": "2.12.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.12.0.tgz",
|
||||
"integrity": "sha512-U7qg+bpswf3Cs5xLzRqbXbQl85ng0mfSV/J0nnA31MCLgvEaAo7CIhmeyrmJpOr7o+zm0rXK+hNnT5l9RHkCkQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/pg-int8": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
|
||||
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-pool": {
|
||||
"version": "3.13.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.13.0.tgz",
|
||||
"integrity": "sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"pg": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pg-protocol": {
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.13.0.tgz",
|
||||
"integrity": "sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/pg-types": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
|
||||
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pg-int8": "1.0.1",
|
||||
"postgres-array": "~2.0.0",
|
||||
"postgres-bytea": "~1.0.0",
|
||||
"postgres-date": "~1.0.4",
|
||||
"postgres-interval": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pgpass": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
|
||||
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split2": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres": {
|
||||
"version": "3.4.9",
|
||||
"resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.9.tgz",
|
||||
"integrity": "sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw==",
|
||||
"license": "Unlicense",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/porsager"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-array": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
|
||||
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-bytea": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",
|
||||
"integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-date": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
|
||||
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postgres-interval": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
|
||||
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.15.1",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz",
|
||||
"integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
|
||||
"integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "~3.1.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.7.0",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"is-promise": "^4.0.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"path-to-regexp": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
|
||||
"integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.3",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.1",
|
||||
"mime-types": "^3.0.2",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
|
||||
"integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
|
||||
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
|
||||
"integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
"media-typer": "^1.1.0",
|
||||
"mime-types": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.2",
|
||||
"dotenv": "^17.4.2",
|
||||
"express": "^5.2.1",
|
||||
"pg": "^8.20.0",
|
||||
"postgres": "^3.4.9"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
psycopg2-binary
|
||||
python-dotenv
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT schemaname, matviewname
|
||||
FROM pg_matviews
|
||||
WHERE matviewname ILIKE '%wea%';
|
||||
`);
|
||||
console.log("Materialized Views with 'wea' in their name:");
|
||||
res.rows.forEach(r => console.log(`${r.schemaname}.${r.matviewname}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT schemaname, tablename
|
||||
FROM pg_tables
|
||||
WHERE tablename ILIKE '%wea%';
|
||||
`);
|
||||
console.log("Tables with 'wea' in their name (pg_tables):");
|
||||
res.rows.forEach(r => console.log(`${r.schemaname}.${r.tablename}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_name ILIKE '%wea%'
|
||||
ORDER BY table_schema, table_name;
|
||||
`);
|
||||
console.log("Tables with 'wea' in their name:");
|
||||
res.rows.forEach(r => console.log(`${r.table_schema}.${r.table_name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query(`
|
||||
SELECT table_schema, table_name
|
||||
FROM information_schema.views
|
||||
WHERE table_name ILIKE '%wea%';
|
||||
`);
|
||||
console.log("Views with 'wea' in their name:");
|
||||
res.rows.forEach(r => console.log(`${r.table_schema}.${r.table_name}`));
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function test_insert() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
console.log("Connected to DB.");
|
||||
|
||||
const projekt_id = "BWSamern-Ohne-Test";
|
||||
const lat = 52.3;
|
||||
const lng = 7.1;
|
||||
|
||||
await client.query('BEGIN');
|
||||
await client.query('DELETE FROM geodaten.wea_standorte WHERE projekt_id = $1', [projekt_id]);
|
||||
|
||||
console.log("Inserting test row...");
|
||||
await client.query(
|
||||
`INSERT INTO geodaten.wea_standorte (
|
||||
wea_nummer, anlagentyp, nabenhoehe, rotordurchmesser, projekt_id, geom
|
||||
) VALUES ($1, $2, $3, $4, $5, ST_Transform(ST_SetSRID(ST_MakePoint($6, $7), 4326), 25832))`,
|
||||
['TEST-1', 'Vestas V162', 169, 162, projekt_id, lng, lat]
|
||||
);
|
||||
|
||||
await client.query('COMMIT');
|
||||
console.log("Insert successful!");
|
||||
|
||||
const res = await client.query('SELECT *, ST_AsText(ST_Transform(geom, 4326)) as geom_wgs84 FROM geodaten.wea_standorte WHERE projekt_id = $1', [projekt_id]);
|
||||
console.log("Verified entry:", JSON.stringify(res.rows, null, 2));
|
||||
|
||||
} catch (e) {
|
||||
console.error("Test failed:", e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
test_insert();
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
const res = await client.query("INSERT INTO geodaten.wea_standorte (projekt_id, wea_nummer, anlagentyp, nabenhoehe, rotordurchmesser, geom) VALUES ($1, $2, $3, $4, $5, ST_Transform(ST_SetSRID(ST_MakePoint($6, $7), 4326), 25832)) RETURNING id",
|
||||
['BWSamern-Ohne', 'TEST-2', 'Vestas', 160, 160, 7.3, 52.3]);
|
||||
console.log('Inserted ID:', res.rows[0].id);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { Client } = require('pg');
|
||||
|
||||
async function check() {
|
||||
const client = new Client({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09',
|
||||
database: 'enwelo'
|
||||
});
|
||||
|
||||
try {
|
||||
await client.connect();
|
||||
await client.query("UPDATE geodaten.wea_standorte SET ksf_drehung = 45 WHERE wea_nummer = 'TEST-2'");
|
||||
console.log('Updated TEST-2 rotation to 45');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
check();
|
||||
|
|
@ -235,6 +235,7 @@
|
|||
<th>Name</th>
|
||||
<th>Flächen</th>
|
||||
<th>Status</th>
|
||||
<th>Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
|
|
|
|||
107
server.js
107
server.js
|
|
@ -113,6 +113,113 @@ app.get('/api/wea/:projekt_id', async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
// Hilfsfunktion zur Auflösung von Projekt-ID oder Name
|
||||
async function resolveProjectId(client, input) {
|
||||
// Prüfen, ob input eine valide UUID ist
|
||||
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
||||
if (uuidRegex.test(input)) return input;
|
||||
|
||||
// Sonst in der Projekte-Tabelle nach Name suchen
|
||||
const res = await client.query('SELECT id FROM geodaten.projekte WHERE name = $1 OR name = $2', [input, input.toLowerCase()]);
|
||||
return res.rows.length > 0 ? res.rows[0].id : null;
|
||||
}
|
||||
|
||||
// API zur Flächensicherung von Eigentümern
|
||||
app.post('/api/sicherung', async (req, res) => {
|
||||
const { nachname, vorname, projekt_id, status } = req.body;
|
||||
const targetStatus = status || 'Gesichert';
|
||||
const schema = process.env.DB_SCHEMA || 'geodaten';
|
||||
|
||||
log(`Sicherungs-Request: ${vorname} ${nachname} Status='${targetStatus}' für Projekt ${projekt_id}`);
|
||||
|
||||
const client = await pool.connect();
|
||||
try {
|
||||
await client.query('BEGIN');
|
||||
|
||||
// 1. Projekt-ID auflösen
|
||||
const resolvedPid = await resolveProjectId(client, projekt_id);
|
||||
if (!resolvedPid) {
|
||||
throw new Error(`Projekt '${projekt_id}' konnte nicht gefunden werden.`);
|
||||
}
|
||||
|
||||
// 2. FSKs für den Namen finden
|
||||
const ownerRes = await client.query(
|
||||
`SELECT "FSK" FROM ${schema}.flaecheneigentuemer_alkis WHERE "GNA" = $1 AND "VNA" = $2`,
|
||||
[nachname, vorname]
|
||||
);
|
||||
|
||||
const fsks = ownerRes.rows.map(r => r.FSK);
|
||||
if (fsks.length === 0) {
|
||||
log(`Keine Flurstücke für ${vorname} ${nachname} gefunden.`);
|
||||
await client.query('ROLLBACK');
|
||||
return res.status(404).json({ error: 'Keine Flurstücke für diesen Namen gefunden.' });
|
||||
}
|
||||
|
||||
log(`Gefunden: ${fsks.length} Flurstücke für ${vorname} ${nachname}. Prüfe Zuweisung...`);
|
||||
|
||||
// 3. Zuweisung prüfen und Status schreiben
|
||||
let securedCount = 0;
|
||||
for (const fsk of fsks) {
|
||||
const assignmentRes = await client.query(
|
||||
`SELECT 1 FROM ${schema}.flaecheneigentuemer_alkis_zuweisung WHERE fsk = $1 AND projekt_id = $2`,
|
||||
[fsk, resolvedPid]
|
||||
);
|
||||
|
||||
if (assignmentRes.rowCount > 0) {
|
||||
await client.query(
|
||||
`INSERT INTO ${schema}.flaecheneigentuemer_status (id, fsk, projekt_id, status, datum)
|
||||
VALUES (gen_random_uuid(), $1, $2, $3, NOW())`,
|
||||
[fsk, resolvedPid, targetStatus]
|
||||
);
|
||||
securedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
await client.query('COMMIT');
|
||||
log(`Erfolgreich: ${securedCount} von ${fsks.length} Flurstücken als '${targetStatus}' markiert.`);
|
||||
res.json({
|
||||
message: `${securedCount} Flurstücke für ${vorname} ${nachname} erfolgreich als '${targetStatus}' markiert.`,
|
||||
count: securedCount,
|
||||
total_found: fsks.length
|
||||
});
|
||||
} catch (err) {
|
||||
await client.query('ROLLBACK');
|
||||
log(`FEHLER bei Sicherung: ${err.message}`);
|
||||
res.status(500).json({ error: 'Fehler bei der Flächensicherung', details: err.message });
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
});
|
||||
|
||||
// API zum Laden der Sicherungsstände
|
||||
app.get('/api/sicherung/:projekt_id', async (req, res) => {
|
||||
const { projekt_id } = req.params;
|
||||
log(`Lade Sicherungsstände für Projekt: ${projekt_id}`);
|
||||
|
||||
const client = await pool.connect();
|
||||
try {
|
||||
const resolvedPid = await resolveProjectId(client, projekt_id);
|
||||
if (!resolvedPid) {
|
||||
throw new Error(`Projekt '${projekt_id}' konnte nicht gefunden werden.`);
|
||||
}
|
||||
|
||||
const result = await client.query(
|
||||
`SELECT vorname, nachname, aktueller_status as status
|
||||
FROM geodaten.v_projekt_sicherung
|
||||
WHERE projekt_id = $1`,
|
||||
[resolvedPid]
|
||||
);
|
||||
|
||||
log(`Geladen: ${result.rowCount} Status-Einträge.`);
|
||||
res.json(result.rows);
|
||||
} catch (e) {
|
||||
log(`FEHLER beim Laden der Stände: ${e.message}`);
|
||||
res.status(500).json({ error: e.message });
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
});
|
||||
|
||||
// Catch-all route to serve index.html for any other request (optional, good for SPAs)
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'index.html'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue