Skip to main content

Audit Service

Overview

The AuditService class is responsible for notifying the Sinequa server of various audit events such as login, logout, document events, and route changes. Below are the details of each function provided by this service.

note

The AuditService is the same as the AuditService provided by the Sinequa SDK.
This service is used to notify the Sinequa server of various audit events and exists to maintain the compatibility of the Angular application with the Sinequa SDK.

Use the notify() function from the @sinequa/atomic library whenever it's possible.

notify()

Notify the Sinequa server of a set of audit events.

notify(auditEvents: AuditEvents): void
NameTypeDescription
auditEventsAuditEventsThe audit events to notify.

Usage Example:

const auditEvents: AuditEvents = { type: "Custom_Event" };
auditService.notify(auditEvents);

notifyLogin()

It sends a login success audit event to the Audit Service.

notifyLogin(): void

Usage Example:

auditService.notifyLogin();

notifyLogout()

Notify the Sinequa server of a logout event.

notifyLogout(): void

Usage Example:

auditService.notifyLogout();

notifyDocument()

Notify the Sinequa server of a document event.

notifyDocument(
auditEventType: AuditEventType | AuditEventTypeValues | {} & Record<never, never>,
doc: Article,
resultsOrId: Result | string,
parameters?: Record<string, string | number | boolean | undefined>,
rfmParameters?: Record<string, string | number | boolean | undefined>
): void
NameTypeDescription
auditEventTypeAuditEventType | AuditEventTypeValues | {} & Record<never, never>The audit event type.
docArticleThe document (article) in question.
resultsOrIdResult | stringThe result or result ID that contains the document.
parametersRecord<string, string | number | boolean | undefined>Optional. Additional parameters.
rfmParametersRecord<string, string | number | boolean | undefined>Optional. Additional RFM parameters.

Usage Example:

const article: Article = { /* article details */ };
auditService.notifyDocument("Document_View", article, "resultId123", { param1: "value1" });

notifyRouteChange()

Notify the Sinequa server of a route change event.

notifyRouteChange(url: string): void
NameTypeDescription
urlstringThe URL of the new route.

Usage Example:

auditService.notifyRouteChange("/new-route");