feat(Webhook): add type property and created* getters (#3585)

* feat(Webhook): add created* getters

* feat(Webhook): add type property

* typings(WebhookFields): use primitive string for url getter

Co-Authored-By: Gryffon Bellish <owenbellish@gmail.com>

* fix(Webhook): token can be null

Co-authored-by: Gryffon Bellish <owenbellish@gmail.com>
This commit is contained in:
SpaceEEC
2019-12-27 19:27:34 +01:00
committed by GitHub
parent fc27ce1a15
commit ea76a56639
3 changed files with 51 additions and 4 deletions

View File

@@ -628,6 +628,19 @@ exports.MembershipStates = [
'ACCEPTED',
];
/**
* The value set for a webhook's type:
* * Incoming
* * Channel Follower
* @typedef {string} WebhookTypes
*/
exports.WebhookTypes = [
// They start at 1
null,
'Incoming',
'Channel Follower',
];
function keyMirror(arr) {
let tmp = Object.create(null);
for (const value of arr) tmp[value] = value;