- Added ManyToMany relationship for plugins in Query entity. - Updated QueryExecuterController to accept structured query data. - Enhanced QueryExecuterService to support plugin initialization and execution. - Implemented QueryHandlerService methods for creating and updating queries, modules, and plugins. - Introduced new endpoints for creating and adding modules and plugins to queries. - Created Plugin base class and DatabasePlugin implementation for database interactions. - Updated VM class to integrate plugin functionality during script execution. - Added test cases for project, query, module, and plugin operations.
23 lines
587 B
TypeScript
23 lines
587 B
TypeScript
import createProject from "../functions/createProject";
|
|
import createQuery from "../functions/createQuery";
|
|
import runQuery from "../functions/runQuery";
|
|
|
|
(async () => {
|
|
try {
|
|
const project = await createProject("Test Project");
|
|
|
|
const query = await createQuery(
|
|
project,
|
|
"async function main(input) { return `Hello, ${input.name}!`; }"
|
|
);
|
|
|
|
console.log(query);
|
|
|
|
const result = await runQuery(query.id, { name: "World" });
|
|
|
|
console.log("Query Result:", result);
|
|
} catch (error) {
|
|
console.error("Error during test execution:", error);
|
|
}
|
|
})();
|