MunifTanjim / node-bitbucket

Bitbucket API client for Browser and Node.js
https://bitbucketjs.netlify.app
MIT License
105 stars 31 forks source link

Help with filter queries and /deployments #134

Closed dgsangoma closed 11 months ago

dgsangoma commented 12 months ago

I'm trying to use the deployments.list method with filter and sort params. After finding the following comment:

https://jira.atlassian.com/browse/BCLOUD-18729?focusedId=3179095&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-3179095

I think it's possible to do this, but I think it's necessary not to include q= at the beginning of the query in the request URL. Is there a way to see additional debug info for the request the library makes to confirm what URL it uses?

MunifTanjim commented 11 months ago

You can see all the information about the request like this:

bitbucket.deployments
  .list({
    workspace: '<WORKSPACE>',
    repo_slug: '<REPO>',
    sort: '-state.completed_on',
  })
  .then((res) => {
    console.log('res', res)
  })
  .catch((err) => {
    console.error(err)
  })
dgsangoma commented 11 months ago

Thanks. I ended up punting and switching to using axios to interact with the API routes directly since it seems like Atlassian makes it difficult to build a higher level abstraction like this library provides.