Skip to content

feat(quickbooks): add documents and attachments - #6200

Open
BillLeoutsakosvl346 wants to merge 11 commits into
feat/quickbooks-05-reportsfrom
feat/quickbooks-06-documents
Open

feat(quickbooks): add documents and attachments#6200
BillLeoutsakosvl346 wants to merge 11 commits into
feat/quickbooks-05-reportsfrom
feat/quickbooks-06-documents

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • add Email Transaction, Download Transaction PDF, Read Attachments, Add Attachment, and Download Attachment
  • add authenticated bounded file routes for PDF and attachment transfer
  • enforce workspace file authorization, fixed QuickBooks endpoint maps, MIME/filename validation, 100 MiB limits, and pinned-IP temporary URL downloads
  • expand the QuickBooks block from 40 to 45 operations and regenerate its catalog/docs

Validation

  • 15 relevant test files, 546 tests passing
  • type-check, format, lint, tool metadata, API validation, bare-icon, client-boundary, and diff checks passing
  • independent full-stack review against staging: no remaining PR-6-actionable findings
  • sandbox verified email override, all exposed transaction PDFs, note/file creation, attachment listing/read, byte-for-byte file download, and note-only download guidance

Stack

Targets feat/quickbooks-05-reports at frozen parent 1edbb5010e9bce820268202c57078d42bcf23a67. This PR must not be merged automatically.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 3, 2026 8:34am

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches external email, file upload/download, and SSRF-sensitive temporary URL fetching with new abort handling; scope is bounded by auth, size limits, and pinned IP, but mistakes could leak credentials or fetch unintended hosts.

Overview
Adds five QuickBooks block operations (email transaction, download transaction PDF, read/add/download attachments), expanding the integration from 40 to 45 operations with matching docs and catalog metadata.

Workflow block gains conditional sub-blocks for transaction types, explicit email send confirmation, attachment targets, file/note modes, and file outputs (file, mimeType, size) for downloads.

New authenticated API routes handle bounded PDF and attachment transfer: workspace file authorization on upload, 100 MiB caps, PDF/MIME validation, and pinned-IP fetches for short-lived Intuit attachment URLs (auth stripped on redirect). secureFetchWithPinnedIP now respects abort signals before opening requests and during redirect DNS validation.

Zod route contracts define request/response shapes for the three file-oriented endpoints; attachment add enforces file-vs-note mode in validation.

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

Comment thread apps/sim/app/api/tools/quickbooks/download-transaction-pdf/route.ts
@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds five QuickBooks document-delivery and attachment operations with authenticated, bounded file-transfer routes.

  • Supports emailing transactions and downloading transaction PDFs.
  • Supports listing, creating, and downloading QuickBooks attachments.
  • Adds workspace-file authorization, MIME and filename validation, transfer-size limits, pinned-IP temporary URL downloads, contracts, generated metadata, documentation, and tests.

Confidence Score: 5/5

The PR appears safe to merge from the reviewed follow-up scope.

No blocking failure remains; the previously reported download response-cap mismatch is addressed for both file-producing tools.

Important Files Changed

Filename Overview
apps/sim/tools/quickbooks/download_attachment.ts Defines the attachment-download tool and applies a response cap sized for a base64-encoded 100 MiB file plus JSON overhead.
apps/sim/tools/quickbooks/download_transaction_pdf.ts Defines bounded transaction-PDF downloads using the same corrected executor response limit.
apps/sim/tools/quickbooks/documents_utils.ts Centralizes QuickBooks document mappings, validation helpers, error handling, and transfer-size constants.
apps/sim/app/api/tools/quickbooks/download-attachment/route.ts Implements authenticated attachment transfer through DNS validation and pinned-IP fetching with bounded streaming.
apps/sim/app/api/tools/quickbooks/download-transaction-pdf/route.ts Implements authenticated, size-bounded PDF retrieval and safe execution-file serialization.
apps/sim/app/api/tools/quickbooks/add-attachment/route.ts Implements authorized workspace-file and note attachment creation with MIME, filename, and size validation.
apps/sim/blocks/blocks/quickbooks.ts Exposes the five new document and attachment operations through the QuickBooks block.

Sequence Diagram

sequenceDiagram
  participant Workflow
  participant Tool as QuickBooks Tool
  participant Route as Authenticated File Route
  participant QBO as QuickBooks API
  participant Storage as Execution Files
  Workflow->>Tool: Run document operation
  Tool->>Route: Authenticated bounded request
  Route->>QBO: Request PDF, attachment metadata, or temporary URL
  QBO-->>Route: Document response
  Route->>Route: Validate size, MIME, filename, and URL
  Route-->>Tool: Base64 file response
  Tool-->>Storage: Store execution file
  Storage-->>Workflow: File reference and metadata
Loading

Reviews (3): Last reviewed commit: "test(quickbooks): cover attachment MIME ..." | Re-trigger Greptile

Comment thread apps/sim/tools/quickbooks/download_attachment.ts
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile-apps please review the latest commit 8e35624. The prior response-size finding was fixed by setting both file tools to a base64-aware bounded response cap with regression coverage.

@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 8e35624. Configure here.

Comment thread apps/sim/app/api/tools/quickbooks/download-attachment/route.ts
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile-apps please review the latest commit 371586c. The only change since your 5/5 review makes the attachment MIME fallback explicit and adds a missing-Content-Type regression test.

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.

1 participant