Type plugin endpoints

This commit is contained in:
Andrew Kingston 2024-12-03 09:46:34 +00:00
parent d59a3a0497
commit c6f5287014
No known key found for this signature in database
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,18 @@
export const buildPluginEndpoints = API => ({
import {
CreatePluginRequest,
CreatePluginResponse,
Plugin,
} from "@budibase/types"
import { BaseAPIClient } from "./types"
export interface PluginEndpoins {
uploadPlugin: (data: any) => Promise<{ message: string; plugins: any[] }>
createPlugin: (data: CreatePluginRequest) => Promise<CreatePluginResponse>
getPlugins: () => Promise<Plugin[]>
deletePlugin: (pluginId: string) => Promise<{ message: string }>
}
export const buildPluginEndpoints = (API: BaseAPIClient): PluginEndpoins => ({
/**
* Uploads a plugin tarball bundle
* @param data the plugin tarball bundle to upload