From a21b1e7c893090ce5ff51b4e48a7397ac3a56967 Mon Sep 17 00:00:00 2001 From: Yuren Ju Date: Mon, 13 Jul 2026 15:38:10 +0900 Subject: [PATCH] refactor(drive): use native SDK manifest delta types now that spec is regenerated --- src/handwritten/commands/drive/api.ts | 12 +++--------- src/handwritten/commands/drive/sync.ts | 9 +-------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/handwritten/commands/drive/api.ts b/src/handwritten/commands/drive/api.ts index b4b2d80..6ed1f91 100644 --- a/src/handwritten/commands/drive/api.ts +++ b/src/handwritten/commands/drive/api.ts @@ -62,20 +62,14 @@ export async function createDriveApi(opts: DriveApiOptions = {}) { }) return expectJsonResult(result) }, - async getManifest( - id: string, - cursor?: string, - sinceCursor?: string, - ): Promise { - const query: Record = {} + async getManifest(id: string, cursor?: string, sinceCursor?: string): Promise { + const query: { cursor?: string; since_cursor?: string } = {} if (cursor !== undefined) query.cursor = cursor - // since_cursor / latest_cursor / resync_required exist server-side but are - // not in the generated SDK types yet; widen until the spec is regenerated. if (sinceCursor !== undefined) query.since_cursor = sinceCursor const result = await driveManifestGet({ client: rawClient, path: { id }, - ...(Object.keys(query).length > 0 ? { query: query as never } : {}), + ...(Object.keys(query).length > 0 ? { query } : {}), }) return expectJsonResult(result) }, diff --git a/src/handwritten/commands/drive/sync.ts b/src/handwritten/commands/drive/sync.ts index 2b3cfd3..f9c3bb6 100644 --- a/src/handwritten/commands/drive/sync.ts +++ b/src/handwritten/commands/drive/sync.ts @@ -36,15 +36,8 @@ import type { DriveManifestResponse, MoveDriveFileResponse, UploadDriveFileRespo type RemoteEntry = DriveManifestResponse["entries"][number] type ProcessPathResult = { state: DriveState; stop: boolean } -// The manifest endpoint gained delta fields (latest_cursor / resync_required) -// that the generated SDK type does not model yet. -export type DriveManifestResult = DriveManifestResponse & { - latest_cursor?: string - resync_required?: boolean -} - export interface DriveSyncApi { - getManifest(id: string, cursor?: string, sinceCursor?: string): Promise + getManifest(id: string, cursor?: string, sinceCursor?: string): Promise uploadFile( id: string, path: string,