← Public packages
@kentcdodds/dropbox
Upload, share, and manage Dropbox files via OAuth — small or large uploads and direct download URLs.
src/get-space-usage.ts
21 lines · 571 B · TypeScriptimport { dropboxRpc } from './request.ts'
export type DropboxSpaceUsage = {
used: number
allocation: {
'.tag': 'individual' | 'team'
allocated?: number
used?: number
user_within_team_space_allocated?: number
}
}
/**
* Return Dropbox storage usage and allocation for the connected account.
* @example
* import getSpaceUsage from 'kody:@kentcdodds/dropbox/get-space-usage'
* const usage = await getSpaceUsage()
*/
export default async function getSpaceUsage(): Promise<DropboxSpaceUsage> {
return dropboxRpc<DropboxSpaceUsage>('users/get_space_usage')
}