diff --git a/src/core/services/Groups.ts b/src/core/services/Groups.ts index 19784333f..e19635100 100644 --- a/src/core/services/Groups.ts +++ b/src/core/services/Groups.ts @@ -5,6 +5,7 @@ import { RequestHelper, Sudo, } from '../infrastructure'; +import { ProjectSchema } from './Projects'; export class Groups extends BaseService { all(options?: PaginatedRequestOptions) { @@ -32,6 +33,12 @@ export class Groups extends BaseService { return RequestHelper.put(this, `groups/${gId}`, options); } + projects(groupId: string | number, options?: BaseRequestOptions): Promise { + const gId = encodeURIComponent(groupId); + + return RequestHelper.get(this, `groups/${gId}/projects`, options) as Promise; + } + remove(groupId: string | number, options?: Sudo) { const gId = encodeURIComponent(groupId); diff --git a/src/core/services/Projects.ts b/src/core/services/Projects.ts index 1a9fff687..0eb70824a 100644 --- a/src/core/services/Projects.ts +++ b/src/core/services/Projects.ts @@ -9,6 +9,29 @@ import { import { EventOptions } from './Events'; import { UploadMetadata } from './ProjectImportExport'; +export interface NamespaceInfoSchema { + id: number; + name: string; + path: string; + kind: string; + full_path: string; +} + +export interface ProjectSchema { + id: number; + + name: string; + name_with_namespace: string; + path: string; + path_with_namespace: string; + + namespace: NamespaceInfoSchema; + + ssh_url_to_repo: string; + http_url_to_repo: string; + archived: boolean; +} + export class Projects extends BaseService { all(options?: PaginatedRequestOptions) { return RequestHelper.get(this, 'projects', options);