UNPKG

@retracedhq/retraced

Version:

The official NodeJS client for interacting with the Retraced audit logging API.

183 lines (182 loc) 4.25 kB
export interface GraphQLSearchData { data: { search: { totalCount: number; pageInfo: { hasPreviousPage: boolean; }; edges: { cursor: string; node: RawEventNode; }[]; }; }; } export declare class EventsConnection { private readonly url; private readonly authorization; private readonly query; private readonly mask; readonly pageSize: number; totalCount: number; currentPageNumber: number; currentResults: EventNode[]; private cursors; constructor(url: string, authorization: string, query: StructuredQuery, mask: EventNodeMask, pageSize: number); totalPages(): number; hasPreviousPage(): boolean; hasNextPage(): boolean; init(): Promise<void>; nextPage(): Promise<void>; private call; } export interface StructuredQuery { action?: string; crud?: string; received_start?: Date; received_end?: Date; created_start?: Date; created_end?: Date; actor_name?: string; actor_id?: string; description?: string; location?: string; external_id?: string; } export interface EventNodeMask { id?: boolean; action?: boolean; description?: boolean; group?: { id?: boolean; name?: boolean; }; actor?: { id?: boolean; name?: boolean; href?: boolean; fields?: boolean; }; target?: { id?: boolean; name?: boolean; href?: boolean; type?: boolean; fields?: boolean; }; crud?: boolean; display?: { markdown?: boolean; }; is_failure?: boolean; is_anonymous?: boolean; source_ip?: boolean; country?: boolean; loc_subdiv1?: boolean; loc_subdiv2?: boolean; received?: boolean; created?: boolean; canonical_time?: boolean; component?: boolean; version?: boolean; fields?: boolean; external_id?: boolean; metadata?: boolean; } export interface FieldItem { key: string; value: string; } export interface EventNodeGroup { id?: string; name?: string; } export interface EventNodeActor { id?: string; name?: string; href?: string; fields?: FieldItem[]; } export interface EventNodeTarget { id?: string; name?: string; href?: string; type?: string; fields?: FieldItem[]; } export interface EventNodeDisplay { markdown?: string; } export interface RawEventNode { id?: string; action?: string; crud?: "c" | "r" | "u" | "d"; description?: string; group?: EventNodeGroup; actor?: EventNodeActor; target?: EventNodeTarget; display?: EventNodeDisplay; is_failure?: boolean; is_anonymous?: boolean; source_ip?: string; country?: string; loc_subdiv1?: string; loc_subdiv2?: string; received?: string; created?: string; fields?: FieldItem[]; canonical_time?: string; component?: string; version?: string; external_id?: string; metadata?: FieldItem[]; } export interface EventNode { id?: string; action?: string; description?: string; group?: { id?: string; name?: string; }; actor?: { id?: string; name?: string; href?: string; fields?: { [key: string]: string; }; }; target?: { id?: string; name?: string; href?: string; type?: string; fields?: { [key: string]: string; }; }; crud?: "c" | "r" | "u" | "d"; display?: { markdown?: string; }; is_failure?: boolean; is_anonymous?: boolean; source_ip?: string; country?: string; received?: Date; created?: Date; fields?: { [key: string]: string; }; canonical_time?: Date; component?: string; version?: string; external_id?: string; metadata?: { [key: string]: string; }; } export declare const formatRawEventNode: (node: RawEventNode) => EventNode; export declare const graphQLQuery: (mask: EventNodeMask) => string; export declare const stringifyStructuredQuery: (queryObj: StructuredQuery) => string;