2026-05-03 19:30:07 +02:00

43 lines
895 B
TypeScript

import axios from "axios";
import type {Account} from "~/auth/Account";
import {Session} from "~/auth/Session";
import {type EnhancedResponse, User, useUserStore} from "~/components/users/UserStore";
export class Event
{
constructor(
public type: EventType,
public timestamp: Date,
public resource: Resource,
public user: User
)
{
}
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,
public isSnapshot: boolean
)
{
}
}
export enum EventType
{
UPLOAD = "UPLOAD",
DELETE = "DELETE"
}