Javascript 如何从GITLAB API检索信息

Javascript 如何从GITLAB API检索信息,javascript,node.js,gitlab,gitlab-api,Javascript,Node.js,Gitlab,Gitlab Api,我想从GITLAB存储库中检索信息,如: 在冲刺/里程碑上花费的时间 在每个项目上花费的小时/时间 每个员工花费的小时/时间 我正试图用它来做我需要的事。 也在读 但我还是做不到 到目前为止,我的代码是: const { Gitlab, ProjectsBundle, UsersBundle, GroupsBundle } = require('@gitbeaker/node') const services = new GroupsBundle({ host: 'http://exa

我想从GITLAB存储库中检索信息,如:

  • 在冲刺/里程碑上花费的时间
  • 在每个项目上花费的小时/时间
  • 每个员工花费的小时/时间
我正试图用它来做我需要的事。
也在读

但我还是做不到

到目前为止,我的代码是:

const { Gitlab, ProjectsBundle, UsersBundle, GroupsBundle } = require('@gitbeaker/node')

const services = new GroupsBundle({
  host: 'http://example.com',
  token: 'XXXXXXXX'
})  

const projects = services.Projects.all().then((project) => {
  console.log(project)
}).catch((error) => {
  console.log(error)
})  
我可以检索所有项目、组和用户,但如果我只想检索特定组中的项目,该怎么办?
我如何获得用于特定项目的时间?
lib文档命名了一组可用的属性/属性,但是每次我尝试不同于
项目/组/用户的东西时。all()
它返回
HTTPError:Response code 404(未找到)


您需要另一个捆绑包才能按组获取项目。 见:

const projects = services.Projects.Branches.all()  // for ProjectsBundle - 404 Not Found
const projects = services.GroupMilestones.all() // for GroupsBundle - 404 Not Found
etc...
const services = new GroupProjects(...);
const groupProjects: ProjectSchema[] = await services.all('groupId');