repo-utils / gitlab Goto Github PK
View Code? Open in Web Editor NEWGitlab nodejs API Client
Gitlab nodejs API Client
Thanks in advance for that great library!
But when I install it via
npm install node-gitlab
I always get the warning, that the used module native-or-bluebird
is deprecated and should be replaced with the module any-promise
.
Hi I need to move some project to gitlab and I'm looking for good library to use it from javascript. This library looks pretty complete, thanks for building and sharing this!
Is there any (known) obstacle to browserify this library? Thanks in advance for any reply!
Hi!
I use node-gitlab package (Gitlab API Node.js client) in order to get a file from a gitlab repository . I followed what exists in the official documentation concerning this one (https://www.npmjs.com/package/node-gitlab) and I tried this function (see the capture below) but I received this error during the execution.
Any idea about how to resolve this?
Thanks in advance!
Here is the code that I tried:
Mostly used for issues, being able to use query params is important. Being able to search for open/closed, labels, milestones etc
From GitLab 11 support for v3 API has been removed - https://docs.gitlab.com/ee/api/v3_to_v4.html
I hit this issue when attempting to use client.projects.search()
, this fails because searching projects has changed:
GET /projects/:search
(use: GET /projects?search=x
)https://github.com/repo-utils/gitlab/blob/master/lib/resources/repository_branch.js#L28
https://github.com/repo-utils/gitlab/blob/master/lib/resources/repository_branch.js#L33
has double this
this.client.request('put', this.this.onePath + '/protect', params, callback);
In node v7.2.0, code like this works:
client.projects.list({}, (err, projects) => {
if (err) throw err
console.log(projects)
})
But with this:
client.projects.list({})
.then(projects => console.log(projects))
.catch(err => { throw err })
I get this error:
/Users/konsumer/Desktop/migrate-git/migrate.js:45
.then(milestones => console.log(milestones))
^
TypeError: Cannot read property 'then' of undefined
at Object.<anonymous> (/Users/konsumer/Desktop/migrate-git/migrate.js:45:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
It seems like promises don't work with several others, as well.
Hi,
I have an error while trying to merge a merge request.
{ Gitlab404Error: Unknow Error 404
at Gitlab.RESTFulClient.handleResult (/home/ggrimbert/edevelo/local/Aurelia/projects-managing/node_modules/restful-client/lib/client.js:75:11)
at /home/ggrimbert/edevelo/local/Aurelia/projects-managing/node_modules/restful-client/lib/client.js:133:10
at done (/home/ggrimbert/edevelo/local/Aurelia/projects-managing/node_modules/urllib/lib/urllib.js:262:5)
at /home/ggrimbert/edevelo/local/Aurelia/projects-managing/node_modules/urllib/lib/urllib.js:435:9
at decodeContent (/home/ggrimbert/edevelo/local/Aurelia/projects-managing/node_modules/urllib/lib/urllib.js:310:14)
It appears that the url called to merge is /api/v3/projects/41/merge_requests/59/merge
but it should be /api/v3/projects/41/merge_request/59/merge
Hej folks,
I'm using this awesome wrapper for the GitLab API and was wondering the other day, why there are projects missing when using gitlab.projects.list
.
After some research I've seen, that GitLab uses a pagination via Link headers and was wondering how to set them.
Are you up for a PR, which allows the user to set a default per_page
? (GitLabs default is 20)
Also how would you like the pagination? I see no way without breaking backward compatibility here, as you're passing the actual content array and not a "wrapper with meta-information" e.g.:
yield gitlab.projects.list();
{
page: 1,
perPage: 30,
content: [...]
}
EDIT: I've found out so far, that I can use gitlab.projects.list({per_page: 30})
, though it doesn't look that nice, especially when privateToken
is in camel-case.
Also we don't get the feedback from headers whether there are more pages to request or not.
I base on Meteor JS
.
// server method
var gitlab = require('node-gitlab') // don't work
import gitlab from 'node-gitlab' // don't work
..........
Got error
TypeError: fs.readFileSync is not a function
at eval (/node_modules/urllib/lib/urllib.js:37)
at dynamic-import.js?hash=6e5870d62f7cbec7d534040d41bfc3a553f07bbd:138
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
at require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:268)
at eval (/node_modules/urllib/index.js:9)
at dynamic-import.js?hash=6e5870d62f7cbec7d534040d41bfc3a553f07bbd:138
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
at require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:268)
I've been up and down the documentation, trying a few things but I can't seem to do a project pull request.
am I missing something or is this more for managing the git project remotely?
Thanks
Awesome work so far.
Some documentation would be nice. I'll be happy to help.
I have hosted gitlab in ubuntu and my project repositories saved in external hard disk After unmounting external hard disk i need to reconfigure gitlab each and evrey repository in External HDD. Is it possible to save repositories permenently after remounting of external HDD.
I need namespace_id
for projects.create
.
To get info about namespaces, the info is at GET ${options.api}/namespaces
. Where would be the best place to put this in the API?
Seem to get unauthorized access error. How can I set it up to run tests on my own test repo?
Thanks. Trying to add some of the latest API methods, such as commitActions
Add support to call the API-Functions of runners https://docs.gitlab.com/ce/api/runners.html for next release.
create-a-commit-with-multiple-files-and-actions
At least I think that's what I'd need to push multiple files to a repo!?
How come none of the gitlab APIs seem to support this core use case?
I want to update the content of gitlab repository file with encoding utf-8.But I don't want to update all content.How can I do it?
Couldn't find it anywhere in the docs, but since I really needed it I did a little digging:
client.issues.remove({id, issue_id})
removes an issue (if your api_key has it least the authority project-owner)
is it possible to use this library with promise?
Is there any possibility to include this functionality when creating hooks?
Add support to call the API-Functions of contributors https://docs.gitlab.com/ce/api/repositories.html#contributors for next release.
Hi,
I was wondering if there is the possibility to set the sudo header for a specific request?
I would need this feature to be able to perform actions as another user.
Is there a way to access all projects?. The api equelent is projects/all
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.