41 lines
777 B
TypeScript
41 lines
777 B
TypeScript
import axios from "axios";
|
|
import type {Account} from "~/auth/Account";
|
|
import {Session} from "~/auth/Session";
|
|
|
|
export class Event
|
|
{
|
|
constructor(
|
|
public type: EventType,
|
|
public timestamp: Date,
|
|
public resource: Resource,
|
|
public account: Account
|
|
)
|
|
{
|
|
}
|
|
|
|
static get(onSuccess: (events: Event[]) => void)
|
|
{
|
|
MavenApi.create().get<Event[]>("/events", {withCredentials: true})
|
|
.then((response) =>
|
|
{
|
|
onSuccess(response.data)
|
|
});
|
|
}
|
|
}
|
|
|
|
export class Resource
|
|
{
|
|
constructor(
|
|
public groupId: string,
|
|
public artifactId: string,
|
|
public version: string
|
|
)
|
|
{
|
|
}
|
|
}
|
|
|
|
export enum EventType
|
|
{
|
|
UPLOAD = "UPLOAD",
|
|
DELETE = "DELETE"
|
|
} |