Skip to content

feat(partnercenter): add price/product fetch methods#161

Merged
noticeeverything merged 22 commits intomainfrom
feat/price-data-fetch
Apr 13, 2026
Merged

feat(partnercenter): add price/product fetch methods#161
noticeeverything merged 22 commits intomainfrom
feat/price-data-fetch

Conversation

@noticeeverything
Copy link
Copy Markdown
Contributor

@noticeeverything noticeeverything commented Apr 10, 2026

Note

Medium Risk
Adds new Partner Center sales-data fetch methods and changes getPriceSheet from returning a raw buffer to parsing streamed/zipped CSV into typed rows, which could affect existing consumers and introduces stream/unzip parsing failure modes. Also upgrades axios and test tooling dependencies, which may subtly change HTTP behavior.

Overview
Adds Partner Center sales/pricing retrieval APIs: getPriceSheet(type, market), getOfferMatrix() (current month), and getPlanIdentifiers() (downloads Microsoft CSV), all returning parsed CSV rows.

Refactors price sheet fetching to a shared getSalesItem() helper that authenticates against https://api.partner.microsoft.com, downloads a streamed zipped CSV, unzips (unzipper) and converts to JSON rows (csvtojson), with new pricing.types and a PriceType→view mapping.

Updates tests to mock stream/unzip behavior and validate the new parsing/output, and bumps dependencies (notably axios) plus adds CSV/unzip parsing packages and typings.

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

Comment thread src/lib/microsoft-partnercenter.ts
Comment thread src/lib/microsoft-partnercenter.ts Outdated
Comment thread src/lib/types/licenses.types.ts Outdated
Comment thread src/lib/microsoft-partnercenter.ts Outdated
Comment thread src/lib/microsoft-partnercenter.ts
Comment thread src/lib/types/licenses.types.ts Outdated
Comment thread src/lib/microsoft-partnercenter.ts Outdated
Comment thread src/lib/microsoft-partnercenter.ts
santese
santese previously approved these changes Apr 11, 2026
…eat/price-data-fetch

# Conflicts:
#	package.json
Comment thread src/lib/microsoft-partnercenter.ts Outdated
Comment thread src/lib/microsoft-partnercenter.ts
Comment thread src/lib/microsoft-partnercenter.ts
Comment thread src/lib/microsoft-partnercenter.spec.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 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 d4f7a82. Configure here.

Comment thread src/lib/types/pricing.types.ts Outdated
@noticeeverything noticeeverything merged commit ce2dff5 into main Apr 13, 2026
2 checks passed
plibot pushed a commit that referenced this pull request Apr 13, 2026
feat(partnercenter): add price/product fetch methods [skip ci]
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