mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
Gitbeaker has been split up into 5 subpackages: gitbeaker-core, gitbeaker-node, gitbeaker-cli, gitbeaker-browser and gitbeaker-requester-utils.
gitbeaker-[node,cli,browser] are enviroment
specific sub packages. For example, if you want to use gitbeaker in a NodeJS environment, use gitbeaker-node. gitbeaker-core is where all the
base logic exists, and gitbeaker-requester-utils is a collection of utility functions for making custom requester libraries.
BREAKING CHANGE: 🧨 This migration requires users to import specific subpackages. For NodeJS
usage, that would be @gitbeaker/node.
30 lines
745 B
TypeScript
30 lines
745 B
TypeScript
import {
|
|
BaseRequestOptions,
|
|
BaseService,
|
|
PaginatedRequestOptions,
|
|
RequestHelper,
|
|
Sudo,
|
|
} from '../infrastructure';
|
|
|
|
export class SystemHooks extends BaseService {
|
|
add(url: string, options?: BaseRequestOptions) {
|
|
return RequestHelper.post(this, 'hooks', { url, ...options });
|
|
}
|
|
|
|
all(options?: PaginatedRequestOptions) {
|
|
return RequestHelper.get(this, 'hooks', options);
|
|
}
|
|
|
|
edit(hookId: number, url: string, options?: BaseRequestOptions) {
|
|
const hId = encodeURIComponent(hookId);
|
|
|
|
return RequestHelper.put(this, `hooks/${hId}`, { url, ...options });
|
|
}
|
|
|
|
remove(hookId: number, options?: Sudo) {
|
|
const hId = encodeURIComponent(hookId);
|
|
|
|
return RequestHelper.del(this, `hooks/${hId}`, options);
|
|
}
|
|
}
|