Adding in required events for app backup system.
This commit is contained in:
parent
11115aab56
commit
bb4e3ba8cf
|
@ -0,0 +1,12 @@
|
|||
import { AppBackup, AppBackupRevertEvent, Event } from "@budibase/types"
|
||||
import { publishEvent } from "../events"
|
||||
|
||||
export async function appBackupRestored(backup: AppBackup) {
|
||||
const properties: AppBackupRevertEvent = {
|
||||
appId: backup.appId,
|
||||
backupName: backup.name,
|
||||
backupCreatedAt: backup.createdAt,
|
||||
}
|
||||
|
||||
await publishEvent(Event.APP_BACKUP_RESTORED, properties)
|
||||
}
|
|
@ -19,3 +19,4 @@ export * as installation from "./installation"
|
|||
export * as backfill from "./backfill"
|
||||
export * as group from "./group"
|
||||
export * as plugin from "./plugin"
|
||||
export * as backup from "./backup"
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import { BaseEvent } from "./event"
|
||||
|
||||
export interface AppBackupRevertEvent extends BaseEvent {
|
||||
appId: string
|
||||
backupName: string
|
||||
backupCreatedAt: string
|
||||
}
|
|
@ -168,6 +168,9 @@ export enum Event {
|
|||
PLUGIN_INIT = "plugin:init",
|
||||
PLUGIN_IMPORTED = "plugin:imported",
|
||||
PLUGIN_DELETED = "plugin:deleted",
|
||||
|
||||
// BACKUP
|
||||
APP_BACKUP_RESTORED = "app:backup:restored",
|
||||
}
|
||||
|
||||
// properties added at the final stage of the event pipeline
|
||||
|
|
|
@ -20,3 +20,4 @@ export * from "./backfill"
|
|||
export * from "./identification"
|
||||
export * from "./userGroup"
|
||||
export * from "./plugin"
|
||||
export * from "./backup"
|
||||
|
|
Loading…
Reference in New Issue