import { api } from "./api";
import type { Record, Nullable } from "./apiTypes.ts";

// Typescript: TSEndpoint= path=/api/roles; name=getRoles; method=GET; response=auth.AllRoles

// /Users/fabio/CODE/omnimed/go-quasar-partial-ssr/backend/internal/auth/routes.go Line: 7
export const getRoles = async (): Promise<{
  data: AllRoles;
  error: Nullable<string>;
}> => {
  return (await api.GET("/api/roles")) as {
    data: AllRoles;
    error: Nullable<string>;
  };
};
export type Permission = string;

export type AllRoles = Record<string, string>;

export type EnumPermission =
  (typeof EnumEnumPermission)[keyof typeof EnumEnumPermission];

export const EnumEnumPermission = {
  RoleSuperAdmin: "superadmin",
  RoleAdmin: "admin",
  RoleManager: "manager",
  RoleContentCreator: "content_creator",
  RoleUser: "user",
  RoleGuest: "guest",
} as const;
