Standalone raw file redirects (#428)

This commit is contained in:
Spencer Woo
2022-02-14 19:33:19 +08:00
committed by GitHub
parent 0fda1c93db
commit 9493ce9f3d
30 changed files with 365 additions and 185 deletions
+3 -9
View File
@@ -1,4 +1,4 @@
// API response object for /api?path=<path_to_file_or_folder>, this may return either a file or a folder.
// API response object for /api/?path=<path_to_file_or_folder>, this may return either a file or a folder.
// Pagination is also declared here with the 'next' parameter.
export type OdAPIResponse = { file?: OdFileObject; folder?: OdFolderObject; next?: string }
// A folder object returned from the OneDrive API. This contains the parameter 'value', which is an array of items
@@ -8,7 +8,6 @@ export type OdFolderObject = {
'@odata.context': string
'@odata.nextLink'?: string
value: Array<{
'@microsoft.graph.downloadUrl': string
id: string
name: string
size: number
@@ -17,14 +16,11 @@ export type OdFolderObject = {
folder?: { childCount: number; view: { sortBy: string; sortOrder: 'ascending'; viewType: 'thumbnails' } }
image?: OdImageFile
video?: OdVideoFile
// 'thumbnails@odata.context'?: string
// thumbnails?: Array<OdThumbnail>
}>
}
export type OdFolderChildren = OdFolderObject['value'][number]
// A file object returned from the OneDrive API. This object may contain 'video' if the file is a video.
export type OdFileObject = {
'@microsoft.graph.downloadUrl': string
'@odata.context': string
name: string
size: number
@@ -33,8 +29,6 @@ export type OdFileObject = {
file: { mimeType: string; hashes: { quickXorHash: string; sha1Hash?: string; sha256Hash?: string } }
image?: OdImageFile
video?: OdVideoFile
// 'thumbnails@odata.context'?: string
// thumbnails?: Array<OdThumbnail>
}
// A representation of a OneDrive image file. Some images do not return a width and height, so types are optional.
export type OdImageFile = {
@@ -59,7 +53,7 @@ export type OdThumbnail = {
medium: { height: number; width: number; url: string }
small: { height: number; width: number; url: string }
}
// API response object for /api/search?q=<query>. Likewise, this array of items may also contain either files or folders.
// API response object for /api/search/?q=<query>. Likewise, this array of items may also contain either files or folders.
export type OdSearchResult = Array<{
id: string
name: string
@@ -68,7 +62,7 @@ export type OdSearchResult = Array<{
path: string
parentReference: { id: string; name: string; path: string }
}>
// API response object for /api/item?id={id}. This is primarily used for determining the path of the driveItem by ID.
// API response object for /api/item/?id={id}. This is primarily used for determining the path of the driveItem by ID.
export type OdDriveItem = {
'@odata.context': string
'@odata.etag': string