forked from clearlydefined/service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitlab.js
More file actions
34 lines (31 loc) · 1.09 KB
/
Copy pathgitlab.js
File metadata and controls
34 lines (31 loc) · 1.09 KB
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
// (c) Copyright 2024, SAP SE and ClearlyDefined contributors. Licensed under the MIT license.
// SPDX-License-Identifier: MIT
const { Gitlab } = require('@gitbeaker/rest')
/**
* @typedef {import('./gitlab').GitlabClientOptions} GitlabClientOptions
*
* @typedef {import('./gitlab').GitlabModule} GitlabModule
*
* @typedef {import('@gitbeaker/rest').Gitlab} GitlabClient
*/
/**
* GitLab client module providing utilities for interacting with GitLab API. This module creates configured GitLab
* client instances with default headers for use throughout the ClearlyDefined service.
*
* @type {GitlabModule}
*/
module.exports = {
/**
* Creates and configures a GitLab client instance with standard headers and authentication token.
*
* @param {GitlabClientOptions} [options] - Configuration options for the GitLab client
* @returns {GitlabClient} A configured GitLab client instance
* @see {@link https://github.com/jdalrymple/gitbeaker GitBeaker Documentation}
*/
getClient: function (options) {
const gitlab = new Gitlab({
token: options?.token
})
return gitlab
}
}