0.6.0 • Published 3 years ago

bitbucket-v2 v0.6.0

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

node-bitbucket-v2

node.js library to access the Bitbucket API v2

usage

Not supported for Node < 7.6

const Bitbucket = require('node-bitbucket-v2');
const bitbucketApi = new Bitbucket(options);
bitbucketApi.authenticateOAuth2(accessTokenString);

bitbucketApi.user.get().then(({ body }) => {
  console.log(body.uuid);
});

options

It is not necessary to provide any options at all (Bitbucket can be constructed with no argument).

  • requesterFn ((options) => Promise<any>): If provided, requests will be made using the function you provide. This is allows you to use your preferred http client. The options provided are { headers, hostname, method, path, query, url, body? }. body is only provided on POST methods. In the case of getNextPage, getPreviousPage, getForksFromResponse and getParentFromResponse, only { headers, method, url } are provided in the options. Example:

     const axios = require('axios');
     const Bitbucket = require('node-bitbucket-v2');
    
     const requesterFn = (options) => {
       const { url, method, body } = options;
    
       if (method === 'POST') {
         return axios.post(url, body);
       }
    
       return axios.get(url);
     };
    
     const bitbucketApi = new Bitbucket({ requesterFn });
  • proxy (String): Defines a proxy to make requests against, instead of api.bitbucket.org:443. This option is ignored when requesterFn is provided.

For implemented methods, check bitbucket/repositories.js and bitbucket/user.js.

0.6.0

3 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.4

6 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago