Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68e7108831 | ||
|
|
3edb2da174 | ||
|
|
2173b5ab8f | ||
|
|
e13bdd00d1 |
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025-2026 Jared Vititoe
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1194,7 +1194,11 @@ app.get('/api/workflows/:id', authenticateSSO, async (req, res) => {
|
|||||||
if (rows.length === 0) return res.status(404).json({ error: 'Not found' });
|
if (rows.length === 0) return res.status(404).json({ error: 'Not found' });
|
||||||
const wf = rows[0];
|
const wf = rows[0];
|
||||||
let definition = {};
|
let definition = {};
|
||||||
try { definition = JSON.parse(wf.definition || '{}'); } catch { /* corrupt definition — return empty */ }
|
try {
|
||||||
|
definition = typeof wf.definition === 'string'
|
||||||
|
? JSON.parse(wf.definition || '{}')
|
||||||
|
: (wf.definition || {});
|
||||||
|
} catch { /* corrupt definition — return empty */ }
|
||||||
res.json({ ...wf, definition });
|
res.json({ ...wf, definition });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[API] GET /api/workflows/:id error:', error);
|
console.error('[API] GET /api/workflows/:id error:', error);
|
||||||
@@ -1659,7 +1663,11 @@ app.get('/api/internal/executions/:id', authenticateGandalf, async (req, res) =>
|
|||||||
}
|
}
|
||||||
const execution = rows[0];
|
const execution = rows[0];
|
||||||
let logs = [];
|
let logs = [];
|
||||||
try { logs = JSON.parse(execution.logs || '[]'); } catch { logs = []; }
|
try {
|
||||||
|
logs = typeof execution.logs === 'string'
|
||||||
|
? JSON.parse(execution.logs || '[]')
|
||||||
|
: (execution.logs || []);
|
||||||
|
} catch { logs = []; }
|
||||||
res.json({ ...execution, logs });
|
res.json({ ...execution, logs });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[API] GET /api/internal/executions/:id error:', error);
|
console.error('[API] GET /api/internal/executions/:id error:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user