Skip to content

feat: back GET /api/apis with the Drizzle apis table#355

Merged
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
isaacCodes1:feature/apis-listing-endpoint
May 27, 2026
Merged

feat: back GET /api/apis with the Drizzle apis table#355
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
isaacCodes1:feature/apis-listing-endpoint

Conversation

@isaacCodes1
Copy link
Copy Markdown

@isaacCodes1 isaacCodes1 commented May 27, 2026

Overview

This PR replaces the hard-coded GET /api/apis placeholder with a real marketplace listing backed by the Drizzle apis table. The route now returns paginated public catalog results, defaults to active APIs, validates ?status= against apiStatusEnum, and includes endpoint pricing where available so the marketplace can render actual registered APIs.

Related Issue

Closes #302

Changes

⚙️ API Listing Endpoint

  • [MODIFY] src/routes/apis.ts
  • Replaced the placeholder { apis: [] } response with a real paginated listing route.
  • Added status query validation against apiStatusEnum.
  • Wired the route through parsePagination(...) and paginatedResponse(...).
  • Included endpoint pricing data in the public API listing payload.

🗄️ Repository Read Path

  • [MODIFY] src/repositories/apiRepository.ts
  • Added a paginated detailed public-list helper backed by the Drizzle apis table.
  • Joined developer profile fields for the public API summary shape.
  • Reused endpoint reads so each listed API can include pricing metadata.
  • Added matching in-memory support for unit and route tests.

🌐 App Wiring

  • [MODIFY] src/app.ts
  • Mounted the real /api/apis router with the injected repository so app-level tests and runtime use the same route path.

🧪 Tests

  • [ADD] src/routes/apis.test.ts

  • Added route coverage for default active filtering.

  • Added route coverage for valid ?status= filtering.

  • Added route coverage for invalid ?status= returning 400.

  • Added route coverage for pagination metadata and endpoint pricing output.

  • [MODIFY] src/repositories/apiRepository.test.ts

  • Added coverage for detailed public listings with endpoint pricing.

  • Added coverage for explicit status filtering and totals.

  • [MODIFY] src/webhooks/webhook.integration.test.ts

  • Updated the /api/apis expectation to match the real paginated response shape.

📘 Documentation and Types

  • [MODIFY] src/types/index.ts

  • Updated the public API listing response types to reflect pagination and endpoint pricing.

  • [MODIFY] README.md

  • Removed the stale placeholder wording for GET /api/apis.

Verification Results

Acceptance Criteria Status
GET /api/apis returns active APIs from the database with pagination metadata
?status= filtering validates against apiStatusEnum and rejects unknown values with 400
Endpoint pricing is included per API where available
Unit and route tests pass
App-level public route sanity check passes
Typecheck passes successfully

Screenshots

✅ Repository and route tests pass

A screenshot of:

npm test -- src/repositories/apiRepository.test.ts src/routes/apis.test.ts
image

✅ App-level public route sanity check passes

A screenshot of:

npm test -- src/app.test.ts -t "public routes do not require authentication"
image

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@isaacCodes1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me greatest0fallt1me merged commit bbbdd4a into CalloraOrg:main May 27, 2026
1 check failed
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.

Implement real GET /api/apis listing backed by the Drizzle apis table instead of the empty placeholder

3 participants