silas / node-jenkins

Jenkins client
https://www.npmjs.com/package/jenkins
MIT License
356 stars 85 forks source link

Proposal, add support for general api endpoints #74

Closed rburdet closed 5 years ago

rburdet commented 5 years ago

This is related with #27.

I would like to have a method where you could use your session object to make requests to non standard api like: {url}/job/{job}/buildHistory/ajax?search={search} or even standard method for extensibility like {url}/job/{job}/api.

Suppose you want to handle the full json tree yourself:

jenkins.url('/job/{job}/json?depth=1')

Or in my particular scenario i would like to do:

jenkins.url('/job/{job}/buildHistory/ajax?search={search}')

I could submit the PR if you are interested

silas commented 5 years ago

I think you'd probably just end up rebuilding the _get, _post, etc... methods. Is there a reason you can't use those directly?

Those are part of the papi API and should be relatively stable.

silas commented 5 years ago

If the above doesn't work feel free to re-open.