Some updates to core types - used in pro update.
This commit is contained in:
parent
6c62d0b214
commit
2335932978
|
@ -1,6 +1,6 @@
|
||||||
import { getAppClient } from "../redis/init"
|
import { getAppClient } from "../redis/init"
|
||||||
import { doWithDB, DocumentType } from "../db"
|
import { doWithDB, DocumentType } from "../db"
|
||||||
import { Database } from "@budibase/types"
|
import { Database, App } from "@budibase/types"
|
||||||
|
|
||||||
const AppState = {
|
const AppState = {
|
||||||
INVALID: "invalid",
|
INVALID: "invalid",
|
||||||
|
@ -65,7 +65,7 @@ export async function getAppMetadata(appId: string) {
|
||||||
if (isInvalid(metadata)) {
|
if (isInvalid(metadata)) {
|
||||||
throw { status: 404, message: "No app metadata found" }
|
throw { status: 404, message: "No app metadata found" }
|
||||||
}
|
}
|
||||||
return metadata
|
return metadata as App
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,9 +26,16 @@ export enum AuditLogResourceStatus {
|
||||||
DELETED = "deleted",
|
DELETED = "deleted",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type DeletedResourceInfo = {
|
||||||
|
_id: string
|
||||||
|
status: AuditLogResourceStatus
|
||||||
|
email?: string
|
||||||
|
name?: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface AuditLogEnriched {
|
export interface AuditLogEnriched {
|
||||||
app?: App | { _id: string; status: AuditLogResourceStatus }
|
app?: App | DeletedResourceInfo
|
||||||
user: User | { _id: string; status: AuditLogResourceStatus }
|
user: User | DeletedResourceInfo
|
||||||
event: Event
|
event: Event
|
||||||
timestamp: string
|
timestamp: string
|
||||||
name: string
|
name: string
|
||||||
|
|
|
@ -3,6 +3,11 @@ import { Event } from "../../sdk"
|
||||||
|
|
||||||
export const AuditLogSystemUser = "SYSTEM"
|
export const AuditLogSystemUser = "SYSTEM"
|
||||||
|
|
||||||
|
export type FallbackInfo = {
|
||||||
|
appName?: string
|
||||||
|
email?: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface AuditLogDoc extends Document {
|
export interface AuditLogDoc extends Document {
|
||||||
appId?: string
|
appId?: string
|
||||||
event: Event
|
event: Event
|
||||||
|
@ -10,4 +15,5 @@ export interface AuditLogDoc extends Document {
|
||||||
timestamp: string
|
timestamp: string
|
||||||
metadata: any
|
metadata: any
|
||||||
name: string
|
name: string
|
||||||
|
fallback?: FallbackInfo
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue