mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
71 lines
2.2 KiB
TypeScript
71 lines
2.2 KiB
TypeScript
import type { BaseResourceOptions } from '@gitbeaker/requester-utils';
|
|
import { ResourceVariables } from '../templates';
|
|
import type { VariableFilter, VariableSchema, VariableType } from '../templates/ResourceVariables';
|
|
import type {
|
|
GitlabAPIResponse,
|
|
PaginationRequestOptions,
|
|
PaginationTypes,
|
|
ShowExpanded,
|
|
Sudo,
|
|
} from '../infrastructure';
|
|
|
|
export interface ProjectVariableSchema extends VariableSchema {
|
|
environment_scope: string;
|
|
}
|
|
|
|
export interface ProjectVariables<C extends boolean = false> extends ResourceVariables<C> {
|
|
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
|
|
projectId: string | number,
|
|
options?: Sudo & ShowExpanded<E> & PaginationRequestOptions<P>,
|
|
): Promise<GitlabAPIResponse<ProjectVariableSchema[], C, E, P>>;
|
|
|
|
create<E extends boolean = false>(
|
|
projectId: string | number,
|
|
key: string,
|
|
value: string,
|
|
options?: {
|
|
variableType?: VariableType;
|
|
protected?: boolean;
|
|
masked?: boolean;
|
|
environmentScope?: string;
|
|
description?: string;
|
|
raw?: boolean;
|
|
} & Sudo &
|
|
ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<ProjectVariableSchema, C, E, void>>;
|
|
|
|
edit<E extends boolean = false>(
|
|
projectId: string | number,
|
|
key: string,
|
|
value: string,
|
|
options?: {
|
|
variableType?: VariableType;
|
|
protected?: boolean;
|
|
masked?: boolean;
|
|
environmentScope?: string;
|
|
raw?: boolean;
|
|
filter: VariableFilter;
|
|
} & Sudo &
|
|
ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<ProjectVariableSchema, C, E, void>>;
|
|
|
|
show<E extends boolean = false>(
|
|
projectId: string | number,
|
|
key: string,
|
|
options?: { filter?: VariableFilter } & Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<ProjectVariableSchema, C, E, void>>;
|
|
|
|
remove<E extends boolean = false>(
|
|
projectId: string | number,
|
|
key: string,
|
|
options?: { filter?: VariableFilter } & Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<void, C, E, void>>;
|
|
}
|
|
|
|
export class ProjectVariables<C extends boolean = false> extends ResourceVariables<C> {
|
|
constructor(options: BaseResourceOptions<C>) {
|
|
/* istanbul ignore next */
|
|
super('projects', options);
|
|
}
|
|
}
|