diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index d24c4a3140..5b66c356d3 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -1,6 +1,6 @@ import { getAppClient } from "../redis/init" import { doWithDB, DocumentType } from "../db" -import { Database } from "@budibase/types" +import { Database, App } from "@budibase/types" const AppState = { INVALID: "invalid", @@ -65,7 +65,7 @@ export async function getAppMetadata(appId: string) { if (isInvalid(metadata)) { throw { status: 404, message: "No app metadata found" } } - return metadata + return metadata as App } /** diff --git a/packages/types/src/api/web/global/auditLogs.ts b/packages/types/src/api/web/global/auditLogs.ts index 8ce0e742d2..a890f3a751 100644 --- a/packages/types/src/api/web/global/auditLogs.ts +++ b/packages/types/src/api/web/global/auditLogs.ts @@ -26,9 +26,16 @@ export enum AuditLogResourceStatus { DELETED = "deleted", } +export type DeletedResourceInfo = { + _id: string + status: AuditLogResourceStatus + email?: string + name?: string +} + export interface AuditLogEnriched { - app?: App | { _id: string; status: AuditLogResourceStatus } - user: User | { _id: string; status: AuditLogResourceStatus } + app?: App | DeletedResourceInfo + user: User | DeletedResourceInfo event: Event timestamp: string name: string diff --git a/packages/types/src/documents/global/auditLogs.ts b/packages/types/src/documents/global/auditLogs.ts index 7902997b39..091c7b8418 100644 --- a/packages/types/src/documents/global/auditLogs.ts +++ b/packages/types/src/documents/global/auditLogs.ts @@ -3,6 +3,11 @@ import { Event } from "../../sdk" export const AuditLogSystemUser = "SYSTEM" +export type FallbackInfo = { + appName?: string + email?: string +} + export interface AuditLogDoc extends Document { appId?: string event: Event @@ -10,4 +15,5 @@ export interface AuditLogDoc extends Document { timestamp: string metadata: any name: string + fallback?: FallbackInfo }