This commit is contained in:
Boris D
2025-09-22 18:35:02 +03:00
parent 51f8b0d773
commit fbbbd61838
23 changed files with 282 additions and 67 deletions

View File

@ -1,14 +1,12 @@
import axios from "axios";
import { config } from "tests/config";
export default async (query: { id: string }, module: { id: string }) => {
try {
const response = await axios.post(
"http://localhost:3000/query/module/add",
{
queryId: query.id,
moduleId: module.id,
}
);
const response = await axios.post(`${config.url}/query/module/add`, {
queryId: query.id,
moduleId: module.id,
});
return response;
} catch (error) {

View File

@ -1,14 +1,12 @@
import axios from "axios";
import { config } from "tests/config";
export default async (query: { id: string }, plugin: { id: string }) => {
try {
const response = await axios.post(
"http://localhost:3000/query/plugin/add",
{
queryId: query.id,
pluginId: plugin.id,
}
);
const response = await axios.post(`${config.url}/query/plugin/add`, {
queryId: query.id,
pluginId: plugin.id,
});
return response;
} catch (error) {

View File

@ -1,14 +1,12 @@
import axios from "axios";
import { config } from "tests/config";
export default async (name: string, sourcePath: string) => {
try {
const response = await axios.post(
"http://localhost:3000/query/module/create",
{
name,
sourcePath,
}
);
const response = await axios.post(`${config.url}/query/module/create`, {
name,
sourcePath,
});
return response;
} catch (error) {

View File

@ -1,15 +1,13 @@
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(
"http://localhost:3000/query/plugin/create",
{
name,
class: className,
config,
}
);
const response = await axios.post(`${appConfig.url}/query/plugin/create`, {
name,
class: className,
config,
});
return response;
} catch (error) {

View File

@ -1,8 +1,9 @@
import axios from "axios";
import { config } from "../config";
const createProject = async (name: string) => {
try {
const response = await axios.put("http://localhost:3000/project/create", {
const response = await axios.put(`${config.url}/project/create`, {
name: name,
});

View File

@ -1,8 +1,9 @@
import axios from "axios";
import { config } from "../config";
export default async (project: { token: string }, source: string) => {
try {
const response = await axios.post("http://localhost:3000/query/create", {
const response = await axios.post(`${config.url}/query/create`, {
source,
projectToken: project.token,
});

View File

@ -1,9 +1,10 @@
import axios from "axios";
import { config } from "../config";
export default async (token: string, queryData: Record<string, any>) => {
try {
const response = await axios.post(
`http://localhost:3000/query/run/${token}`,
`${config.url}/query/run/${token}`,
queryData
);

View File

@ -1,8 +1,9 @@
import axios from "axios";
import { config } from "../config";
export default async (query: { id: string; source: string }) => {
try {
const response = await axios.post("http://localhost:3000/query/update", {
const response = await axios.post(`${config.url}/query/update`, {
queryId: query.id,
source: query.source,
});