PR comments.
This commit is contained in:
parent
24d5d2a22c
commit
3aa5c25da9
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue