import { requestClient } from '#/api/request';

export namespace ApkApi {
  export type Environment = 'dev' | 'prod' | 'stable';
  export type PackageType = 'with_sdk' | 'without_sdk';

  export interface PackageItem {
    downloadPath: string;
    env: Environment;
    packageType: PackageType;
    exists: boolean;
    fileName: string;
    size: number;
    uploadedAt: string;
    version: string;
  }

  export interface EnvironmentPackages {
    env: Environment;
    variants: Partial<Record<PackageType, PackageItem>>;
  }
}

export async function getApkPackagesApi() {
  return requestClient.get<ApkApi.EnvironmentPackages[]>('/apk/packages');
}