@@ -24,11 +24,20 @@ class Search extends Requestable {
2424 this . __defaults = this . _getOptionsWithDefaults ( defaults ) ;
2525 }
2626
27+ /**
28+ * Available search options
29+ * @see https://developer.github.com/v3/search/#parameters
30+ * @typedef {Object } Search.Params
31+ * @param {string } q - the query to make
32+ * @param {string } sort - the sort field, one of `stars`, `forks`, or `updated`.
33+ * Default is [best match](https://developer.github.com/v3/search/#ranking-search-results)
34+ * @param {string } order - the ordering, either `asc` or `desc`
35+ */
2736 /**
2837 * Perform a search on the GitHub API
2938 * @private
3039 * @param {string } path - the scope of the search
31- * @param {Object } [withOptions] - additional parameters for the search
40+ * @param {Search.Params } [withOptions] - additional parameters for the search
3241 * @param {Requestable.callback } [cb] - will receive the results of the search
3342 * @return {Promise } - the promise for the http request
3443 */
@@ -38,13 +47,13 @@ class Search extends Requestable {
3847 Object . keys ( withOptions ) . forEach ( ( prop ) => requestOptions [ prop ] = withOptions [ prop ] ) ;
3948
4049 log ( `searching ${ path } with options:` , requestOptions ) ;
41- return this . _request ( 'GET' , `/search/${ path } ` , requestOptions , cb ) ;
50+ return this . _requestAllPages ( `/search/${ path } ` , requestOptions , cb ) ;
4251 }
4352
4453 /**
4554 * Search for repositories
4655 * @see https://developer.github.com/v3/search/#search-repositories
47- * @param {Object } [options] - additional parameters for the search
56+ * @param {Search.Params } [options] - additional parameters for the search
4857 * @param {Requestable.callback } [cb] - will receive the results of the search
4958 * @return {Promise } - the promise for the http request
5059 */
@@ -55,7 +64,7 @@ class Search extends Requestable {
5564 /**
5665 * Search for code
5766 * @see https://developer.github.com/v3/search/#search-code
58- * @param {Object } [options] - additional parameters for the search
67+ * @param {Search.Params } [options] - additional parameters for the search
5968 * @param {Requestable.callback } [cb] - will receive the results of the search
6069 * @return {Promise } - the promise for the http request
6170 */
@@ -66,7 +75,7 @@ class Search extends Requestable {
6675 /**
6776 * Search for issues
6877 * @see https://developer.github.com/v3/search/#search-issues
69- * @param {Object } [options] - additional parameters for the search
78+ * @param {Search.Params } [options] - additional parameters for the search
7079 * @param {Requestable.callback } [cb] - will receive the results of the search
7180 * @return {Promise } - the promise for the http request
7281 */
@@ -77,7 +86,7 @@ class Search extends Requestable {
7786 /**
7887 * Search for users
7988 * @see https://developer.github.com/v3/search/#search-users
80- * @param {Object } [options] - additional parameters for the search
89+ * @param {Search.Params } [options] - additional parameters for the search
8190 * @param {Requestable.callback } [cb] - will receive the results of the search
8291 * @return {Promise } - the promise for the http request
8392 */
0 commit comments