UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

47 lines • 2.07 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import { CursorPaginationAfter, } from "../../../core/pagination.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseAudit = /* @__PURE__ */ (() => { class BaseAudit extends APIResource { /** * Gets a list of audit logs for an organization. */ list(organizationID, query, options) { return this._client.getAPIList(path `/organizations/${organizationID}/logs/audit`, (CursorPaginationAfter), { query, ...options }); } /** * Returns the chronological change history for the resource identified by the * given organization-scoped audit log entry. * * The endpoint first locates the source audit log entry by `id` (using * `action_time` to narrow the lookup window), derives identifying filters from * that entry, and then returns matching audit logs within the `since`/`before` * window. * * The `result_info.history_status` field indicates the quality of the resource * identification used: * * - `exact`: Resource was identified by the resource URI. * - `approximate`: Resource was identified without the resource URI. * - `unavailable`: The source audit log entry did not contain enough information * to identify the resource; an empty result is returned. */ history(id, params, options) { const { organization_id, ...query } = params; return this._client.get(path `/organizations/${organization_id}/logs/audit/${id}/history`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseAudit._key = Object.freeze([ 'organizations', 'logs', 'audit', ]); return BaseAudit; })(); export class Audit extends BaseAudit { } //# sourceMappingURL=audit.mjs.map