mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
feat: Add Group.projects (#494)
This commit also introduces a minimal typed response as a first step towards #384.
This commit is contained in:
parent
24cc494f63
commit
9def4e7f8e
@ -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<ProjectSchema[]> {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/projects`, options) as Promise<ProjectSchema[]>;
|
||||
}
|
||||
|
||||
remove(groupId: string | number, options?: Sudo) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user