initial commit after split
This commit is contained in:
27
webui/src/api/platform.ts
Normal file
27
webui/src/api/platform.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { ApiSettings } from "../types";
|
||||
import type { PlatformModuleInfo } from "../types";
|
||||
import { apiFetch } from "./client";
|
||||
|
||||
export type PlatformModulesResponse = { modules: PlatformModuleInfo[] };
|
||||
|
||||
export type PlatformPermission = {
|
||||
scope: string;
|
||||
module_id: string;
|
||||
resource: string;
|
||||
action: string;
|
||||
label: string;
|
||||
description: string;
|
||||
category: string;
|
||||
level: "system" | "tenant";
|
||||
deprecated: boolean;
|
||||
};
|
||||
|
||||
export type PlatformPermissionsResponse = { permissions: PlatformPermission[] };
|
||||
|
||||
export async function fetchPlatformModules(settings: ApiSettings): Promise<PlatformModulesResponse> {
|
||||
return apiFetch<PlatformModulesResponse>(settings, "/api/v1/platform/modules");
|
||||
}
|
||||
|
||||
export async function fetchPlatformPermissions(settings: ApiSettings): Promise<PlatformPermissionsResponse> {
|
||||
return apiFetch<PlatformPermissionsResponse>(settings, "/api/v1/platform/permissions");
|
||||
}
|
||||
Reference in New Issue
Block a user