refactor(microsoft-excel): export GRAPH_ID_PATTERN and deduplicate validation#4174
Conversation
…outes Export the shared regex pattern from utils.ts and import it in files/route.ts and drives/route.ts instead of duplicating the inline pattern. Also reorders the TSDoc comment to sit above getItemBasePath where it belongs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Also moves the ID-pattern TSDoc to sit directly above Reviewed by Cursor Bugbot for commit 71382cc. Configure here. |
Greptile SummaryThis PR exports Confidence Score: 5/5Safe to merge — pure deduplication with no logic changes. All three files make identical behavioral use of the pattern; no new logic is introduced. Import ordering follows the project conventions. No P0 or P1 issues found. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["GRAPH_ID_PATTERN\ntools/microsoft_excel/utils.ts"] --> B["getItemBasePath\nvalidates spreadsheetId and driveId"]
A --> C["files/route.ts\nvalidates driveId query param"]
A --> D["drives/route.ts\nvalidates driveId body param"]
C -->|"driveId valid"| E["Search drive: drives/{driveId}/root"]
C -->|"no driveId"| F["Search personal: me/drive/root"]
D -->|"driveId provided"| G["Fetch single drive\nsites/{siteId}/drives/{driveId}"]
D -->|"no driveId"| H["List all drives\nsites/{siteId}/drives"]
B -->|"driveId provided"| I["/drives/{driveId}/items/{itemId}"]
B -->|"no driveId"| J["/me/drive/items/{itemId}"]
Reviews (1): Last reviewed commit: "lint" | Re-trigger Greptile |
Summary
GRAPH_ID_PATTERNfromutils.tsinstead of keeping it module-private, and reuse it infiles/route.tsanddrives/route.tsto eliminate duplicated inline regex patternsgetItemBasePathwhere it belongsTest plan
bun run buildpasses with no type errors