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.
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
Name | Type | Description |
---|---|---|
auditEvents | AuditEvents | The 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
Name | Type | Description |
---|---|---|
auditEventType | AuditEventType | AuditEventTypeValues | {} & Record<never, never> | The audit event type. |
doc | Article | The document (article) in question. |
resultsOrId | Result | string | The result or result ID that contains the document. |
parameters | Record<string, string | number | boolean | undefined> | Optional. Additional parameters. |
rfmParameters | Record<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
Name | Type | Description |
---|---|---|
url | string | The URL of the new route. |
Usage Example:
auditService.notifyRouteChange("/new-route");