chore: lock the plugin boundary and remove 2.9.0 leftovers

This commit is contained in:
LukeGus committed 2026-09-25 07:24:46 -05:00
1 parent 6489b62ece
commit 2961297989
399 files changed
+3964 -5627

No files matched your search

-60
View File
@@ -190,63 +190,3 @@ export async function adminDeleteUserCredential(
throw handleApiError(error, "delete user's credential");
}
}
export async function adminGetUserSnippets(
targetUserId: string,
): Promise<Record<string, unknown>> {
try {
const response = await authApi.get("/plugin-api/snippets", {
headers: adminHeaders(targetUserId),
});
return response.data;
} catch (error) {
throw handleApiError(error, "fetch user's snippets");
}
}
export async function adminCreateUserSnippet(
targetUserId: string,
snippetData: Record<string, unknown>,
): Promise<Record<string, unknown>> {
try {
const response = await authApi.post("/plugin-api/snippets", snippetData, {
headers: adminHeaders(targetUserId),
});
return response.data;
} catch (error) {
throw handleApiError(error, "create snippet for user");
}
}
export async function adminUpdateUserSnippet(
targetUserId: string,
snippetId: number,
snippetData: Record<string, unknown>,
): Promise<Record<string, unknown>> {
try {
const response = await authApi.put(
`/plugin-api/snippets/${snippetId}`,
snippetData,
{
headers: adminHeaders(targetUserId),
},
);
return response.data;
} catch (error) {
throw handleApiError(error, "update user's snippet");
}
}
export async function adminDeleteUserSnippet(
targetUserId: string,
snippetId: number,
): Promise<Record<string, unknown>> {
try {
const response = await authApi.delete(`/plugin-api/snippets/${snippetId}`, {
headers: adminHeaders(targetUserId),
});
return response.data;
} catch (error) {
throw handleApiError(error, "delete user's snippet");
}
}
+2
View File
@@ -153,6 +153,8 @@ export interface SshAuthProviderSummary {
credentialType: boolean;
needsUserInteraction: boolean;
supportsBackground: boolean;
/** Offered in Quick Connect, for a host that is never saved. */
quickConnect?: boolean;
available: boolean;
missingPlugin?: { id: string; name: string };
}
-42
View File
@@ -1,42 +0,0 @@
import { authApi, handleApiError } from "@/main-axios";
/**
* A snippet row as the list endpoint returns it. Callers that need the full
* shape narrow it themselves; only the id is relied on across the app.
*
* Snippets themselves are owned by the snippets plugin
* (/plugin-api/snippets); this is the thin read/run surface used by a few
* core and plugin callers (the host editor's startup snippet, the command
* palette, custom keybindings, host-metrics quick actions) that cannot
* reach into the snippets plugin's own frontend code.
*/
export interface SnippetRow {
id: number;
[key: string]: unknown;
}
export async function getSnippets(): Promise<SnippetRow[]> {
try {
const response = await authApi.get("/plugin-api/snippets");
return response.data;
} catch (error) {
throw handleApiError(error, "fetch snippets");
}
}
export async function executeSnippet(
snippetId: number,
hostId: number,
inputValues?: Record<string, string>,
): Promise<{ success: boolean; output: string; error?: string }> {
try {
const response = await authApi.post("/plugin-api/snippets/execute", {
snippetId,
hostId,
...(inputValues ? { inputValues } : {}),
});
return response.data;
} catch (error) {
throw handleApiError(error, "execute snippet");
}
}
+1 -91
View File
@@ -1,13 +1,7 @@
import { AxiosError } from "axios";
import {
authApi,
getAllServerStatuses,
handleApiError,
sshHostApi,
} from "@/main-axios";
import { getAllServerStatuses, handleApiError, sshHostApi } from "@/main-axios";
import type { SSHHost, SSHHostData, ProxyNode } from "@/types/index";
import type { ServerStatus, SSHHostWithStatus } from "@/main-axios";
import type { ProxmoxDiscoverResult, ProxmoxSyncResult } from "@/types/proxmox";
import {
getCachedSSHHosts,
invalidateHostsAndStatusCaches,
@@ -174,90 +168,6 @@ export async function importSSHConfigHosts(
}
}
export async function discoverProxmoxGuests(
hostId: number,
): Promise<ProxmoxDiscoverResult> {
try {
const response = await authApi.post(
"/plugin-api/proxmox/discover",
{ hostId },
{ timeout: 120000 },
);
return response.data;
} catch (error) {
handleApiError(error, "discover Proxmox guests");
}
}
export function discoverProxmoxGuestsStream(
hostId: number,
handlers: {
onProgress?: (done: number, total: number) => void;
onResult: (result: ProxmoxDiscoverResult) => void;
onError: (message: string) => void;
},
): () => void {
const baseURL = (authApi.defaults.baseURL || "").replace(/\/$/, "");
const source = new EventSource(
`${baseURL}/plugin-api/proxmox/discover/stream?hostId=${encodeURIComponent(
String(hostId),
)}`,
{ withCredentials: true },
);
let settled = false;
const close = () => {
settled = true;
source.close();
};
source.addEventListener("progress", (event) => {
try {
const data = JSON.parse((event as MessageEvent).data);
handlers.onProgress?.(data.done, data.total);
} catch {
// ignore malformed progress frames
}
});
source.addEventListener("result", (event) => {
close();
try {
handlers.onResult(JSON.parse((event as MessageEvent).data));
} catch {
handlers.onError("Failed to parse discovery result");
}
});
source.addEventListener("fail", (event) => {
close();
let message = "Discovery failed";
try {
message = JSON.parse((event as MessageEvent).data).message || message;
} catch {
// keep default message
}
handlers.onError(message);
});
source.onerror = () => {
if (settled) return;
close();
handlers.onError("Discovery connection lost");
};
return close;
}
export async function syncProxmoxGuests(
hostId: number,
): Promise<ProxmoxSyncResult> {
try {
const response = await authApi.post(
"/plugin-api/proxmox/sync",
{ hostId },
{ timeout: 120000 },
);
return response.data;
} catch (error) {
handleApiError(error, "sync Proxmox guests");
}
}
export async function bulkUpdateSSHHosts(
hostIds: number[],
updates: Record<string, unknown>,