1
0
Fork 0
mirror of synced 2024-10-05 20:44:47 +13:00

initial commit of API design session outcomes.

This commit is contained in:
mike12345567 2023-02-07 15:32:59 +00:00
parent cdc2159af6
commit 73c99910b1
6 changed files with 77 additions and 0 deletions

View file

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

View file

@ -1,2 +1,3 @@
export * from "./environmentVariables"
export * from "./auditLogs"
export * from "./events"

View file

@ -4,3 +4,4 @@ export * from "./errors"
export * from "./schedule"
export * from "./app"
export * from "./global"
export * from "./pagination"

View file

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

View file

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

View file

@ -182,6 +182,10 @@ export enum Event {
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
export interface BaseEvent {
version?: string