Skip to content

[Junie]: Integrate Shopee Brand Portal Performance APIs#33

Merged
nVuln merged 2 commits into
masterfrom
junie/issue-32-29135183863
Jul 16, 2026
Merged

[Junie]: Integrate Shopee Brand Portal Performance APIs#33
nVuln merged 2 commits into
masterfrom
junie/issue-32-29135183863

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains Early Access Preview

It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them.
We'd love your feedback — join our Discord to share bugs, ideas: here.

📊 Junie Summary:

Summary

  • Added support for Shopee Brand Portal OpenAPI announcement #1462 by introducing all newly announced v2.principal.* performance endpoints in the SDK.
  • Extended client auth/signature flow to support principal_id-scoped calls while keeping existing shop_id behavior intact.

Changes

  • Added new resource src/Resources/Principal.php with 11 endpoint wrappers for sales, affiliate, livestream, and video performance APIs.
  • Updated src/Client.php to register/read Principal resource, add setPrincipalAccessToken($principal_id, $access_token), inject principal_id into signed requests, and sign using principal_id when present.
  • Added/updated tests: new tests/Resources/PrincipalTest.php for all 11 endpoint mappings, plus tests/ClientTest.php coverage for Principal resource access and principal-vs-shop signature behavior.

Verification

  • Ran full test suite with composer test.
  • Result: OK (273 tests, 531 assertions).

Integrate Shopee Brand Portal Performance APIs

Co-authored-by: nVuln <54855446+nVuln@users.noreply.github.com>
@nVuln

nVuln commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

@junie-agent rename resource class Principal to BrandPortal

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Junie successfully finished!

Rename Principal resource class to BrandPortal

Summary

  • Renamed the Shopee performance resource from Principal to BrandPortal across implementation and tests, as requested.
  • Kept all endpoint paths and behavior intact (still mapped to v2.principal.* routes).

Changes

  • Renamed src/Resources/Principal.phpsrc/Resources/BrandPortal.php and updated class name to BrandPortal.
  • Updated src/Client.php to import/register BrandPortal and expose it via @property-read BrandPortal $BrandPortal.
  • Renamed tests/Resources/PrincipalTest.phptests/Resources/BrandPortalTest.php and updated test class/imports/fixtures accordingly.
  • Updated tests/ClientTest.php resource access test to use $client->BrandPortal and BrandPortal::class.

Verification

  • Ran full test suite with composer test after installing dependencies; result: OK (273 tests, 531 assertions). Commit sha: a5b1641

Rename Principal resource class to BrandPortal

Co-authored-by: nVuln <54855446+nVuln@users.noreply.github.com>
@nVuln
nVuln merged commit 8e967fe into master Jul 16, 2026
6 checks passed
@nVuln
nVuln deleted the junie/issue-32-29135183863 branch July 16, 2026 05:42
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.

[Important] Brand Portal Service OpenAPI Now Available [Shopee-ID:1462]

2 participants