Adding IDs to backup events.

This commit is contained in:
mike12345567 2022-11-21 12:12:57 +00:00
parent 12a9ed6dcb
commit 3c93101fdb
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { publishEvent } from "../events"
export async function appBackupRestored(backup: AppBackup) { export async function appBackupRestored(backup: AppBackup) {
const properties: AppBackupRestoreEvent = { const properties: AppBackupRestoreEvent = {
appId: backup.appId, appId: backup.appId,
restoreId: backup._id!,
backupCreatedAt: backup.timestamp, backupCreatedAt: backup.timestamp,
} }
@ -19,11 +20,13 @@ export async function appBackupRestored(backup: AppBackup) {
export async function appBackupTriggered( export async function appBackupTriggered(
appId: string, appId: string,
backupId: string,
type: AppBackupType, type: AppBackupType,
trigger: AppBackupTrigger trigger: AppBackupTrigger
) { ) {
const properties: AppBackupTriggeredEvent = { const properties: AppBackupTriggeredEvent = {
appId: appId, appId: appId,
backupId,
type, type,
trigger, trigger,
} }

View File

@ -3,10 +3,12 @@ import { AppBackupTrigger, AppBackupType } from "../../documents"
export interface AppBackupRestoreEvent extends BaseEvent { export interface AppBackupRestoreEvent extends BaseEvent {
appId: string appId: string
restoreId: string
backupCreatedAt: string backupCreatedAt: string
} }
export interface AppBackupTriggeredEvent extends BaseEvent { export interface AppBackupTriggeredEvent extends BaseEvent {
backupId: string
appId: string appId: string
trigger: AppBackupTrigger trigger: AppBackupTrigger
type: AppBackupType type: AppBackupType