* Query pane refactor and fixes * Check if body exists * Get pluginId from the datasource * Move plugin image logic to selector * Show info in new line on the datasource form page * Update link text to Docs * Handle string as run api response body * Remove harcoded height * Remove all references to ImageAlt except in selector * Updata info text
38 lines
909 B
TypeScript
38 lines
909 B
TypeScript
import Api from "./Api";
|
|
import { AxiosPromise } from "axios";
|
|
import { GenericApiResponse } from "api/ApiResponses";
|
|
|
|
export interface Plugin {
|
|
id: string;
|
|
name: string;
|
|
type: "API" | "DB";
|
|
packageName: string;
|
|
iconLocation?: string;
|
|
uiComponent: "ApiEditorForm" | "RapidApiEditorForm" | "DbEditorForm";
|
|
allowUserDatasources?: boolean;
|
|
templates: Record<string, string>;
|
|
responseType?: "TABLE" | "JSON";
|
|
documentationLink?: string;
|
|
}
|
|
|
|
export interface DatasourceForm {
|
|
form: [];
|
|
}
|
|
|
|
class PluginsApi extends Api {
|
|
static url = "v1/plugins";
|
|
static fetchPlugins(
|
|
orgId: string,
|
|
): AxiosPromise<GenericApiResponse<Plugin[]>> {
|
|
return Api.get(PluginsApi.url, { organizationId: orgId });
|
|
}
|
|
|
|
static fetchFormConfig(
|
|
id: string,
|
|
): AxiosPromise<GenericApiResponse<DatasourceForm>> {
|
|
return Api.get(PluginsApi.url + `/${id}/form`);
|
|
}
|
|
}
|
|
|
|
export default PluginsApi;
|