PR comments.

This commit is contained in:
Michael Drury 2022-11-17 19:38:47 +00:00
parent 575a64d32a
commit 027eda2231
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import {
AppBackup,
AppBackupRestoreEvent,
AppBackupTriggeredEvent,
AppBackupTrigger,
Event,
} from "@budibase/types"
import { publishEvent } from "../events"
@ -16,11 +17,15 @@ export async function appBackupRestored(backup: AppBackup) {
await publishEvent(Event.APP_BACKUP_RESTORED, properties)
}
export async function appBackupTriggered(appId: string, name?: string) {
export async function appBackupTriggered(
appId: string,
trigger: AppBackupTrigger,
name?: string
) {
const properties: AppBackupTriggeredEvent = {
appId: appId,
backupName: name,
backupCreatedAt: new Date().toISOString(),
trigger,
}
await publishEvent(Event.APP_BACKUP_TRIGGERED, properties)
}

View File

@ -1,4 +1,5 @@
import { BaseEvent } from "./event"
import { AppBackupTrigger } from "../../documents/app"
export interface AppBackupRestoreEvent extends BaseEvent {
appId: string
@ -8,6 +9,6 @@ export interface AppBackupRestoreEvent extends BaseEvent {
export interface AppBackupTriggeredEvent extends BaseEvent {
appId: string
trigger: AppBackupTrigger
backupName?: string
backupCreatedAt: string
}