import { apiRequest } from "@/services/apiClient";

export interface AppRecord {
  id: number;
  name: string;
  slug: string;
  type: string;
  status: string;
  platform?: string;
  version?: string;
}

export const appService = {
  list(token: string) {
    return apiRequest<AppRecord[]>("/apps", { token });
  },

  create(
    token: string,
    data: { name: string; slug: string; type: string; platform?: string },
  ) {
    return apiRequest<AppRecord>("/apps", { method: "POST", body: data, token });
  },
};
