Loading src/api.ts +22 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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 * Loading src/types.ts +20 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading
src/api.ts +22 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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 * Loading
src/types.ts +20 −0 Original line number Diff line number Diff line Loading @@ -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; }