forked from oddbit/firebase-alerts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webhook.ts
38 lines (34 loc) · 845 Bytes
/
webhook.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {AppInfo} from "./app-info";
import {AppCrash} from "./app-crash";
import {Localization} from "../utils/localization";
export interface IWebhook {
url: string;
language?: string;
}
/**
* Declares Webhook class
*/
export abstract class Webhook implements IWebhook {
/**
* Constructor
*
* @param {IWebhook} webhook Webhook data
*/
constructor(webhook: IWebhook) {
this.url = webhook.url;
this.language = Localization.defaultLanguage;
}
public readonly url: string;
public readonly language: string;
/**
* Create message payload for the webhook to send a crashlytics message
*
* @param {AppInfo} appInfo
* @param {AppCrash} appCrash
* @return {object} Webhook body payload
*/
public abstract createCrashlyticsMessage(
appInfo: AppInfo,
appCrash: AppCrash,
): object;
}