@cpod/sdk - v0.2.7
    Preparing search index...

    Function getDocumentFiles

    • Get indexed document files (optimized for fast loading)

      Retrieves file info with pagination, filtering, and sorting support.

      Parameters

      • Optionaloptions: DocumentFilesRequest

        Optional pagination and filtering parameters

        Request parameters for listing files with pagination

        • Optionalpage?: number

          Page number (1-indexed, default: 1)

        • Optionallimit?: number

          Number of files per page (1-1000, default: 100)

        • OptionalsourceId?: string

          Filter by source ID

        • Search files by name

        • OptionalsortBy?: "name" | "date" | "size"

          Sort by field

        • OptionalsortOrder?: "asc" | "desc"

          Sort order

      Returns Promise<DocumentFilesResponse>

      Promise resolving to DocumentFilesResponse:

      • files - Array of DocumentFileMinimal objects
      • total - Total number of indexed files (for pagination UI)
      • page - Current page number
      • limit - Files per page
      • totalPages - Total number of pages

      401 - Not authenticated

      import { getDocumentFiles, searchDocuments } from "@cpod/sdk";

      // Get first page of files
      const { files, total, totalPages } = await getDocumentFiles();
      console.log(`Found ${total} indexed files (${totalPages} pages)`);

      // Search and paginate
      const page2 = await getDocumentFiles({
      page: 2,
      limit: 50,
      search: "report",
      sortBy: "date",
      sortOrder: "desc",
      });