Skip to content
This repository was archived by the owner on Jan 4, 2022. It is now read-only.

Commit 2ecff6a

Browse files
authored
Merge pull request #34 from gmkarl/moredoc
Add documentation to constructor
2 parents 653d042 + 27ceb96 commit 2ecff6a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ toc:
44
- name: functions
55
- getAgencies
66
- getAgencyRepos
7-
- getRepoByID
7+
- getRepoById
88
- search
99
- suggest

src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ function cleanRepo(repo) {
2525
return repo
2626
}
2727

28+
/**
29+
* Construct an API object.
30+
* @param {Object} [options={}] - API Options
31+
* @param {string} options.api_key - API Key. Get one at https://developers.code.gov/key.html
32+
* @param {string} [options.base=https://api.code.gov/] - Base API Url
33+
* @param {string} [options.tasksUrl=https://api.code.gov/open-tasks] - Open Tasks API Url
34+
* @param {string[]} [options.usageTypes=['openSource', 'governmentWideReuse']] - Default repo permissions to filter for
35+
* @param {boolean} [options.debug=false] - If true, output fetch urls on some functions
36+
*/
2837
class CodeGovAPIClient {
2938
constructor(options = {}) {
3039
this._base = options.base || 'https://api.code.gov/'

0 commit comments

Comments
 (0)