Refactor VM and Plugin Management
- Removed the `plugins.constants.ts` file as it was no longer needed. - Updated the `vm.class.ts` to improve result handling and logging. - Introduced `vm.constants.ts` to manage registered plugins and modules. - Simplified the test payload in `case1-payload.js` by removing unnecessary insert logic. - Enhanced `case1.ts` to include database and migration setup, improving test clarity. - Deleted unused functions for adding modules and plugins, streamlining the codebase.
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (query: { id: string }, module: { id: string }) => {
|
||||
try {
|
||||
const response = await axios.post(`${config.url}/query/module/add`, {
|
||||
queryId: query.id,
|
||||
moduleId: module.id,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error in adding module to query:", error);
|
||||
}
|
||||
};
|
||||
@ -1,15 +0,0 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (query: { id: string }, plugin: { id: string }) => {
|
||||
try {
|
||||
const response = await axios.post(`${config.url}/query/plugin/add`, {
|
||||
queryId: query.id,
|
||||
pluginId: plugin.id,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error in adding plugin to query:", error);
|
||||
}
|
||||
};
|
||||
@ -1,15 +0,0 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (name: string, sourcePath: string) => {
|
||||
try {
|
||||
const response = await axios.post(`${config.url}/query/module/create`, {
|
||||
name,
|
||||
sourcePath,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error in creating project or query:", error);
|
||||
}
|
||||
};
|
||||
@ -1,16 +0,0 @@
|
||||
import axios from "axios";
|
||||
import { config as appConfig } from "../config";
|
||||
|
||||
export default async (name: string, className: string, config: string) => {
|
||||
try {
|
||||
const response = await axios.post(`${appConfig.url}/query/plugin/create`, {
|
||||
name,
|
||||
class: className,
|
||||
config,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("Error in creating project or query:", error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user