improvement(external-endpoints): v2 versions with clean signatures + updated docs based on openapi spec#5273
improvement(external-endpoints): v2 versions with clean signatures + updated docs based on openapi spec#5273icecrasher321 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The API reference sidebar is reorganized: run/cancel/job-status endpoints move out of Workflows into a new Getting started (all locales) now links async polling to Reviewed by Cursor Bugbot for commit 98c8567. Configure here. |
Greptile SummaryThis PR adds a parallel v2 external API and refreshes the API docs. The main changes are:
Confidence Score: 4/5The v2 table mutation paths need fixes before merging.
apps/sim/app/api/v2/tables/[tableId]/rows/route.ts; apps/sim/app/api/v2/tables/[tableId]/columns/route.ts Important Files Changed
Reviews (1): Last reviewed commit: "improvement(external-endpoints): v2 vers..." | Re-trigger Greptile |
| const idByName = buildIdByName(table.schema as TableSchema) | ||
| const nameById = buildNameById(table.schema as TableSchema) | ||
| const rows = (validated.rows as RowData[]).map((r) => rowDataNameToId(r, idByName)) | ||
|
|
There was a problem hiding this comment.
When a v2 caller sends row data with a misspelled or differently cased column name, rowDataNameToId removes that key before validateBatchRows runs. The request can then succeed while silently losing the caller's submitted value; the same translation pattern is used by the single-row insert, update, and upsert paths.
| table, | ||
| { | ||
| filter: filterNamesToIds(validated.filter as Filter, idByName), | ||
| data: patchData, |
There was a problem hiding this comment.
filterNamesToIds leaves unknown filter fields unchanged, so a bulk update or delete with a misspelled public column name is executed as a lookup on a non-existent JSON key. The API can return a successful response with zero affected rows instead of rejecting the invalid destructive filter.
| { tableId, columnName: validated.columnName }, | ||
| requestId | ||
| ) | ||
|
|
There was a problem hiding this comment.
This v2 delete path returns as soon as deleteColumn finishes, while the shared column service strips the deleted column's row data in a fire-and-forget cleanup. If an external caller immediately recreates or restores a column with the same id, that delayed cleanup can remove the restored column values after the API has already reported success.
Summary
Introduces a new, parallel
/api/v2external API surface that standardizes theresponse envelope, pagination, error handling, and auth across every resource —
fixing the inconsistencies that had accreted in
/api/v1without breaking existingv1 consumers. v1 stays in place and untouched on the wire; v2 is where the breaking
improvements land. Also includes a set of safe, in-place v1 correctness fixes
surfaced during the audit, and a full API-reference docs rework.
Type of Change
Testing
Tested manually
Checklist