UNPKG

@c8y/client

Version:

Client application programming interface to access the Cumulocity IoT-Platform REST services.

72 lines 2.18 kB
import { Service, IResult, IResultList } from '../core/index.js'; import { IAuditRecord } from './IAuditRecord.js'; export declare class AuditService extends Service<IAuditRecord> { protected baseUrl: string; protected listUrl: string; protected propertyName: string; /** * Gets the details of selected audit record. * * @param {string|number|IAuditRecord} entityOrId Entity or Id of the entity. * * @returns Response wrapped in [[IResult]] * * **Example** * ```typescript * * const auditId: number = 1; * * (async () => { * const {data, res} = await auditService.detail(auditId); * })(); * ``` */ detail(entityOrId: string | number | IAuditRecord): Promise<IResult<IAuditRecord>>; /** * Creates a new audit record for a given source. * * @param {IAuditRecord} entity Audit record object with mandantory fragments. * IAuditRecord implements the [[IEvent]] interface. * * @returns Response wrapped in [[IResult]] * * **Example** * ```typescript * * const mandantoryObject: IAuditRecord = { * type: AuditRecordType.ALARM, * time: '2018-05-02T10:08:00Z', * severity: Severity.MAJOR, * source: {id: 1} * }; * * (async () => { * const {data, res} = await auditService.create(mandantoryObject); * })(); * ``` */ create(entity: IAuditRecord): Promise<IResult<IAuditRecord>>; /** * Gets the list of audit records filtered by parameters. * * @returns Response wrapped in [[IResultList]] * * @param {object} filter Object containing filters for querying audit records. * * **Example** * ```typescript * * const filter: object = { * severity: Severity.MAJOR, * pageSize: 100, * withTotalPages: true * }; * * (async () => { * const {data, res, paging} = await auditService.list(filter); * })(); * ``` */ list(filter?: object): Promise<IResultList<IAuditRecord>>; } //# sourceMappingURL=AuditService.d.ts.map