/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as WorkOS from "../../.."; export declare namespace AuditLogs { interface Options { environment?: core.Supplier; authorizationToken?: core.Supplier; fetcher?: core.FetchFunction; } interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; } interface IdempotentRequestOptions extends RequestOptions { idempotencyKey?: string | undefined; } } export declare class AuditLogs { protected readonly _options: AuditLogs.Options; constructor(_options?: AuditLogs.Options); /** * Emits an Audit Log Event * @throws {@link WorkOS.BadRequestError} * @throws {@link WorkOS.NotFoundError} * @throws {@link WorkOS.UnprocessableEntityError} * @throws {@link WorkOS.TooManyRequestsError} * * @example * await workOs.auditLogs.createEvent({ * organizationID: "string", * event: { * action: "string", * occurredAt: "string", * actor: { * id: "string", * type: "string" * }, * targets: [{ * id: "string", * type: "string" * }], * context: { * location: "string" * } * } * }) */ createEvent(request: WorkOS.CreateEventOpts, requestOptions?: AuditLogs.IdempotentRequestOptions): Promise; /** * Get an Audit Log Export * @throws {@link WorkOS.NotFoundError} * * @example * await workOs.auditLogs.getExport("string") */ getExport(auditLogExportID: string, requestOptions?: AuditLogs.RequestOptions): Promise; /** * Create an Audit Log Export * @throws {@link WorkOS.BadRequestError} * * @example * await workOs.auditLogs.createExport({ * organizationID: "string", * rangeStart: "string", * rangeEnd: "string" * }) */ createExport(request: WorkOS.CreateAuditLogExportOpts, requestOptions?: AuditLogs.RequestOptions): Promise; /** * Get a list of all Audit Log actions in the current environment * @throws {@link WorkOS.NotFoundError} * * @example * await workOs.auditLogs.listActions() */ listActions(requestOptions?: AuditLogs.RequestOptions): Promise; /** * Get a list of all schemas for the Audit Logs action identified by name * @throws {@link WorkOS.NotFoundError} * * @example * await workOs.auditLogs.listSchemas("string") */ listSchemas(actionName: string, requestOptions?: AuditLogs.RequestOptions): Promise; /** * Creates a new Audit Log schema used to validate the payload of incoming Audit Log Events. If the action does not exist, it will also be created * @throws {@link WorkOS.UnprocessableEntityError} * * @example * await workOs.auditLogs.createSchema("string", { * actor: { * metadata: { * "string": {} * } * }, * targets: [{ * type: "string" * }] * }) */ createSchema(actionName: string, request: WorkOS.CreateAuditLogSchemaOpts, requestOptions?: AuditLogs.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }