1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00
budibase/packages/backend-core/src/events/publishers/installation.ts

32 lines
859 B
TypeScript

import { publishEvent } from "../events"
import { Event, VersionCheckedEvent, VersionChangeEvent } from "@budibase/types"
export async function versionChecked(version: string) {
const properties: VersionCheckedEvent = {
currentVersion: version,
}
await publishEvent(Event.INSTALLATION_VERSION_CHECKED, properties)
}
export async function upgraded(from: string, to: string) {
const properties: VersionChangeEvent = {
from,
to,
}
await publishEvent(Event.INSTALLATION_VERSION_UPGRADED, properties)
}
export async function downgraded(from: string, to: string) {
const properties: VersionChangeEvent = {
from,
to,
}
await publishEvent(Event.INSTALLATION_VERSION_DOWNGRADED, properties)
}
export async function firstStartup() {
const properties = {}
await publishEvent(Event.INSTALLATION_FIRST_STARTUP, properties)
}