Skip to content

[Platform API] Add typed read clients for workspaces, environments, and applications #113

Open

Description

@mohit-nagaraj

Context

Parent: #112

Core already exposes documented Beta read contracts for workspaces,
environments, and applications, but UI has no TypeScript types or service
methods for them. Components should not hand-build these URLs or invent
response shapes.

Core contract references:

  • GET /v1/api/workspaces
  • GET /v1/api/workspaces/{workspaceId}
  • GET /v1/api/workspaces/{workspaceId}/environments
  • GET /v1/api/workspaces/{workspaceId}/applications
  • GET /v1/api/workspaces/{workspaceId}/applications/{applicationId}

Outcome

UI has one small, typed, tested read client matching the existing Core
workspace, environment, application, and pagination contracts.

Scope

  • Add TypeScript types for workspace, environment, application, and page-info
    responses using the exact Core JSON field names.
  • Add service methods to list workspaces, list environments for a workspace,
    list applications for a workspace, and get one application.
  • Support cursor and limit on list calls.
  • Support environmentId and includeArchived on application lists.
  • Omit optional query parameters when they are not provided.
  • Use the existing shared Axios client so bearer authentication, runtime base
    URL, timeout, and 401 handling remain centralized.
  • Add focused unit tests for paths, query serialization, response shapes, and
    rejected requests.

Out Of Scope

  • Zustand state or React components.
  • Create, update, archive, membership, artifact, release, plan, or approval calls.
  • Changes to Core or the OpenAPI contract.
  • Generated API clients or a new HTTP dependency.
  • Retrying or transforming authorization errors.

Acceptance Criteria

  • Types match Core's { items, pageInfo } list envelope and camelCase fields.
  • Workspace-scoped paths use the supplied workspace ID.
  • Application filters are serialized only when supplied.
  • The existing API client remains the only bearer-token owner.
  • HTTP failures reject to the caller without being converted into empty lists.
  • Tests use dummy IDs and make no network requests.

Verification

  • Run the focused service test.
  • Run npm run type-check.
  • Run the relevant lint command.

Dependencies

Core #115 and #116 are complete. No new Core implementation is required.

Documentation And Observability

No public documentation change is expected. Keep Beta-contract naming in one
frontend module so later contract changes are easy to locate.

Activity

  1. added
    area/uiNext.js frontend (components, pages, styling)
    kind/integrationConnecting frontend with backend
    sprint/nextNext sprint planned items
    area/testingTesting, quality assurance, validation
    size/xsExtra small task (1-2 hours)
    on Sep 4, 2026
  2. ankitv909 commented on Sep 13, 2026

    @ankitv909

    Hi! I’d like to work on this issue. I’ll keep the change scoped to the typed Beta read client described here: workspace/environment/application response types, cursor/filter query serialization through the existing shared Axios client, and focused Vitest coverage for paths, optional params, response shapes, and rejection behavior. I’ll verify with the focused tests, type-check, and lint before opening the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiREST endpointsarea/testingTesting, quality assurance, validationarea/uiNext.js frontend (components, pages, styling)good first issueGood for newcomerskind/integrationConnecting frontend with backendpriority/highsize/xsExtra small task (1-2 hours)sprint/nextNext sprint planned items

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions