Files
metabuilder/frontends/nextjs/src/lib/db/functions/lua-scripts/get-lua-scripts.ts
JohnDoe6345789 616d4ad87b feat: Implement CRUD operations for pages, schemas, tenants, users, workflows, and SMTP configurations
- Added functions to set, update, delete, and retrieve page configurations.
- Introduced model schema management with functions for adding, updating, deleting, and retrieving schemas.
- Implemented tenant management with functions for adding, updating, deleting, and retrieving tenants.
- Created user management functions for adding, updating, deleting, and retrieving users.
- Developed workflow management functions for adding, updating, deleting, and retrieving workflows.
- Added SMTP configuration management with functions to get and set SMTP configurations.
- Implemented functions for managing god credentials, including expiry management and first login flags.
- Introduced power transfer request management with functions for adding, updating, deleting, and retrieving requests.
- Added Lua snippet management functions for retrieving snippets by ID and category, and searching snippets.
2025-12-25 17:54:34 +00:00

19 lines
497 B
TypeScript

import { prisma } from '../../prisma'
import type { LuaScript } from '../../../types/level-types'
/**
* Get all Lua scripts
* @returns Array of Lua scripts
*/
export const getLuaScripts = async (): Promise<LuaScript[]> => {
const scripts = await prisma.luaScript.findMany()
return scripts.map(s => ({
id: s.id,
name: s.name,
description: s.description || undefined,
code: s.code,
parameters: JSON.parse(s.parameters),
returnType: s.returnType || undefined,
}))
}