@retracedhq/retraced
Version:
The official NodeJS client for interacting with the Retraced audit logging API.
49 lines (48 loc) • 1.16 kB
TypeScript
import { NewEventRecord } from "./retraced-js";
export interface EventFields {
[key: string]: string;
}
export interface Target {
id: string;
name?: string;
href?: string;
type?: string;
fields?: EventFields;
}
export interface Actor {
id: string;
name?: string;
href?: string;
fields?: EventFields;
}
export interface Group {
id: string;
name?: string;
}
interface EventCreation {
created?: Date;
}
export type CRUD = "c" | "r" | "u" | "d";
export interface EventInternal {
action: string;
group?: Group;
crud?: CRUD;
actor?: Actor;
target?: Target;
source_ip?: string;
description?: string;
is_failure?: boolean;
is_anonymous?: boolean;
fields?: EventFields;
external_id?: string;
metadata?: EventFields;
}
export interface Event extends EventCreation, EventInternal {
}
export declare function verifyHash(event: Event, newEvent: NewEventRecord): string;
export declare function computeHash(event: Event, id: string): {
hashResult: string;
hashTarget: string;
};
export declare function buildHashTarget(event: Event, id: string): string;
export {};