Skip to content

feat(cli): add sales report downloads - #5

Merged
setoelkahfi merged 2 commits into
developmentfrom
feature/sales-reports
Sep 13, 2026
Merged

setoelkahfi merged 2 commits into
developmentfrom
feature/sales-reports

Conversation

@setoelkahfi

Copy link
Copy Markdown
Contributor

Add App Store Connect sales report downloads to the CLI, including account-level sales report retrieval, gzip TSV parsing, and JSON output.

@setoelkahfi setoelkahfi self-assigned this Sep 12, 2026

@sigit-code-review sigit-code-review 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.

This change adds App Store Connect sales report download support to the CLI. It introduces a new 'reports' crate that defines the API for requesting sales reports, including query parameter construction and a trait for downloading the gzip-compressed TSV files. The CLI is updated to include a 'sales-reports' command group, with a 'download' subcommand that retrieves, decompresses, parses, and outputs the sales report as a JSON array, preserving Apple's original column names and values as strings. The implementation includes error handling for malformed or unexpected TSV data, and tests for the TSV-to-JSON conversion logic. The core client is extended to support raw byte responses and custom headers, required for the sales report endpoint. Reviewers should focus on the TSV parsing logic, error handling, and the new API surface in the reports crate.


Automated review by siGit Code Review · commit 821bdd2

Comment thread crates/cli/src/main.rs Outdated
Comment thread crates/cli/src/main.rs Outdated
Comment thread crates/core/src/client.rs
Comment thread crates/reports/src/lib.rs
setoelkahfi and others added 2 commits September 12, 2026 19:08
Add App Store Connect sales report downloads to the CLI, including
account-level sales report retrieval, gzip TSV parsing, and JSON output.

Co-Authored-By: siGit Code <sigit@sigit.si>
Reviewed-by: sigit-code[bot] <279100073+sigit-code[bot]@users.noreply.github.com>

@sigit-code-review sigit-code-review 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.

This change adds App Store Connect sales report downloads to the CLI. It introduces a new 'smbcloud-ascapi-reports' crate for handling the download of sales reports as gzip-compressed TSV files, exposes a CLI subcommand for requesting and converting these reports to JSON, and includes robust TSV-to-JSON conversion logic that handles edge cases like missing, blank, or duplicate headers. The core client is extended to support raw byte responses and custom headers. Tests are included for both the TSV parsing and the new query logic. Reviewers should focus on the TSV-to-JSON conversion, the handling of edge cases in headers, and the integration of the new download flow in the CLI.


Automated review by siGit Code Review · commit bc5ad26

Comment thread crates/cli/src/main.rs
Comment thread crates/cli/src/main.rs
Comment thread crates/cli/src/main.rs
Comment thread crates/core/src/client.rs
Comment thread crates/cli/src/main.rs
@setoelkahfi
setoelkahfi merged commit 37f4efd into development Sep 13, 2026
2 checks passed
@setoelkahfi
setoelkahfi deleted the feature/sales-reports branch September 13, 2026 15:58
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