feat: polish protocol-aware operator UI
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { getJson, getText, postJson, postText } from "../../shared/api/client";
|
||||
import {
|
||||
getJson,
|
||||
getText,
|
||||
postBytes,
|
||||
postJson,
|
||||
postText,
|
||||
} from "../../shared/api/client";
|
||||
import type {
|
||||
AuthProfile,
|
||||
DraftGenerationResult,
|
||||
GrpcServiceSummary,
|
||||
OperationRecord,
|
||||
OperationSummary,
|
||||
TestRunResult,
|
||||
@@ -82,3 +89,40 @@ export function importOperationYaml(yamlText: string, mode: "create" | "upsert")
|
||||
export function listAuthProfiles() {
|
||||
return getJson<{ items: AuthProfile[] }>("/api/admin/auth-profiles");
|
||||
}
|
||||
|
||||
export function uploadProtoDescriptor(
|
||||
operationId: string,
|
||||
fileName: string,
|
||||
bytes: ArrayBuffer,
|
||||
) {
|
||||
return postBytes<{ descriptor_id: string; version: number }>(
|
||||
`/api/admin/operations/${operationId}/descriptors/proto`,
|
||||
bytes,
|
||||
{
|
||||
"Content-Type": "application/octet-stream",
|
||||
"x-file-name": fileName,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function uploadDescriptorSet(
|
||||
operationId: string,
|
||||
fileName: string,
|
||||
bytes: ArrayBuffer,
|
||||
) {
|
||||
return postBytes<{ descriptor_id: string; version: number }>(
|
||||
`/api/admin/operations/${operationId}/descriptors/descriptor-set`,
|
||||
bytes,
|
||||
{
|
||||
"Content-Type": "application/octet-stream",
|
||||
"x-file-name": fileName,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function listGrpcServices(operationId: string, version?: number) {
|
||||
const query = version === undefined ? "" : `?version=${version}`;
|
||||
return getJson<{ services: GrpcServiceSummary[] }>(
|
||||
`/api/admin/operations/${operationId}/grpc/services${query}`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user