-
Notifications
You must be signed in to change notification settings - Fork 6
Drive updates/fixes #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mabels/gdrive
Are you sure you want to change the base?
Drive updates/fixes #373
Conversation
src/drive/drive-gateway.ts
Outdated
| }; | ||
| try { | ||
| const response = await fetch(url + fileId, { | ||
| const response = await fetch(BuildURI.from(url).appendRelative('drive/v3/files') + fileId, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appendRelative('x').appendRelative('y')
src/drive/drive-gateway.ts
Outdated
| headers = { | ||
| Authorization: `Bearer ${auth}`, | ||
| }; | ||
| response = await fetch(url.appendRelative(`drive/v3/files/${fileId}`).setParam("alt", "media").toString(), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better but you can chain .appendRelative
src/drive/drive-gateway.ts
Outdated
| fileData: Blob, | ||
| auth: string, | ||
| store: "data" | "wal" | "meta" | ||
| store: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave it strongly typed.
there might needed a small helper like:
function toStore(s: string): "data" | "wal" | "meta" {
if (["data", "wal", "meta"].include(s)) { return s as "data"|"wal"|"meta" }
throw new Error(unknown Store:${s})
}
src/drive/drive-gateway.ts
Outdated
| } | ||
| } | ||
| async #search(fileName: string, auth: string): Promise<Result<string>> { | ||
| async #search(fileName: string, auth: string, store: string): Promise<Result<string>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store typing
No description provided.