Skip to content

feat: add complete audit log download helper#144

Merged
yummybomb merged 6 commits into
mainfrom
hypeship/audit-log-download-helper
Jul 21, 2026
Merged

feat: add complete audit log download helper#144
yummybomb merged 6 commits into
mainfrom
hypeship/audit-log-download-helper

Conversation

@yummybomb

@yummybomb yummybomb commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add auditLogs.download for complete exports while retaining exportChunk for low-level access
  • use gzip-compressed JSON Lines for high-level downloads; raw format selection remains on exportChunk
  • verify checksums and reject missing, stalled, or cyclic cursor chains before writing each chunk
  • preserve standard SDK HTTP retry behavior and make transfer retries configurable
  • support browser-safe checksum verification, file handles, async progress, and documented partial outputs

Testing

  • ./scripts/lint
  • ./scripts/test
  • ./scripts/build
  • browser bundle with esbuild

Note

Medium Risk
New client-side export path with integrity and pagination rules; failures can leave partial files (documented), but existing list/exportChunk APIs are unchanged.

Overview
Adds auditLogs.download for full gzip JSONL audit exports to any writable destination, while exportChunk stays available for single-chunk access.

The new helper pages via X-Next-Cursor, validates X-Has-More, X-Row-Count, and X-Content-Sha256 before writing, detects repeated cursors, and retries transient transfer failures with configurable maxTransferRetries. It supports onProgress, abort signals, body read timeouts, and partial-write handling for destinations like Node file handles. AuditLogDownloadError and related types are exported from the package entrypoint.

Reviewed by Cursor Bugbot for commit ec64cbd. Bugbot is set up for automated code reviews on this repo. Configure here.

@yummybomb
yummybomb force-pushed the hypeship/audit-log-download-helper branch from 3d6aee8 to 6cb8e9e Compare July 20, 2026 21:03
@yummybomb yummybomb changed the title Add complete audit log download helper feat: add complete audit log download helper Jul 20, 2026
@yummybomb
yummybomb marked this pull request as ready for review July 21, 2026 14:19
Comment thread src/lib/audit-log-download.ts
Comment thread src/lib/audit-log-download.ts
Comment thread src/lib/audit-log-download.ts
Comment thread src/lib/audit-log-download.ts
Comment thread src/lib/audit-log-download.ts Outdated
Comment thread src/lib/audit-log-download.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0779ce9. Configure here.

Comment thread src/lib/audit-log-download.ts
@yummybomb
yummybomb requested a review from sjmiller609 July 21, 2026 18:43
@yummybomb
yummybomb merged commit c5182d0 into main Jul 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants