import {
  API_DOCS_REGISTRY,
  getDocForEndpoint,
  hasDoc,
  getAllDocEndpoints
} from "@nextsparkjs/registries/api-docs-registry";
class ApiDocsService {
  // ==================== Query Methods ====================
  /**
   * Get documentation entry for an endpoint
   *
   * @param endpoint - The endpoint path (e.g., '/api/v1/customers')
   * @returns Doc entry with path and title, or undefined if not found
   *
   * @example
   * const doc = ApiDocsService.getByEndpoint('/api/v1/customers')
   * if (doc) {
   *   console.log(`Loading doc: ${doc.title}`)
   * }
   */
  static getByEndpoint(endpoint) {
    return getDocForEndpoint(endpoint);
  }
  /**
   * Check if an endpoint has documentation
   *
   * @param endpoint - The endpoint path
   * @returns True if documentation exists for this endpoint
   */
  static hasDoc(endpoint) {
    return hasDoc(endpoint);
  }
  /**
   * Get all endpoints that have documentation
   *
   * @returns Array of endpoint paths with docs
   */
  static getAllEndpoints() {
    return getAllDocEndpoints();
  }
  // ==================== Metadata Methods ====================
  /**
   * Get registry metadata
   *
   * @returns Object with totalDocs, generatedAt, themeName
   */
  static getMeta() {
    return API_DOCS_REGISTRY.meta;
  }
  /**
   * Get total count of documented endpoints
   *
   * @returns Total number of endpoints with documentation
   */
  static getTotalDocs() {
    return API_DOCS_REGISTRY.meta.totalDocs;
  }
  // ==================== Utility Methods ====================
  /**
   * Get the file path for an endpoint's documentation
   *
   * @param endpoint - The endpoint path
   * @returns The file path or undefined if no doc exists
   */
  static getDocPath(endpoint) {
    const doc = getDocForEndpoint(endpoint);
    return doc == null ? void 0 : doc.path;
  }
  /**
   * Get the title for an endpoint's documentation
   *
   * @param endpoint - The endpoint path
   * @returns The title or undefined if no doc exists
   */
  static getDocTitle(endpoint) {
    const doc = getDocForEndpoint(endpoint);
    return doc == null ? void 0 : doc.title;
  }
}
export {
  ApiDocsService
};
