Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/handwritten/commands/drive/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,14 @@ export async function createDriveApi(opts: DriveApiOptions = {}) {
})
return expectJsonResult(result)
},
async getManifest(
id: string,
cursor?: string,
sinceCursor?: string,
): Promise<DriveManifestResponse & { latest_cursor?: string; resync_required?: boolean }> {
const query: Record<string, string> = {}
async getManifest(id: string, cursor?: string, sinceCursor?: string): Promise<DriveManifestResponse> {
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)
},
Expand Down
9 changes: 1 addition & 8 deletions src/handwritten/commands/drive/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DriveManifestResult>
getManifest(id: string, cursor?: string, sinceCursor?: string): Promise<DriveManifestResponse>
uploadFile(
id: string,
path: string,
Expand Down
Loading