Skip to content

feat: Shared Mobile API Client - #14

Open
PlainOlSoapBar wants to merge 7 commits into
mainfrom
feat/mobile-api-client
Open

PlainOlSoapBar wants to merge 7 commits into
mainfrom
feat/mobile-api-client

Conversation

@PlainOlSoapBar

Copy link
Copy Markdown
Collaborator

Summary

Resolves #6:
Create a standardized API for writing/calling backend requests and throwing API-related errors.

New files:

  • src/services/api/apiClient.ts - ApiClient implementation.
  • src/services/api/apiError.ts - ApiClient's AppError definitions and class constructor.
  • src/types/apiClient.types.ts - Type & interface definitions for ApiClient.
  • src/docs/api-client.md - Documentation on ApiCilent's types, interfaces, and AppErrors.

Developers can create ApiClients via createApiClient() and passing in a bodyUrl, an optional tokenProvider, and timeoutMs.

Using this client, they can call the four GET/POST/PUT/DELETE requests. These requests can be aborted by timeout or manual cancellation.

Tests

Run the new tests with: npm run test -- ./test/apiClient.test.ts.
This should be result:

image

@PlainOlSoapBar
PlainOlSoapBar requested review from Umar-Azizadah and a balanced review from Copilot October 8, 2026 07:34
@PlainOlSoapBar PlainOlSoapBar self-assigned this Oct 8, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PlainOlSoapBar

PlainOlSoapBar commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

I didn't even mean to add copilot as a reviewer lol, and now I can't remove it :V

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.

Foundation: Implement the typed mobile API client

2 participants