PR comments.
This commit is contained in:
parent
24d5d2a22c
commit
3aa5c25da9
2 changed files with 9 additions and 3 deletions
|
@ -2,6 +2,7 @@ import {
|
||||||
AppBackup,
|
AppBackup,
|
||||||
AppBackupRestoreEvent,
|
AppBackupRestoreEvent,
|
||||||
AppBackupTriggeredEvent,
|
AppBackupTriggeredEvent,
|
||||||
|
AppBackupTrigger,
|
||||||
Event,
|
Event,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { publishEvent } from "../events"
|
import { publishEvent } from "../events"
|
||||||
|
@ -16,11 +17,15 @@ export async function appBackupRestored(backup: AppBackup) {
|
||||||
await publishEvent(Event.APP_BACKUP_RESTORED, properties)
|
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 = {
|
const properties: AppBackupTriggeredEvent = {
|
||||||
appId: appId,
|
appId: appId,
|
||||||
backupName: name,
|
backupName: name,
|
||||||
backupCreatedAt: new Date().toISOString(),
|
trigger,
|
||||||
}
|
}
|
||||||
await publishEvent(Event.APP_BACKUP_TRIGGERED, properties)
|
await publishEvent(Event.APP_BACKUP_TRIGGERED, properties)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { BaseEvent } from "./event"
|
import { BaseEvent } from "./event"
|
||||||
|
import { AppBackupTrigger } from "../../documents/app"
|
||||||
|
|
||||||
export interface AppBackupRestoreEvent extends BaseEvent {
|
export interface AppBackupRestoreEvent extends BaseEvent {
|
||||||
appId: string
|
appId: string
|
||||||
|
@ -8,6 +9,6 @@ export interface AppBackupRestoreEvent extends BaseEvent {
|
||||||
|
|
||||||
export interface AppBackupTriggeredEvent extends BaseEvent {
|
export interface AppBackupTriggeredEvent extends BaseEvent {
|
||||||
appId: string
|
appId: string
|
||||||
|
trigger: AppBackupTrigger
|
||||||
backupName?: string
|
backupName?: string
|
||||||
backupCreatedAt: string
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue