From 9198161bb9d34735d0d50ebb8943707c6e433ed8 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 25 Oct 2017 15:01:02 -0500 Subject: [PATCH] Automatic code formatting --- package.json | 3 +- providers/bintray.js | 2 +- providers/bitbucket.js | 4 +- providers/vsts.js | 11 +- test/codacy.js | 4 +- test/gitlab.js | 26 +- test/heroku.js | 26 +- test/patreon.js | 888 ++++++++++++++++++++++++----------------- test/travis.js | 26 +- test/trello.js | 44 +- test/unity.js | 26 +- test/vsts.js | 176 ++++---- util/BaseProvider.js | 8 +- views/index.ejs | 141 +++---- 14 files changed, 765 insertions(+), 620 deletions(-) diff --git a/package.json b/package.json index 6a702b0..b716f45 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "keywords": [ "node", "glitch", - "express" + "skyhook", + "discord" ], "devDependencies": { "chai": "^3.5.0", diff --git a/providers/bintray.js b/providers/bintray.js index 1b8de6a..4573151 100644 --- a/providers/bintray.js +++ b/providers/bintray.js @@ -16,7 +16,7 @@ class Bintray extends BaseProvider { title: this.body.package + ' v' + this.body.version + ' Released', timestamp: this.body.released }; - if(this.body.release_notes != null && this.body.release_notes){ + if (this.body.release_notes != null && this.body.release_notes) { embed.fields = [ { name: 'Release Notes', diff --git a/providers/bitbucket.js b/providers/bitbucket.js index 78dd7cc..cdac8b8 100644 --- a/providers/bitbucket.js +++ b/providers/bitbucket.js @@ -16,12 +16,12 @@ class BitBucket extends BaseProvider { } static _titleCase(str) { - if(str.length < 1) { + if (str.length < 1) { return str; } str = str.toLowerCase().split(' '); for (let i = 0; i < str.length; i++) { - str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1); + str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1); } return str.join(' '); } diff --git a/providers/vsts.js b/providers/vsts.js index 33d5866..2b9848a 100644 --- a/providers/vsts.js +++ b/providers/vsts.js @@ -48,7 +48,7 @@ class VSTS extends BaseProvider { this.fields.push({ name: "Commit from " + this.body.resource.pushedBy.displayName, value: "([`" + commit.commitId.substring(0, 7) + "`](" + - this.body.resource.repository.remoteUrl + "/commit/" + commit.commitId + ")) " + commit.comment, + this.body.resource.repository.remoteUrl + "/commit/" + commit.commitId + ")) " + commit.comment, inline: false }); } @@ -64,7 +64,7 @@ class VSTS extends BaseProvider { this.fields.push({ name: "Check in from " + this.user.name, value: "([`" + this.body.resource.changesetId + "`](" + - this.body.resource.url + ")) " + this.body.resource.comment, + this.body.resource.url + ")) " + this.body.resource.comment, inline: false }); this.addMinimalMessage(); @@ -79,7 +79,7 @@ class VSTS extends BaseProvider { this.fields.push({ name: "Pull Request from " + this.body.resource.createdBy.displayName, value: "([`" + this.body.resource.title + "`](" + - this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, + this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, inline: false }); this.addMinimalMessage(); @@ -94,7 +94,7 @@ class VSTS extends BaseProvider { this.fields.push({ name: "Pull Request Merge Commit from " + this.body.resource.createdBy.displayName, value: "([`" + this.body.resource.title + "`](" + - this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, + this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, inline: false }); this.addMinimalMessage(); @@ -109,7 +109,7 @@ class VSTS extends BaseProvider { this.fields.push({ name: "Pull Request Updated by " + this.body.resource.createdBy.displayName, value: "([`" + this.body.resource.title + "`](" + - this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, + this.body.resource.repository.remoteUrl + ")) " + this.body.resource.description, inline: false }); this.addMinimalMessage(); @@ -153,6 +153,7 @@ class VSTS extends BaseProvider { async msVssReleaseReleaseCreatedEvent() { this.addMinimalMessage(); } + //RELEASE ABANDONED async msVssReleaseReleaseAbandonedEvent() { this.addMinimalMessage(); diff --git a/test/codacy.js b/test/codacy.js index 0730463..57df5c1 100644 --- a/test/codacy.js +++ b/test/codacy.js @@ -15,12 +15,12 @@ const json = { "delta": "https://www.codacy.com/public/jquery/jquery.git/commit?bid=21776&cid=6037089" } }, - "results":{ + "results": { "fixed_count": 1, "new_count": 0 } } - }; +}; /* * Test the /POST route diff --git a/test/gitlab.js b/test/gitlab.js index 7dd67b9..2529130 100644 --- a/test/gitlab.js +++ b/test/gitlab.js @@ -78,17 +78,17 @@ const pushJson = { * Test the /POST route */ describe('/POST gitlab', () => { - it('gitlab push', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/gitlab') - .set("test", "true") - .send(pushJson) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('embeds'); - done(); - }); - }); + it('gitlab push', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/gitlab') + .set("test", "true") + .send(pushJson) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('embeds'); + done(); + }); + }); }); diff --git a/test/heroku.js b/test/heroku.js index 142817c..3100169 100644 --- a/test/heroku.js +++ b/test/heroku.js @@ -11,17 +11,17 @@ chai.use(chaiHttp); * Test the /POST route */ describe('/POST heroku', () => { - it('deploy', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/heroku') - .set("test", "true") - .send({app: 'test', user: 'example@example.com', url: 'https://www.example.com'}) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('embeds'); - done(); - }); - }); + it('deploy', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/heroku') + .set("test", "true") + .send({app: 'test', user: 'example@example.com', url: 'https://www.example.com'}) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('embeds'); + done(); + }); + }); }); diff --git a/test/patreon.js b/test/patreon.js index 8041e71..9ed5c91 100644 --- a/test/patreon.js +++ b/test/patreon.js @@ -7,379 +7,521 @@ const should = chai.should(); chai.use(chaiHttp); -const pledgesUpdateJson = { data: - { attributes: - { amount_cents: 150, - created_at: '2015-05-18T23:50:42+00:00', - declined_since: null, - patron_pays_fees: false, - pledge_cap_cents: null }, - id: '1', - relationships: - { address: { data: null }, - creator: - { data: { id: '6803547', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/6803547' } }, - patron: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } }, - reward: - { data: { id: '1824235', type: 'reward' }, - links: { related: 'https://www.patreon.com/api/rewards/1824235' } } }, - type: 'pledge' }, - included: - [ { attributes: - { about: 'Hey there', - created: '2013-05-10T13:27:42+00:00', - facebook: 'https://www.facebook.com/foo', - first_name: 'Corgi', - full_name: 'Corgi Pager & Friends', - gender: 0, - image_url: 'https://c3.patreon.com/2/patreon-user/QIsuvl8VXy6o0SG6Ha2LhXvFFk6vbUUvlOyVBRL28FAQLzLOTFQIyOnkk9QTqVFo_large_2.jpeg?t=2145916800&w=400&v=-DVETVui016IwP7E5H_2gG9USey5EZOh_YlznXftZUU%3D', - last_name: 'Pager & Friends', - thumb_url: 'https://c3.patreon.com/2/patreon-user/QIsuvl8VXy6o0SG6Ha2LhXvFFk6vbUUvlOyVBRL28FAQLzLOTFQIyOnkk9QTqVFo_large_2.jpeg?h=100&t=2145916800&w=100&v=shrbfLKwzGIBgbuYhcRtNRWxetDsE3Hu88YafYxTOuY%3D', - twitch: 'https://www.twitch.tv/foo', - twitter: '', - url: 'https://www.patreon.com/corgi', - vanity: 'corgi', - youtube: '' }, - id: '32187', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } } }, - type: 'user' }, - { attributes: - { amount: 100, - amount_cents: 100, - created_at: '2017-07-07T07:59:13.450021+00:00', - deleted_at: null, - description: '', - discord_role_ids: [ '332788975498428416' ], - edited_at: '2017-07-14T04:28:25.358651+00:00', - image_url: null, - patron_count: 0, - post_count: null, - published: true, - published_at: '2017-07-07T07:59:13.450021+00:00', - remaining: null, - requires_shipping: false, - title: 'Patron on Discord', - unpublished_at: null, - url: '/bePatron?c=1052935&rid=1824235', - user_limit: null }, - id: '1824235', - relationships: - { campaign: - { data: { id: '1052935', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/1052935' } }, - creator: - { data: { id: '6803547', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/6803547' } } }, - type: 'reward' }, - { attributes: - { about: null, - created: '2017-07-07T07:22:48+00:00', - discord_id: null, - email: 'test@test.com', - facebook: null, - facebook_id: null, - first_name: 'Aventium', - full_name: 'Aventium Softworks', - gender: 0, - has_password: true, - image_url: 'https://c3.patreon.com/2/patreon-user/hh-pcVChqhD0NqBfag9UCRndTOgtu_KZ3rIlWLJDZcDA5EopsRfKh3VPJkEtw20W.png?t=2145916800&w=400&v=vELAoLALnjE3uuQCu51JeeYekzquf0ZG6s6DI0f1Ze8%3D', - is_deleted: false, - is_email_verified: true, - is_nuked: false, - is_suspended: false, - last_name: 'Softworks', - social_connections: - { deviantart: null, - discord: null, - facebook: null, - spotify: null, - twitch: null, - twitter: null, - youtube: null }, - thumb_url: 'https://c3.patreon.com/2/patreon-user/hh-pcVChqhD0NqBfag9UCRndTOgtu_KZ3rIlWLJDZcDA5EopsRfKh3VPJkEtw20W.png?h=100&t=2145916800&w=100&v=06A95RUDK68K63cKM1qt0yF-1QlxmEPkfa0yNEkGH8w%3D', - twitch: null, - twitter: null, - url: 'https://www.patreon.com/aventsoft', - vanity: 'aventsoft', - youtube: null }, - id: '6803547', - relationships: - { campaign: - { data: { id: '1052935', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/1052935' } } }, - type: 'user' }, - { attributes: - { created_at: '2013-05-10T13:27:42+00:00', - creation_count: 272, - creation_name: 'an unforgettable high school experience', - display_patron_goals: false, - earnings_visibility: 'private', - image_small_url: 'https://c3.patreon.com/2/patreon-user/emRRwJHsX35cz1UwteV54ujLO8uwAODyupEXjGmTxGzL6lqwKy7U7l7gRyPma1YX_large_2.png?h=1280&t=2145916800&w=1280&v=NGpqn95fFP0x6GFg58SxhM0bc2B4sCZ-e8HpFxDlaBk%3D', - image_url: 'https://c3.patreon.com/2/patreon-user/emRRwJHsX35cz1UwteV54ujLO8uwAODyupEXjGmTxGzL6lqwKy7U7l7gRyPma1YX_large_2.png?t=2145916800&w=1920&v=9Ga_Pd9-tXNWlxMiR5Ey1voSx-U58nxEoqivHptGbNQ%3D', - is_charged_immediately: false, - is_monthly: false, - is_nsfw: false, - is_plural: false, - main_video_embed: '', - main_video_url: '', - one_liner: 'We\'re just some people trying to help artists make money and migrate from PHP to PYTHON while supporting an existing user base and their daily transactions', - outstanding_payment_amount_cents: 0, - patron_count: 18, - pay_per_name: 'creation', - pledge_url: '/bePatron?c=70261', - published_at: '2016-09-10T22:25:16+00:00', - summary: '

In my small country school I was very popular and the top student. Easily the most beautiful corgi in my grade, possibly my entire school. Most certainly in my class. 


Since moving to a city I have encountered many challenges. The students at my school are much smarter, much faster, and can jump much much higher over the vault box. Indeed, it is my greatest shame. The vault box.


As you can see from this graphic, the vault box is an unjust physical education examination for a corgi. However, it is not in my nature to simply give up. I dream of setting the school record for highest vault jump and I will work very hard to achieve this dream.

With your help I hope to overcome my obstacles and achieve my dreams.

  1. Become the model student of my new school
  2. Achieve the highest jump over the vault box.
  3. Senpai notices me
\n
In exchange you will receive many benefits:

\n

no nofollow https://www.patreon.com/peterhollens
yes nofollow https://www.youtube.com/user/peterhollens' }, - id: '70261', - relationships: - { creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } }, - goals: - { data: - [ { id: '443028', type: 'goal' }, - { id: '443029', type: 'goal' }, - { id: '443100', type: 'goal' } ] }, - rewards: - { data: - [ { id: '-1', type: 'reward' }, - { id: '0', type: 'reward' }, - { id: '1408001', type: 'reward' }, - { id: '563244', type: 'reward' }, - { id: '1385705', type: 'reward' }, - { id: '1062816', type: 'reward' }, - { id: '1385731', type: 'reward' } ] } }, - type: 'campaign' }, - { attributes: - { created_at: '2017-07-07T07:24:59+00:00', - creation_count: 0, - creation_name: 'software', - discord_server_id: '211524927831015424', - display_patron_goals: false, - earnings_visibility: null, - image_small_url: 'https://c3.patreon.com/2/patreon-user/67sBqYJMCY-OJxkGLrWqHtFLoqc8l4kYyyT91DueGDEFLYbACrqGCHi3sNIHm1Ry.jpg?h=1280&t=2145916800&w=1280&v=kT5bCHoYM06Tyv9KhW0No0qcGtNJ0EkJ2MSjKF3BWAc%3D', - image_url: 'https://c3.patreon.com/2/patreon-user/67sBqYJMCY-OJxkGLrWqHtFLoqc8l4kYyyT91DueGDEFLYbACrqGCHi3sNIHm1Ry.jpg?t=2145916800&w=1920&v=1M7g06lBoLyqYLvmysDr2iZoYrRf7FpRxRxSEMOY7Ts%3D', - is_charged_immediately: false, - is_monthly: true, - is_nsfw: false, - is_plural: false, - main_video_embed: null, - main_video_url: null, - one_liner: null, - outstanding_payment_amount_cents: 0, - patron_count: 0, - pay_per_name: 'month', - pledge_sum: 0, - pledge_url: '/bePatron?c=1052935', - published_at: '2017-07-07T07:29:12+00:00', - summary: null, - thanks_embed: null, - thanks_msg: null, - thanks_video_url: null }, - id: '1052935', - relationships: - { creator: - { data: { id: '6803547', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/6803547' } }, - goals: { data: [] }, - rewards: - { data: - [ { id: '-1', type: 'reward' }, - { id: '0', type: 'reward' }, - { id: '1824235', type: 'reward' } ] } }, - type: 'campaign' }, - { attributes: - { amount: 0, - amount_cents: 0, - created_at: null, - description: 'Everyone', - remaining: 0, - requires_shipping: false, - type: 'reward', - url: null, - user_limit: null }, - id: '-1', - relationships: - { creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 1, - amount_cents: 1, - created_at: null, - description: 'Patrons Only', - remaining: 0, - requires_shipping: false, - type: 'reward', - url: null, - user_limit: null }, - id: '0', - relationships: - { creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 100, - amount_cents: 100, - created_at: '2017-02-15T19:54:50.018468+00:00', - deleted_at: null, - description: 'Get a patron-only perspective.', - discord_role_ids: null, - edited_at: '2017-07-10T18:21:45.322160+00:00', - image_url: 'https://s3-us-west-1.amazonaws.com/patreon-reward-images/1408001.png', - post_count: 19, - published: true, - published_at: '2017-03-31T21:20:19.342290+00:00', - remaining: null, - requires_shipping: true, - title: 'Behind The Scenes', - unpublished_at: null, - url: '/bePatron?c=70261&rid=1408001' }, - id: '1408001', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } }, - creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 100, - amount_cents: 100, - created_at: '2016-11-21T22:31:11+00:00', - deleted_at: null, - description: 'I am so honored that you should choose to support a simple corgi in pursuit of a simple dream. Thanks so much for starting on this journey with me....
\n
\n', - discord_role_ids: null, - edited_at: '2016-12-16T01:51:55.780220+00:00', - image_url: null, - post_count: 19, - published: true, - published_at: '2016-12-05T20:30:07+00:00', - remaining: null, - requires_shipping: false, - title: 'Some patrons here', - unpublished_at: null, - url: '/bePatron?c=70261&rid=563244' }, - id: '563244', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } }, - creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 100, - amount_cents: 100, - created_at: '2017-02-08T18:06:45.708277+00:00', - deleted_at: null, - description: 'Google handgout and lets chat about our next episode', - discord_role_ids: null, - edited_at: '2017-02-15T18:44:00.986474+00:00', - image_url: null, - post_count: 19, - published: true, - published_at: '2017-02-08T18:06:45.708277+00:00', - remaining: 14, - requires_shipping: true, - title: 'Help me write my next podcast', - unpublished_at: null, - url: '/bePatron?c=70261&rid=1385705' }, - id: '1385705', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } }, - creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 1000, - amount_cents: 1000, - created_at: '2016-11-21T22:31:11+00:00', - deleted_at: null, - description: '', - discord_role_ids: null, - edited_at: '2016-12-21T01:00:17.568499+00:00', - image_url: null, - post_count: null, - published: true, - published_at: '2016-12-06T23:45:22.215498+00:00', - remaining: 1, - requires_shipping: true, - title: 'NEW', - unpublished_at: null, - url: '/bePatron?c=70261&rid=1062816' }, - id: '1062816', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } }, - creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { amount: 2000, - amount_cents: 2000, - created_at: '2017-02-08T18:08:46.129090+00:00', - deleted_at: null, - description: 'Learn more about how I play.', - discord_role_ids: null, - edited_at: '2017-06-09T18:56:19.725597+00:00', - image_url: 'https://s3-us-west-1.amazonaws.com/patreon-reward-images/recommendations/G_Strategy_videos.png', - post_count: 6, - published: true, - published_at: '2017-06-09T18:56:19.719411+00:00', - remaining: null, - requires_shipping: false, - title: 'vidjastrats', - unpublished_at: null, - url: '/bePatron?c=70261&rid=1385731' }, - id: '1385731', - relationships: - { campaign: - { data: { id: '70261', type: 'campaign' }, - links: { related: 'https://www.patreon.com/api/campaigns/70261' } }, - creator: - { data: { id: '32187', type: 'user' }, - links: { related: 'https://www.patreon.com/api/user/32187' } } }, - type: 'reward' }, - { attributes: - { completed_percentage: 2, - created_at: '2016-06-01T20:14:10+00:00', - description: 'Get senpai to notice me...', - reached_at: null, - title: '' }, - id: '443028', - type: 'goal' }, - { attributes: - { completed_percentage: 1, - created_at: '2016-06-01T20:15:20+00:00', - description: 'Two senpais.', - reached_at: null, - title: '' }, - id: '443029', - type: 'goal' }, - { attributes: - { completed_percentage: 1, - created_at: '2016-06-01T21:20:27+00:00', - description: 'I will be able to hire a coach to help my overcome the highly unjust vault box. This coach will have a special focus on helping vertically challenged dogs jump very remarkable heights. Sometimes olympic heights.', - reached_at: null, - title: '' }, - id: '443100', - type: 'goal' } ], - links: { self: 'https://www.patreon.com/api/pledges/1' } } +const pledgesUpdateJson = { + data: + { + attributes: + { + amount_cents: 150, + created_at: '2015-05-18T23:50:42+00:00', + declined_since: null, + patron_pays_fees: false, + pledge_cap_cents: null + }, + id: '1', + relationships: + { + address: {data: null}, + creator: + { + data: {id: '6803547', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/6803547'} + }, + patron: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + }, + reward: + { + data: {id: '1824235', type: 'reward'}, + links: {related: 'https://www.patreon.com/api/rewards/1824235'} + } + }, + type: 'pledge' + }, + included: + [{ + attributes: + { + about: 'Hey there', + created: '2013-05-10T13:27:42+00:00', + facebook: 'https://www.facebook.com/foo', + first_name: 'Corgi', + full_name: 'Corgi Pager & Friends', + gender: 0, + image_url: 'https://c3.patreon.com/2/patreon-user/QIsuvl8VXy6o0SG6Ha2LhXvFFk6vbUUvlOyVBRL28FAQLzLOTFQIyOnkk9QTqVFo_large_2.jpeg?t=2145916800&w=400&v=-DVETVui016IwP7E5H_2gG9USey5EZOh_YlznXftZUU%3D', + last_name: 'Pager & Friends', + thumb_url: 'https://c3.patreon.com/2/patreon-user/QIsuvl8VXy6o0SG6Ha2LhXvFFk6vbUUvlOyVBRL28FAQLzLOTFQIyOnkk9QTqVFo_large_2.jpeg?h=100&t=2145916800&w=100&v=shrbfLKwzGIBgbuYhcRtNRWxetDsE3Hu88YafYxTOuY%3D', + twitch: 'https://www.twitch.tv/foo', + twitter: '', + url: 'https://www.patreon.com/corgi', + vanity: 'corgi', + youtube: '' + }, + id: '32187', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + } + }, + type: 'user' + }, + { + attributes: + { + amount: 100, + amount_cents: 100, + created_at: '2017-07-07T07:59:13.450021+00:00', + deleted_at: null, + description: '', + discord_role_ids: ['332788975498428416'], + edited_at: '2017-07-14T04:28:25.358651+00:00', + image_url: null, + patron_count: 0, + post_count: null, + published: true, + published_at: '2017-07-07T07:59:13.450021+00:00', + remaining: null, + requires_shipping: false, + title: 'Patron on Discord', + unpublished_at: null, + url: '/bePatron?c=1052935&rid=1824235', + user_limit: null + }, + id: '1824235', + relationships: + { + campaign: + { + data: {id: '1052935', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/1052935'} + }, + creator: + { + data: {id: '6803547', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/6803547'} + } + }, + type: 'reward' + }, + { + attributes: + { + about: null, + created: '2017-07-07T07:22:48+00:00', + discord_id: null, + email: 'test@test.com', + facebook: null, + facebook_id: null, + first_name: 'Aventium', + full_name: 'Aventium Softworks', + gender: 0, + has_password: true, + image_url: 'https://c3.patreon.com/2/patreon-user/hh-pcVChqhD0NqBfag9UCRndTOgtu_KZ3rIlWLJDZcDA5EopsRfKh3VPJkEtw20W.png?t=2145916800&w=400&v=vELAoLALnjE3uuQCu51JeeYekzquf0ZG6s6DI0f1Ze8%3D', + is_deleted: false, + is_email_verified: true, + is_nuked: false, + is_suspended: false, + last_name: 'Softworks', + social_connections: + { + deviantart: null, + discord: null, + facebook: null, + spotify: null, + twitch: null, + twitter: null, + youtube: null + }, + thumb_url: 'https://c3.patreon.com/2/patreon-user/hh-pcVChqhD0NqBfag9UCRndTOgtu_KZ3rIlWLJDZcDA5EopsRfKh3VPJkEtw20W.png?h=100&t=2145916800&w=100&v=06A95RUDK68K63cKM1qt0yF-1QlxmEPkfa0yNEkGH8w%3D', + twitch: null, + twitter: null, + url: 'https://www.patreon.com/aventsoft', + vanity: 'aventsoft', + youtube: null + }, + id: '6803547', + relationships: + { + campaign: + { + data: {id: '1052935', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/1052935'} + } + }, + type: 'user' + }, + { + attributes: + { + created_at: '2013-05-10T13:27:42+00:00', + creation_count: 272, + creation_name: 'an unforgettable high school experience', + display_patron_goals: false, + earnings_visibility: 'private', + image_small_url: 'https://c3.patreon.com/2/patreon-user/emRRwJHsX35cz1UwteV54ujLO8uwAODyupEXjGmTxGzL6lqwKy7U7l7gRyPma1YX_large_2.png?h=1280&t=2145916800&w=1280&v=NGpqn95fFP0x6GFg58SxhM0bc2B4sCZ-e8HpFxDlaBk%3D', + image_url: 'https://c3.patreon.com/2/patreon-user/emRRwJHsX35cz1UwteV54ujLO8uwAODyupEXjGmTxGzL6lqwKy7U7l7gRyPma1YX_large_2.png?t=2145916800&w=1920&v=9Ga_Pd9-tXNWlxMiR5Ey1voSx-U58nxEoqivHptGbNQ%3D', + is_charged_immediately: false, + is_monthly: false, + is_nsfw: false, + is_plural: false, + main_video_embed: '', + main_video_url: '', + one_liner: 'We\'re just some people trying to help artists make money and migrate from PHP to PYTHON while supporting an existing user base and their daily transactions', + outstanding_payment_amount_cents: 0, + patron_count: 18, + pay_per_name: 'creation', + pledge_url: '/bePatron?c=70261', + published_at: '2016-09-10T22:25:16+00:00', + summary: '

In my small country school I was very popular and the top student. Easily the most beautiful corgi in my grade, possibly my entire school. Most certainly in my class. 


Since moving to a city I have encountered many challenges. The students at my school are much smarter, much faster, and can jump much much higher over the vault box. Indeed, it is my greatest shame. The vault box.


As you can see from this graphic, the vault box is an unjust physical education examination for a corgi. However, it is not in my nature to simply give up. I dream of setting the school record for highest vault jump and I will work very hard to achieve this dream.

With your help I hope to overcome my obstacles and achieve my dreams.

  1. Become the model student of my new school
  2. Achieve the highest jump over the vault box.
  3. Senpai notices me
\n
In exchange you will receive many benefits:

\n

no nofollow https://www.patreon.com/peterhollens
yes nofollow https://www.youtube.com/user/peterhollens' + }, + id: '70261', + relationships: + { + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + }, + goals: + { + data: + [{id: '443028', type: 'goal'}, + {id: '443029', type: 'goal'}, + {id: '443100', type: 'goal'}] + }, + rewards: + { + data: + [{id: '-1', type: 'reward'}, + {id: '0', type: 'reward'}, + {id: '1408001', type: 'reward'}, + {id: '563244', type: 'reward'}, + {id: '1385705', type: 'reward'}, + {id: '1062816', type: 'reward'}, + {id: '1385731', type: 'reward'}] + } + }, + type: 'campaign' + }, + { + attributes: + { + created_at: '2017-07-07T07:24:59+00:00', + creation_count: 0, + creation_name: 'software', + discord_server_id: '211524927831015424', + display_patron_goals: false, + earnings_visibility: null, + image_small_url: 'https://c3.patreon.com/2/patreon-user/67sBqYJMCY-OJxkGLrWqHtFLoqc8l4kYyyT91DueGDEFLYbACrqGCHi3sNIHm1Ry.jpg?h=1280&t=2145916800&w=1280&v=kT5bCHoYM06Tyv9KhW0No0qcGtNJ0EkJ2MSjKF3BWAc%3D', + image_url: 'https://c3.patreon.com/2/patreon-user/67sBqYJMCY-OJxkGLrWqHtFLoqc8l4kYyyT91DueGDEFLYbACrqGCHi3sNIHm1Ry.jpg?t=2145916800&w=1920&v=1M7g06lBoLyqYLvmysDr2iZoYrRf7FpRxRxSEMOY7Ts%3D', + is_charged_immediately: false, + is_monthly: true, + is_nsfw: false, + is_plural: false, + main_video_embed: null, + main_video_url: null, + one_liner: null, + outstanding_payment_amount_cents: 0, + patron_count: 0, + pay_per_name: 'month', + pledge_sum: 0, + pledge_url: '/bePatron?c=1052935', + published_at: '2017-07-07T07:29:12+00:00', + summary: null, + thanks_embed: null, + thanks_msg: null, + thanks_video_url: null + }, + id: '1052935', + relationships: + { + creator: + { + data: {id: '6803547', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/6803547'} + }, + goals: {data: []}, + rewards: + { + data: + [{id: '-1', type: 'reward'}, + {id: '0', type: 'reward'}, + {id: '1824235', type: 'reward'}] + } + }, + type: 'campaign' + }, + { + attributes: + { + amount: 0, + amount_cents: 0, + created_at: null, + description: 'Everyone', + remaining: 0, + requires_shipping: false, + type: 'reward', + url: null, + user_limit: null + }, + id: '-1', + relationships: + { + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 1, + amount_cents: 1, + created_at: null, + description: 'Patrons Only', + remaining: 0, + requires_shipping: false, + type: 'reward', + url: null, + user_limit: null + }, + id: '0', + relationships: + { + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 100, + amount_cents: 100, + created_at: '2017-02-15T19:54:50.018468+00:00', + deleted_at: null, + description: 'Get a patron-only perspective.', + discord_role_ids: null, + edited_at: '2017-07-10T18:21:45.322160+00:00', + image_url: 'https://s3-us-west-1.amazonaws.com/patreon-reward-images/1408001.png', + post_count: 19, + published: true, + published_at: '2017-03-31T21:20:19.342290+00:00', + remaining: null, + requires_shipping: true, + title: 'Behind The Scenes', + unpublished_at: null, + url: '/bePatron?c=70261&rid=1408001' + }, + id: '1408001', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + }, + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 100, + amount_cents: 100, + created_at: '2016-11-21T22:31:11+00:00', + deleted_at: null, + description: 'I am so honored that you should choose to support a simple corgi in pursuit of a simple dream. Thanks so much for starting on this journey with me....
\n
\n', + discord_role_ids: null, + edited_at: '2016-12-16T01:51:55.780220+00:00', + image_url: null, + post_count: 19, + published: true, + published_at: '2016-12-05T20:30:07+00:00', + remaining: null, + requires_shipping: false, + title: 'Some patrons here', + unpublished_at: null, + url: '/bePatron?c=70261&rid=563244' + }, + id: '563244', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + }, + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 100, + amount_cents: 100, + created_at: '2017-02-08T18:06:45.708277+00:00', + deleted_at: null, + description: 'Google handgout and lets chat about our next episode', + discord_role_ids: null, + edited_at: '2017-02-15T18:44:00.986474+00:00', + image_url: null, + post_count: 19, + published: true, + published_at: '2017-02-08T18:06:45.708277+00:00', + remaining: 14, + requires_shipping: true, + title: 'Help me write my next podcast', + unpublished_at: null, + url: '/bePatron?c=70261&rid=1385705' + }, + id: '1385705', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + }, + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 1000, + amount_cents: 1000, + created_at: '2016-11-21T22:31:11+00:00', + deleted_at: null, + description: '', + discord_role_ids: null, + edited_at: '2016-12-21T01:00:17.568499+00:00', + image_url: null, + post_count: null, + published: true, + published_at: '2016-12-06T23:45:22.215498+00:00', + remaining: 1, + requires_shipping: true, + title: 'NEW', + unpublished_at: null, + url: '/bePatron?c=70261&rid=1062816' + }, + id: '1062816', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + }, + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + amount: 2000, + amount_cents: 2000, + created_at: '2017-02-08T18:08:46.129090+00:00', + deleted_at: null, + description: 'Learn more about how I play.', + discord_role_ids: null, + edited_at: '2017-06-09T18:56:19.725597+00:00', + image_url: 'https://s3-us-west-1.amazonaws.com/patreon-reward-images/recommendations/G_Strategy_videos.png', + post_count: 6, + published: true, + published_at: '2017-06-09T18:56:19.719411+00:00', + remaining: null, + requires_shipping: false, + title: 'vidjastrats', + unpublished_at: null, + url: '/bePatron?c=70261&rid=1385731' + }, + id: '1385731', + relationships: + { + campaign: + { + data: {id: '70261', type: 'campaign'}, + links: {related: 'https://www.patreon.com/api/campaigns/70261'} + }, + creator: + { + data: {id: '32187', type: 'user'}, + links: {related: 'https://www.patreon.com/api/user/32187'} + } + }, + type: 'reward' + }, + { + attributes: + { + completed_percentage: 2, + created_at: '2016-06-01T20:14:10+00:00', + description: 'Get senpai to notice me...', + reached_at: null, + title: '' + }, + id: '443028', + type: 'goal' + }, + { + attributes: + { + completed_percentage: 1, + created_at: '2016-06-01T20:15:20+00:00', + description: 'Two senpais.', + reached_at: null, + title: '' + }, + id: '443029', + type: 'goal' + }, + { + attributes: + { + completed_percentage: 1, + created_at: '2016-06-01T21:20:27+00:00', + description: 'I will be able to hire a coach to help my overcome the highly unjust vault box. This coach will have a special focus on helping vertically challenged dogs jump very remarkable heights. Sometimes olympic heights.', + reached_at: null, + title: '' + }, + id: '443100', + type: 'goal' + }], + links: {self: 'https://www.patreon.com/api/pledges/1'} +} /* diff --git a/test/travis.js b/test/travis.js index f1ca539..9ef4f14 100644 --- a/test/travis.js +++ b/test/travis.js @@ -70,17 +70,17 @@ const json = { * Test the /POST route */ describe('/POST travis', () => { - it('build', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/travis') - .set("test", "true") - .send(json) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('embeds'); - done(); - }); - }); + it('build', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/travis') + .set("test", "true") + .send(json) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('embeds'); + done(); + }); + }); }); diff --git a/test/trello.js b/test/trello.js index 84c845c..20f7022 100644 --- a/test/trello.js +++ b/test/trello.js @@ -7,8 +7,8 @@ const should = chai.should(); chai.use(chaiHttp); -const commentJSON = { - model: { +const commentJSON = { + model: { id: '594474056f0b649912106a39', name: 'Example Board', desc: '', @@ -18,7 +18,7 @@ const commentJSON = { pinned: false, url: 'https://trello.com/b/EcmJGI6e/example-board', shortUrl: 'https://trello.com/b/EcmJGI6e', - prefs: { + prefs: { permissionLevel: 'org', voting: 'members', comments: 'members', @@ -36,7 +36,7 @@ const commentJSON = { canBePublic: true, canBeOrg: true, canBePrivate: true, - canInvite: true + canInvite: true }, labelNames: { green: '', @@ -48,7 +48,7 @@ const commentJSON = { sky: '', lime: '', pink: '', - black: '' + black: '' } }, action: { @@ -79,11 +79,11 @@ const commentJSON = { avatarHash: '1a36134efab762cad3aadd250440b715', fullName: 'Daniel Scalzi', initials: 'DS', - username: 'danielscalzi' + username: 'danielscalzi' }, - display: { + display: { translationKey: 'action_comment_on_card', - entities: { + entities: { contextOn: { type: 'translatable', translationKey: 'action_on', @@ -107,7 +107,7 @@ const commentJSON = { username: 'danielscalzi', text: 'Daniel Scalzi' } - } + } } } }; @@ -116,17 +116,17 @@ const commentJSON = { * Test the /POST route */ describe('/POST trello', () => { - it('commentCard', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/trello') - .set('test', 'true') - .send(commentJSON) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('embeds'); - done(); - }); - }); + it('commentCard', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/trello') + .set('test', 'true') + .send(commentJSON) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('embeds'); + done(); + }); + }); }); \ No newline at end of file diff --git a/test/unity.js b/test/unity.js index 11efb24..5e69875 100644 --- a/test/unity.js +++ b/test/unity.js @@ -44,17 +44,17 @@ const json = { * Test the /POST route */ describe('/POST unity', () => { - it('build', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/unity') - .set("test", "true") - .send(json) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('username'); - done(); - }); - }); + it('build', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/unity') + .set("test", "true") + .send(json) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('username'); + done(); + }); + }); }); diff --git a/test/vsts.js b/test/vsts.js index e6a1e82..900697e 100644 --- a/test/vsts.js +++ b/test/vsts.js @@ -8,98 +8,98 @@ const should = chai.should(); chai.use(chaiHttp); const json = { - "id": "03c164c2-8912-4d5e-8009-3707d5f83734", - "eventType": "git.push", - "publisherId": "tfs", - "scope": "all", - "message": { - "text": "Jamal Hartnett pushed updates to branch master of repository Fabrikam-Fiber-Git.", - "html": "Jamal Hartnett pushed updates to branch master of repository Fabrikam-Fiber-Git.", - "markdown": "Jamal Hartnett pushed updates to branch `master` of repository `Fabrikam-Fiber-Git`." - }, - "detailedMessage": { - "text": "Jamal Hartnett pushed 1 commit to branch master of repository Fabrikam-Fiber-Git.\n - Fixed bug in web.config file 33b55f7c", - "html": "Jamal Hartnett pushed 1 commit to branch master of repository Fabrikam-Fiber-Git.\n", - "markdown": "Jamal Hartnett pushed 1 commit to branch [master](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/#version=GBmaster) of repository [Fabrikam-Fiber-Git](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/).\n* Fixed bug in web.config file [33b55f7c](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/commit/33b55f7cb7e7e245323987634f960cf4a6e6bc74)" - }, - "resource": { - "commits": [ - { - "commitId": "33b55f7cb7e7e245323987634f960cf4a6e6bc74", - "author": { - "name": "Jamal Hartnett", - "email": "fabrikamfiber4@hotmail.com", - "date": "2015-02-25T19:01:00Z" - }, - "committer": { - "name": "Jamal Hartnett", - "email": "fabrikamfiber4@hotmail.com", - "date": "2015-02-25T19:01:00Z" - }, - "comment": "Fixed bug in web.config file", - "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/commit/33b55f7cb7e7e245323987634f960cf4a6e6bc74" - } - ], - "refUpdates": [ - { - "name": "refs/heads/master", - "oldObjectId": "aad331d8d3b131fa9ae03cf5e53965b51942618a", - "newObjectId": "33b55f7cb7e7e245323987634f960cf4a6e6bc74" - } - ], - "repository": { - "id": "278d5cd2-584d-4b63-824a-2ba458937249", - "name": "Fabrikam-Fiber-Git", - "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249", - "project": { - "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", - "name": "Fabrikam-Fiber-Git", - "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", - "state": "wellFormed" - }, - "defaultBranch": "refs/heads/master", - "remoteUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git" - }, - "pushedBy": { - "id": "00067FFED5C7AF52@Live.com", - "displayName": "Jamal Hartnett", - "uniqueName": "Windows Live ID\\fabrikamfiber4@hotmail.com" - }, - "pushId": 14, - "date": "2014-05-02T19:17:13.3309587Z", - "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/14" - }, - "resourceVersion": "1.0", - "resourceContainers": { - "collection": { - "id": "c12d0eb8-e382-443b-9f9c-c52cba5014c2" - }, - "account": { - "id": "f844ec47-a9db-4511-8281-8b63f4eaf94e" - }, - "project": { - "id": "be9b3917-87e6-42a4-a549-2bc06a7a878f" - } - }, - "createdDate": "2016-09-19T13:03:27.0379153Z" + "id": "03c164c2-8912-4d5e-8009-3707d5f83734", + "eventType": "git.push", + "publisherId": "tfs", + "scope": "all", + "message": { + "text": "Jamal Hartnett pushed updates to branch master of repository Fabrikam-Fiber-Git.", + "html": "Jamal Hartnett pushed updates to branch master of repository Fabrikam-Fiber-Git.", + "markdown": "Jamal Hartnett pushed updates to branch `master` of repository `Fabrikam-Fiber-Git`." + }, + "detailedMessage": { + "text": "Jamal Hartnett pushed 1 commit to branch master of repository Fabrikam-Fiber-Git.\n - Fixed bug in web.config file 33b55f7c", + "html": "Jamal Hartnett pushed 1 commit to branch master of repository Fabrikam-Fiber-Git.\n", + "markdown": "Jamal Hartnett pushed 1 commit to branch [master](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/#version=GBmaster) of repository [Fabrikam-Fiber-Git](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/).\n* Fixed bug in web.config file [33b55f7c](https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/commit/33b55f7cb7e7e245323987634f960cf4a6e6bc74)" + }, + "resource": { + "commits": [ + { + "commitId": "33b55f7cb7e7e245323987634f960cf4a6e6bc74", + "author": { + "name": "Jamal Hartnett", + "email": "fabrikamfiber4@hotmail.com", + "date": "2015-02-25T19:01:00Z" + }, + "committer": { + "name": "Jamal Hartnett", + "email": "fabrikamfiber4@hotmail.com", + "date": "2015-02-25T19:01:00Z" + }, + "comment": "Fixed bug in web.config file", + "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git/commit/33b55f7cb7e7e245323987634f960cf4a6e6bc74" + } + ], + "refUpdates": [ + { + "name": "refs/heads/master", + "oldObjectId": "aad331d8d3b131fa9ae03cf5e53965b51942618a", + "newObjectId": "33b55f7cb7e7e245323987634f960cf4a6e6bc74" + } + ], + "repository": { + "id": "278d5cd2-584d-4b63-824a-2ba458937249", + "name": "Fabrikam-Fiber-Git", + "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249", + "project": { + "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", + "name": "Fabrikam-Fiber-Git", + "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", + "state": "wellFormed" + }, + "defaultBranch": "refs/heads/master", + "remoteUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_git/Fabrikam-Fiber-Git" + }, + "pushedBy": { + "id": "00067FFED5C7AF52@Live.com", + "displayName": "Jamal Hartnett", + "uniqueName": "Windows Live ID\\fabrikamfiber4@hotmail.com" + }, + "pushId": 14, + "date": "2014-05-02T19:17:13.3309587Z", + "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/14" + }, + "resourceVersion": "1.0", + "resourceContainers": { + "collection": { + "id": "c12d0eb8-e382-443b-9f9c-c52cba5014c2" + }, + "account": { + "id": "f844ec47-a9db-4511-8281-8b63f4eaf94e" + }, + "project": { + "id": "be9b3917-87e6-42a4-a549-2bc06a7a878f" + } + }, + "createdDate": "2016-09-19T13:03:27.0379153Z" } /* * Test the /POST route */ describe('/POST vsts', () => { - it('git.push', (done) => { - chai.request(server) - .post('/api/webhooks/test/test/vsts') - .set("eventType", "git.push") - .set("test", "true") - .send(json) - .end((err, res) => { - res.should.have.status(200); - console.log(res.body); - res.body.should.be.a('object'); - res.body.should.have.property('embeds'); - done(); - }); - }); + it('git.push', (done) => { + chai.request(server) + .post('/api/webhooks/test/test/vsts') + .set("eventType", "git.push") + .set("test", "true") + .send(json) + .end((err, res) => { + res.should.have.status(200); + console.log(res.body); + res.body.should.be.a('object'); + res.body.should.have.property('embeds'); + done(); + }); + }); }); \ No newline at end of file diff --git a/util/BaseProvider.js b/util/BaseProvider.js index 34e5767..fa9f4bb 100644 --- a/util/BaseProvider.js +++ b/util/BaseProvider.js @@ -6,24 +6,24 @@ class BaseProvider { this.payload = new DiscordPayload(); } - async parse(req){ + async parse(req) { this.req = req; this.body = req.body; let type = 'parseData'; - if(typeof this['getType'] !== 'undefined'){ + if (typeof this['getType'] !== 'undefined') { type = await this['getType'](); } type = BaseProvider.formatType(type); - if(typeof this[type] !== 'undefined'){ + if (typeof this[type] !== 'undefined') { await this[type](); } return this.payload.getData(); } - static formatType(type){ + static formatType(type) { type = type.replace(/:/, '_'); // needed because of BitBucket return camel(type); } diff --git a/views/index.ejs b/views/index.ejs index 1acb502..4d4e511 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,84 +1,85 @@ - - - - skyhook - - - - - - -
-
-
- skyhook -
-
-
-
+ + + + skyhook + + + + + + +
+
+
+ skyhook +
+
+
+
- + -
-

- Skyhook parses webhooks and forwards them in the proper format to Discord. -

-

- In order to have skyhook parse your webhooks properly, you must generate a webhook URL. Once you have the - URL generated, - you can pass it along to the provider you selected. -

-
-
-
- - -
-
+
+

+ Skyhook parses webhooks and forwards them in the proper format to Discord. +

+

+ In order to have skyhook parse your webhooks properly, you must generate a webhook URL. Once you have the + URL generated, + you can pass it along to the provider you selected. +

+
+
+
+ + +
+
-

Provider

-
- <% providers.forEach(function (c, i){ %> -
-
- -
-
-
-
-
- +

Provider

+
+ <% providers.forEach(function (c, i){ %> +
+
+ +
+
+
- <% }) %> -
-
-
+ <% }) %> +
+
+ + Generate + - +
- - - - + + + +
+ + + +