Skip to content

chore(api): remove unused and superseded API routes - #7364

Merged
waleedlatif1 merged 1 commit into
stagingfrom
chore/trim-unused-routes
Sep 1, 2026
Merged

chore(api): remove unused and superseded API routes#7364
waleedlatif1 merged 1 commit into
stagingfrom
chore/trim-unused-routes

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Remove the manually rolled email template preview route (/api/emails/preview) and its schema
  • Remove legacy copilot chat routes superseded by the /api/mothership/* surface: chat/rename, chat/update-messages, chat/steer, checkpoints, checkpoints/revert, credentials, models, and mothership/local-files/stage
  • Remove table transfer routes superseded by the imports/exports resource flow: export-async, export/download, import-async (both table-level and per-table), job/cancel
  • Remove routes with no remaining callers: billing/credits, files/download, logs/triggers, workspaces/[id]/metrics/executions, status, organizations/[id]/invitations, workspaces/[id]/files/[fileId]/compiled-check (compiled checks now run in-process via the VFS)
  • Remove tools/cloudwatch/describe-log-* HTTP routes superseded by shared selectors and in-process tool execution (contracts kept for the in-process executor)
  • Clean up all orphaned contracts, schemas, use cases, error policies, and tests; retarget the executor-capability test to the live import-csv route

Type of Change

  • Chore

Testing

Full test suite passes (2851 files / 39297 tests), bun run type-check, bun run lint, and all 44 check:audits pass. Verified no external callers for every removed route across sibling service repos; routes with external consumers were kept.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner September 1, 2026 18:54
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 1, 2026 6:57pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes obsolete API endpoints and their now-unused contracts, helpers, error projections, and tests after the relevant behavior moved to newer resource and Mothership surfaces.

  • Removes legacy Copilot, table-transfer, billing, file, logs, status, metrics, invitation, and CloudWatch HTTP routes.
  • Deletes orphaned schemas and implementation helpers associated exclusively with those routes.
  • Retargets the table executor-capability test to the live CSV import endpoint.
  • Updates API-validation baselines and lockfile metadata to match the resulting tree.

Confidence Score: 5/5

The PR appears safe to merge; no changed-code-triggered blocking or independently actionable non-blocking issue was identified.

The removed routes, contracts, helpers, and tests have no remaining repository references, the retained replacement surfaces cover the updated test path, and the lockfile change does not modify dependencies.

Important Files Changed

Filename Overview
apps/sim/lib/api/contracts/copilot.ts Removes contracts and schemas belonging exclusively to the deleted legacy Copilot endpoints without leaving head-tree references.
apps/sim/lib/api/contracts/tables.ts Removes contracts for superseded asynchronous table-transfer endpoints alongside their route implementations.
apps/sim/lib/copilot/chat/messages-store.ts Removes the full-snapshot replacement helper whose sole consumer was the deleted update-messages route.
apps/sim/lib/billing/credits/purchase.ts Removes the unused direct credit-purchase implementation while retaining the live usage-limit reconciliation helper.
apps/sim/app/api/table/executor-capability-exemption.test.ts Retargets executor-versus-session permission behavior coverage from the removed async import route to the live multipart CSV import route.
scripts/check-api-validation-contracts.ts Cleans obsolete route entries from the raw-JSON audit baseline; no behavioral regression was identified.
bun.lock Adds only Bun lockfile-format metadata and does not alter package versions or dependency resolution.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Legacy API routes] -->|removed| B[Superseding resource and Mothership surfaces]
  C[Orphaned contracts and helpers] -->|removed| B
  D[Executor capability test] -->|retargeted| E[Live import-csv route]
  F[CloudWatch HTTP adapters] -->|removed; contracts retained| G[In-process tool execution]
Loading

Reviews (1): Last reviewed commit: "chore(api): remove unused and superseded..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 54 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 2ce2bec into staging Sep 1, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the chore/trim-unused-routes branch September 1, 2026 19:05
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.

1 participant