/**
 * Registry-related data shapes for Onebox
 */

export interface IRegistry {
  id?: number;
  url: string;
  username: string;
  createdAt: number;
}

export interface IRegistryToken {
  id: number;
  name: string;
  type: 'global' | 'ci';
  scope: 'all' | string[];
  scopeDisplay: string;
  expiresAt: number | null;
  createdAt: number;
  lastUsedAt: number | null;
  createdBy: string;
  isExpired: boolean;
}

export interface ICreateTokenRequest {
  name: string;
  type: 'global' | 'ci';
  scope: 'all' | string[];
  expiresIn: '30d' | '90d' | '365d' | 'never';
}

export interface ITokenCreatedResponse {
  token: IRegistryToken;
  plainToken: string;
}
