-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathGitlabPages.ts
35 lines (32 loc) · 1.11 KB
/
GitlabPages.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper, endpoint } from '../infrastructure';
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export interface GitlabPagesSettingsSchema extends Record<string, unknown> {
url: string;
is_unique_domain_enabled: boolean;
force_https: boolean;
deployments: Array<{
created_at: string;
url: string;
path_prefix: string;
root_directory: string;
}>;
}
export class GitlabPages<C extends boolean = false> extends BaseResource<C> {
remove<E extends boolean = false>(
projectId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<void, C, E, void>> {
return RequestHelper.del()(this, endpoint`projects/${projectId}/pages`, options);
}
showSettings<E extends boolean = false>(
projectId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<GitlabPagesSettingsSchema, C, E, void>> {
return RequestHelper.get<GitlabPagesSettingsSchema>()(
this,
endpoint`projects/${projectId}/pages`,
options,
);
}
}