feat: implement command functionality with new CommandController, update Query entity, and enhance query execution with headers support

This commit is contained in:
lborv
2025-10-02 10:02:44 +03:00
parent e53e3cf92c
commit efbb9f5c21
11 changed files with 122 additions and 11 deletions

View File

@ -34,7 +34,11 @@ export class QueryExecuterService {
.trim();
}
async runQuery(token: string, queryData: any) {
async runQuery(
token: string,
queryData: any,
headers: Record<string, any> = {}
) {
const query = await this.queryRepository.findOne({
where: { id: token },
relations: ["project"],
@ -47,7 +51,8 @@ export class QueryExecuterService {
const vm = await this.createVm(query);
const result = await vm.runScript(
this.clearImports(query.source),
queryData
queryData,
headers
);
return { message: "Query executed", result, query: queryData };