Some updates to core types - used in pro update.

This commit is contained in:
mike12345567 2023-03-02 10:20:49 +00:00
parent 6c62d0b214
commit 2335932978
3 changed files with 17 additions and 4 deletions

View File

@ -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
}
/**

View File

@ -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

View File

@ -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
}