Adding type to triggered.

This commit is contained in:
mike12345567 2022-11-17 23:09:49 +00:00
parent 027eda2231
commit 33827af592
2 changed files with 6 additions and 7 deletions

View File

@ -3,6 +3,7 @@ import {
AppBackupRestoreEvent,
AppBackupTriggeredEvent,
AppBackupTrigger,
AppBackupType,
Event,
} from "@budibase/types"
import { publishEvent } from "../events"
@ -10,7 +11,6 @@ import { publishEvent } from "../events"
export async function appBackupRestored(backup: AppBackup) {
const properties: AppBackupRestoreEvent = {
appId: backup.appId,
backupName: backup.name!,
backupCreatedAt: backup.timestamp,
}
@ -19,12 +19,12 @@ export async function appBackupRestored(backup: AppBackup) {
export async function appBackupTriggered(
appId: string,
trigger: AppBackupTrigger,
name?: string
type: AppBackupType,
trigger: AppBackupTrigger
) {
const properties: AppBackupTriggeredEvent = {
appId: appId,
backupName: name,
type,
trigger,
}
await publishEvent(Event.APP_BACKUP_TRIGGERED, properties)

View File

@ -1,14 +1,13 @@
import { BaseEvent } from "./event"
import { AppBackupTrigger } from "../../documents/app"
import { AppBackupTrigger, AppBackupType } from "../../documents"
export interface AppBackupRestoreEvent extends BaseEvent {
appId: string
backupName: string
backupCreatedAt: string
}
export interface AppBackupTriggeredEvent extends BaseEvent {
appId: string
trigger: AppBackupTrigger
backupName?: string
type: AppBackupType
}