Adding type to triggered.
This commit is contained in:
parent
027eda2231
commit
33827af592
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue