import { fetchAPI } from '../services/api';

/**
 * Linker API Client
 * Functions for internal linking operations
 */
export const linkerApi = {
  /**
   * Process a single content item for internal linking
   * @param contentId - Content ID to process
   * @returns Link result with links added
   */
  process: async (contentId: number) => {
    return await fetchAPI('/v1/linker/process/', {
      method: 'POST',
      body: JSON.stringify({ content_id: contentId }),
    });
  },

  /**
   * Batch process multiple content items for internal linking
   * @param contentIds - Array of content IDs to process
   * @returns Array of link results
   */
  batchProcess: async (contentIds: number[]) => {
    return await fetchAPI('/v1/linker/batch_process/', {
      method: 'POST',
      body: JSON.stringify({ content_ids: contentIds }),
    });
  },
};

