From 3c5c062c8bf27f5ed93c72871d9d9ddcf4c0c548 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Wed, 31 Jan 2018 11:23:12 +0100 Subject: SONAR-10344 Create the webhooks console page * SONAR-10348 Create the webhooks console page * SONAR-10349 Add webhook console at global admin scope * SONAR-10349 Add webhook console at project scope * SONAR-10349 Add webhook console at organization scope --- server/sonar-web/src/main/js/api/webhooks.ts | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 server/sonar-web/src/main/js/api/webhooks.ts (limited to 'server/sonar-web/src/main/js/api') diff --git a/server/sonar-web/src/main/js/api/webhooks.ts b/server/sonar-web/src/main/js/api/webhooks.ts new file mode 100644 index 00000000000..fa526855e02 --- /dev/null +++ b/server/sonar-web/src/main/js/api/webhooks.ts @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { getJSON } from '../helpers/request'; +import throwGlobalError from '../app/utils/throwGlobalError'; + +export interface Delivery { + id: string; + at: string; + success: boolean; + httpStatus: number; + durationMs: number; +} + +export interface Webhook { + key: string; + name: string; + url: string; + latestDelivery?: Delivery; +} + +export function searchWebhooks(data: { + organization: string | undefined; + project?: string; +}): Promise<{ webhooks: Webhook[] }> { + return getJSON('/api/webhooks/search', data).catch(throwGlobalError); +} -- cgit v1.2.3