Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http auth support #4

Merged
merged 5 commits into from
Feb 8, 2016
Merged

http auth support #4

merged 5 commits into from
Feb 8, 2016

Conversation

acvetkov
Copy link
Owner

@acvetkov acvetkov commented Feb 5, 2016

@vitalets

  • append httpAuth support
  • fix tests

#3

@acvetkov acvetkov self-assigned this Feb 5, 2016
@acvetkov acvetkov changed the title Auth user support http auth support Feb 5, 2016
* @param {Object} locatorObject
* @param {String} path
* @returns {String}
*/
export function contentUrl(options, locatorObject, path) {
const baseUrl = apiUrl(options);
export function contentUrl(locatorObject, path) {
const locator = locatorToString(locatorObject);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add .toString() method to locator object?
Then you will no need to import locatorToString and call it many times, just ..${locator}..

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locatorObject is pure js object, that specified by client.
For example:

var locator = {
  buildType: {
    id: 123
  }
};

client.build.detail(locator)
  .then(processResponse);

I think, it's harmfull to force user import additional class from teamcity-client package.

var client = require('teamcity-client');
var Locator = require('teamcity-client/locator');

var locator = new Locator({
  buildType: {
    id: 123
  }
});
client.build.detail(locator)
  .then(processResponse);

@vitalets
Copy link
Collaborator

vitalets commented Feb 7, 2016

👍

acvetkov added a commit that referenced this pull request Feb 8, 2016
@acvetkov acvetkov merged commit c62a772 into master Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants