import { UnresolvedDependencyKind } from '../kinds.js'

export interface PublishedDataDomain {
  /**
   * Globally unique key for the data domain.
   */
  key: string
  /**
   * The key of the owning organization.
   */
  oid: string
  /**
   * The access level for the published data domain.
   * The private access means that the item was unpublished.
   */
  scope: 'public' | 'organization' | 'private'
  /**
   * The lifecycle stage of the data domain.
   */
  lifecycle: 'stable' | 'beta' | 'dev'
  /**
   * The version of the published data domain.
   */
  version: string
  /**
   * Key of the referenced `DomainNamespace` document.
   * Essentially this is a document id.
   */
  fid: string
  /**
   * Human-readable name.
   */
  name: string
  /**
   * Detailed description. Text or markdown.
   */
  description: string
  /**
   * User ID of the publisher.
   */
  publishedBy: string
  /**
   * Timestamp of publication.
   */
  publishedAt: number
  unpublishedAt?: number
  /**
   * Keywords for discovery.
   */
  tags: string[]
  /**
   * Deprecation status.
   */
  isDeprecated?: boolean
  deprecatedAt?: number
  deprecationMessage?: string
}

export interface UnresolvedDependency {
  kind: typeof UnresolvedDependencyKind
  /**
   * Key of the missing namespace.
   */
  key: string
  /**
   * The version of the missing namespace.
   */
  version: string
  /**
   * Explanation of the failure (e.g., "Namespace unpublished").
   */
  reason: string
}
