Skip to content

Commit

Permalink
add swag and other endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
joedimarzio committed Nov 20, 2019
1 parent accfc2b commit 66671be
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/index.js
Expand Up @@ -21,6 +21,19 @@ class HackeroneClient {
};
}


async getPrograms() {
const options = Object.assign({}, this.options);
options.uri += "me/programs";

const result = await request(options).catch(function(err) {
throw new Error(err);
});

return result;
}


async verifyAccess() {
const options = Object.assign({}, this.options);
options.uri += "users/" + this.h1Key_name;
Expand All @@ -29,6 +42,19 @@ class HackeroneClient {
});
}


async swag(programId) {
const options = Object.assign({}, this.options);
options.uri += "programs/" + programId + "/swag";

const result = await request(options).catch(function(err) {
throw new Error(err);
});

return result;
}


async readReport(reportNumber) {
const options = Object.assign({}, this.options);
options.uri += "reports/" + reportNumber;
Expand All @@ -47,7 +73,7 @@ class HackeroneClient {
options.uri += "reports?filter[program][]=" + program + "&";
for (const key in additionalFilters) {
let value = additionalFilters[key];
options.uri += key + "=" + value + "&";
options.uri += key + "=" + value;
}
} else {
options.uri += "reports?filter[program][]=" + program;
Expand Down Expand Up @@ -77,4 +103,4 @@ class HackeroneClient {
}
}

module.exports = HackeroneClient;
module.exports = HackeroneClient;

0 comments on commit 66671be

Please sign in to comment.