Skip to content

Conversation

@Daniel-Ric
Copy link
Owner

Motivation

  • PlayFab Inventory/GetInventoryItems only accepts filters on type, id, or stackId using eq, so existing queries using unsupported fields fail; the endpoint needs a safe, convenient way to express these allowed filters.
  • Provide a simple, documented shortcut API for common queries (e.g. subscriptions) while keeping full filter support for advanced use.

Description

  • Added optional query parameters type, id, and stackId to GET /inventory/playfab/items and validate that callers use either filter or the shortcut params, not both, and require one of them to be present.
  • Implemented buildInventoryFilter and escapeFilterValue in src/routes/inventory.routes.js to construct a PlayFab-compatible Filter string and safely escape single quotes.
  • Updated OpenAPI schema in src/utils/swagger.js and examples in README.md to document supported filter fields and show both filter and shortcut usage examples.

Testing

  • Ran a smoke import test with JWT_SECRET=0123456789abcdef SWAGGER_SERVER_URL=http://localhost node --input-type=module -e "import './src/routes/inventory.routes.js'; console.log('ok');" and it printed ok, indicating the route module loads successfully (pass).
  • No unit tests are present in the repository, and no additional automated tests were executed beyond the module import check (n/a for failures).

Codex Task

@Daniel-Ric Daniel-Ric merged commit ca6786f into master Jan 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants