Added User.listEvents method by henriquesa · Pull Request #433 · github-tools/github
Expand Up
@@ -111,6 +111,26 @@ class User extends Requestable {
return this._request('GET', this.__getScopedUrl('notifications'), options, cb);
}
/** * List events for a user * @see https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user * @param {Object} [options={}] - any options to refine the search * @param {Requestable.callback} [cb] - will receive the API response * @return {Promise} - the promise for the http request */ listEvents(options, cb) { options = options || {}; if (typeof options === 'function') { cb = options; options = {}; }
options.since = this._dateToISO(options.since); options.before = this._dateToISO(options.before);
return this._request('GET', `/users/${this.__user}/events`, options, cb); }
/** * Show the user's profile * @see https://developer.github.com/v3/users/#get-a-single-user Expand Down
/** * List events for a user * @see https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user * @param {Object} [options={}] - any options to refine the search * @param {Requestable.callback} [cb] - will receive the API response * @return {Promise} - the promise for the http request */ listEvents(options, cb) { options = options || {}; if (typeof options === 'function') { cb = options; options = {}; }
options.since = this._dateToISO(options.since); options.before = this._dateToISO(options.before);
return this._request('GET', `/users/${this.__user}/events`, options, cb); }
/** * Show the user's profile * @see https://developer.github.com/v3/users/#get-a-single-user Expand Down