mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 14:02:48 +00:00
feat: add method to get subgroups
This commit is contained in:
23
src/api.ts
23
src/api.ts
@@ -14,7 +14,19 @@
|
||||
*/
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import * as request from 'request-promise-native';
|
||||
import {AccessLevel, Branch, Issue, Label, Member, MergeRequest, Milestone, Project, Tag, TreeFile} from './types';
|
||||
import {
|
||||
AccessLevel,
|
||||
Branch,
|
||||
Group,
|
||||
Issue,
|
||||
Label,
|
||||
Member,
|
||||
MergeRequest,
|
||||
Milestone,
|
||||
Project,
|
||||
Tag,
|
||||
TreeFile
|
||||
} from './types';
|
||||
|
||||
export const logger = new Logger();
|
||||
|
||||
@@ -375,6 +387,15 @@ export class Api {
|
||||
return this.makeGitLabAPIRequest('groups/' + groupId + '/projects');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sub groups of a group
|
||||
*
|
||||
* @param groupId Group ID to get subgroups for
|
||||
*/
|
||||
public getSubGroupsForGroup(groupId: number): Promise<Group[]> {
|
||||
return this.makeGitLabAPIRequest(`/groups/${groupId}/subgroups`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags of a project
|
||||
*
|
||||
|
||||
20
src/types.ts
20
src/types.ts
@@ -239,3 +239,23 @@ export interface ThingWithTimeStats {
|
||||
total_time_spent: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A GitLab group
|
||||
*/
|
||||
export interface Group {
|
||||
id: number;
|
||||
web_url: string;
|
||||
name: string;
|
||||
path: string;
|
||||
description: string;
|
||||
visibility: string;
|
||||
lfs_enabled: boolean;
|
||||
avatar_url: string;
|
||||
request_access_enabled: boolean;
|
||||
full_name: string;
|
||||
full_path: string;
|
||||
parent_id: number;
|
||||
ldap_cn: string;
|
||||
ldap_access: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user