Merge branch 'feature/audit-logs' of github.com:Budibase/budibase into feature/audit-logs
This commit is contained in:
commit
dd164e92ab
|
@ -0,0 +1,36 @@
|
||||||
|
import { Event, AuditedEventFriendlyName } from "../../../sdk"
|
||||||
|
import { PaginationResponse, PaginationRequest } from "../"
|
||||||
|
|
||||||
|
export interface DownloadAuditLogsRequest {
|
||||||
|
userId?: string[]
|
||||||
|
appId?: string[]
|
||||||
|
event?: Event[]
|
||||||
|
startDate?: string
|
||||||
|
endDate?: string
|
||||||
|
metadataSearch?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SearchAuditLogsRequest
|
||||||
|
extends PaginationRequest,
|
||||||
|
DownloadAuditLogsRequest {}
|
||||||
|
|
||||||
|
export interface SearchAuditLogsResponse extends PaginationResponse {
|
||||||
|
data: {
|
||||||
|
app: {
|
||||||
|
_id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
user: {
|
||||||
|
_id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
event: Event
|
||||||
|
timestamp: string
|
||||||
|
name: string
|
||||||
|
metadata: any
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DefinitionsAuditLogsResponse {
|
||||||
|
events: typeof AuditedEventFriendlyName
|
||||||
|
}
|
|
@ -1,2 +1,3 @@
|
||||||
export * from "./environmentVariables"
|
export * from "./environmentVariables"
|
||||||
|
export * from "./auditLogs"
|
||||||
export * from "./events"
|
export * from "./events"
|
||||||
|
|
|
@ -4,3 +4,4 @@ export * from "./errors"
|
||||||
export * from "./schedule"
|
export * from "./schedule"
|
||||||
export * from "./app"
|
export * from "./app"
|
||||||
export * from "./global"
|
export * from "./global"
|
||||||
|
export * from "./pagination"
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
export enum SortOrder {
|
||||||
|
ASCENDING = "ascending",
|
||||||
|
DESCENDING = "descending",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SortType {
|
||||||
|
STRING = "string",
|
||||||
|
number = "number",
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationRequest {
|
||||||
|
limit?: number
|
||||||
|
bookmark?: string
|
||||||
|
sort?: {
|
||||||
|
order: SortOrder
|
||||||
|
column: string
|
||||||
|
type: SortType
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationResponse {
|
||||||
|
bookmark: string
|
||||||
|
hasNextPage: boolean
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Document } from "../document"
|
||||||
|
import { Event } from "../../sdk"
|
||||||
|
|
||||||
|
export interface AuditLogDocument extends Document {
|
||||||
|
appId: string
|
||||||
|
event: Event
|
||||||
|
userId: string
|
||||||
|
timestamp: string
|
||||||
|
metadata: any
|
||||||
|
name: string
|
||||||
|
}
|
|
@ -182,6 +182,10 @@ export enum Event {
|
||||||
ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = "environment_variable:upgrade_panel_opened",
|
ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = "environment_variable:upgrade_panel_opened",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const AuditedEventFriendlyName = {
|
||||||
|
[Event.USER_CREATED]: "user created",
|
||||||
|
}
|
||||||
|
|
||||||
// properties added at the final stage of the event pipeline
|
// properties added at the final stage of the event pipeline
|
||||||
export interface BaseEvent {
|
export interface BaseEvent {
|
||||||
version?: string
|
version?: string
|
||||||
|
|
Loading…
Reference in New Issue