expressions: set exception as message field

This commit is contained in:
Jens Langhammer
2021-01-14 21:58:10 +01:00
parent 1c686e19b5
commit 7f5caf901d
6 changed files with 52 additions and 36 deletions

View File

@ -1,25 +1,24 @@
import { DefaultClient, QueryArguments, PBResponse } from "./Client";
import { Event } from "./Events";
export class Notification {
pk: string;
name: string;
mode: string;
mode_verbose: string;
webhook_url: string;
severity: string;
body: string;
created: string;
event?: Event;
seen: boolean;
constructor() {
throw Error();
}
static get(pk: string): Promise<Transport> {
return DefaultClient.fetch<Transport>(["events", "transports", pk]);
static get(pk: string): Promise<Notification> {
return DefaultClient.fetch<Notification>(["events", "notifications", pk]);
}
static list(filter?: QueryArguments): Promise<PBResponse<Transport>> {
return DefaultClient.fetch<PBResponse<Transport>>(["events", "transports"], filter);
static list(filter?: QueryArguments): Promise<PBResponse<Notification>> {
return DefaultClient.fetch<PBResponse<Notification>>(["events", "notifications"], filter);
}
static adminUrl(rest: string): string {
return `/administration/events/transports/${rest}`;
}
}