1 | ;
|
2 | /*
|
3 | * MIT License
|
4 | *
|
5 | * Copyright (c) 2017 Choko (choko@curioswitch.org)
|
6 | *
|
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 | * of this software and associated documentation files (the "Software"), to deal
|
9 | * in the Software without restriction, including without limitation the rights
|
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11 | * copies of the Software, and to permit persons to whom the Software is
|
12 | * furnished to do so, subject to the following conditions:
|
13 | *
|
14 | * The above copyright notice and this permission notice shall be included in all
|
15 | * copies or substantial portions of the Software.
|
16 | *
|
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23 | * SOFTWARE.
|
24 | */
|
25 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
26 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
27 | };
|
28 | var __importStar = (this && this.__importStar) || function (mod) {
|
29 | if (mod && mod.__esModule) return mod;
|
30 | var result = {};
|
31 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
32 | result["default"] = mod;
|
33 | return result;
|
34 | };
|
35 | Object.defineProperty(exports, "__esModule", { value: true });
|
36 | /* eslint-disable import/first */
|
37 | const source_map_support_1 = __importDefault(require("source-map-support"));
|
38 | source_map_support_1.default.install();
|
39 | const HttpStatus = __importStar(require("http-status-codes"));
|
40 | const notifier_1 = __importDefault(require("./notifier"));
|
41 | const webhook_1 = __importDefault(require("./webhook"));
|
42 | function cloudbuildGithubWebhook(req, res) {
|
43 | webhook_1.default(req, res).catch((err) => {
|
44 | console.error('Error handling webhook: ', err);
|
45 | res.status(HttpStatus.INTERNAL_SERVER_ERROR).end();
|
46 | });
|
47 | }
|
48 | exports.cloudbuildGithubWebhook = cloudbuildGithubWebhook;
|
49 | function cloudbuildGithubNotifier(data) {
|
50 | return notifier_1.default(data.data);
|
51 | }
|
52 | exports.cloudbuildGithubNotifier = cloudbuildGithubNotifier;
|
53 | //# sourceMappingURL=index.js.map |
\ | No newline at end of file |