jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get projects marked for deletion

dsebastien opened this issue · comments

Description

I would like to be able to list projects that have been marked for deletion

Proposal

  • Add the marked_for_deletion_on property to ProjectSchema
  • Add markedForDeletion: boolean to AllProjectsOptions

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.

Add markedForDeletion: boolean to AllProjectsOptions

Where do you see this in the docs for the all projects query? https://docs.gitlab.com/ee/api/projects.html#list-all-projects

Sorry for the confusion. You're right, it doesn't seem to be supported yet. I'll continue filtering on the client side for now:

import { ProjectSchema, Camelize, Gitlab } from 'https://esm.sh/@gitbeaker/rest?dts';

export async function getProjectsMarkedForDeletion(gitLabClient: InstanceType<typeof Gitlab>): Promise<(ProjectSchema | Camelize<ProjectSchema>)[]> {
  // TODO refactor once improved upstream: https://github.com/jdalrymple/gitbeaker/issues/3443
  const allProjects = await gitLabClient.Projects.all();

  return (allProjects as any).filter((project: any) => project.markedForDeletionOn);
}

Ill update the type for now, but will keep this issue open for better tracking!