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

    Function getDocumentProjects

    • Get projects with file counts and optional file details

      Retrieves projects accessible to the user with pagination, search, and sorting.

      Parameters

      • Optionaloptions: GetProjectsOptions

        Optional filtering and pagination parameters

        Request parameters for getting projects

        • Optionalpage?: number

          Page number (1-indexed, default: 1)

        • Optionallimit?: number

          Projects per page (1-500, default: 100)

        • OptionaluserIds?: string[]

          Filter by user IDs

        • OptionalisManager?: boolean

          Manager view (shows shared projects)

        • Search projects by name

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

          Sort by field (name, date, or fileCount)

        • OptionalsortOrder?: "asc" | "desc"

          Sort order

        • OptionalincludeFiles?: boolean

          Include file details in response

      Returns Promise<ProjectsResponse>

      Promise resolving to ProjectsResponse

      import { getDocumentProjects } from "@cpod/sdk";

      // Get first page of projects
      const { projects, total, totalPages } = await getDocumentProjects();

      // Search with pagination
      const results = await getDocumentProjects({
      search: "quarterly",
      page: 2,
      limit: 10,
      sortBy: "date",
      sortOrder: "desc",
      });

      for (const project of results.projects) {
      console.log(`${project.name}: ${project.fileCount} files`);
      }