gitlab-restapi
Advanced tools
Comparing version 1.1.2 to 1.1.5
{ | ||
"name": "gitlab-restapi", | ||
"version": "1.1.2", | ||
"version": "1.1.5", | ||
"description": "Integration with GitLab REST API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -72,2 +72,12 @@ # Integration with GitLab REST API | ||
GitLab.Options can specify your method for fetching data. | ||
For nodes 18+ - this is the own node fetch, for younger versions (unless otherwise specified) - the internal mechanism | ||
```javascript | ||
new GitLab.Options({ | ||
privateToken: process.env.GIT_TOKEN, | ||
projectId: process.env.GIT_PID, | ||
fetchMethod: fetch // axios, fetch, node-fetch, GitLab.Request, etc... | ||
}) | ||
``` | ||
### List of [Jobs](https://docs.gitlab.com/ee/api/jobs.html) methods: | ||
@@ -74,0 +84,0 @@ |
@@ -26,4 +26,3 @@ /* | ||
*/ | ||
#methods = { | ||
}; | ||
#methods = {}; | ||
@@ -104,5 +103,6 @@ get methods() { | ||
if (response.ok) return new Class(await response.json()); | ||
else if (response.statusText && response.statusText === 'OK') return new Class(response.data); | ||
else { | ||
const e = await response.json(); | ||
console.error('WARNING:', e.message + ' : ' + url) | ||
const e = response.statusText && response.data ? response.data : await response.json(); | ||
console.error('WARNING:', JSON.stringify({...e, url})) | ||
} | ||
@@ -109,0 +109,0 @@ } catch (e) { |
@@ -52,4 +52,5 @@ /* | ||
code: res.statusCode, | ||
method: options.method, | ||
url | ||
})); | ||
//return resolve(new Error(`HTTP status code ${res.statusMessage} ${res.statusCode} `)) | ||
} | ||
@@ -56,0 +57,0 @@ const data = [] |
@@ -23,3 +23,3 @@ /* | ||
projectId: process.env.GIT_PID, | ||
//fetchMethod: new GitLab.Request() | ||
fetchMethod: GitLab.Request // axios, fetch, node-fetch, etc... | ||
})); | ||
@@ -26,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75948
1491
171