Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/gitlab

src/request.ts

19 lines · 685 B · TypeScript
import type { GitlabRequestOptions } from './types.ts'
export { GitlabRequestError, request } from './core.ts'
import { request } from './core.ts'

/**
 * Make one authenticated GitLab REST API request.
 *
 * Mutating methods (`POST`, `PUT`, `PATCH`, `DELETE`) require `dryRun: true`
 * or `confirm: true`.
 *
 * @returns Normalized response with `ok`, `status`, `data`, and `text`.
 * @example
 * import gitlabRequest from 'kody:@kody/gitlab/request'
 * const response = await gitlabRequest({ path: '/user' })
 * // => { ok: true, status: 200, data: { username: '...' } }
 */
export default async function gitlabRequest(params: GitlabRequestOptions) {
	return await request(params)
}