cloudflare
Version:
The official TypeScript library for the Cloudflare API
52 lines • 2.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Audit = exports.BaseAudit = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseAudit = /* @__PURE__ */ (() => {
class BaseAudit extends resource_1.APIResource {
/**
* Gets a list of audit logs for an organization.
*/
list(organizationID, query, options) {
return this._client.getAPIList((0, path_1.path) `/organizations/${organizationID}/logs/audit`, (pagination_1.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((0, path_1.path) `/organizations/${organization_id}/logs/audit/${id}/history`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseAudit._key = Object.freeze([
'organizations',
'logs',
'audit',
]);
return BaseAudit;
})();
exports.BaseAudit = BaseAudit;
class Audit extends BaseAudit {
}
exports.Audit = Audit;
//# sourceMappingURL=audit.js.map