markmssd / bitbucket-server-nodejs Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sorohan/stash-rest-api
A NodeJS library to interact with Bitbucket-Server. Supports Basic Auth and OAuth1.
This project forked from sorohan/stash-rest-api
A NodeJS library to interact with Bitbucket-Server. Supports Basic Auth and OAuth1.
Hello, I'm building a simple NodeJS based CLI with some bitbucket features.
I'm trying to connect using basic auth but I'm struggling with the apis url:
var auth = {
"type": "basic",
"username": "username",
"password": "password"
}
var client = await new bitbucket('https://api.bitbucket.orgs/2.0', auth)
client.settings.get('omarfouad')
I'm getting a 'Resource not found' error.
Ideas?
The implementation of client.repos.getAll
is not idempotent, and compounds responses from the second call onwards.
It seems to keep a global state of all repos read (for recursion purposes), requiring the creation of a new client to nullify state.
The culprit is at https://github.com/markmssd/bitbucket-server-nodejs/blob/master/lib/api/repos.js#L10
The following code demonstrates the issue:
const client = new Client(url, auth);
client.repos.getAll().then(repos => console.log(repos.length)); // prints N
client.repos.getAll().then(repos => console.log(repos.length)); // prints 2N
Can you please comment on this finding? I can submit a quick PR that will add an optional repos
array as a second arg of getAll
, allowing the recursion to carry its state internally.
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.