Skip to content

basalt / drives-dropbox/src / DropboxDrive

Class: DropboxDrive ​

Defined in: drives-dropbox/src/provider.ts:148

The adapter. Construct it with dropboxDrive.

Implements ​

Constructors ​

Constructor ​

> new DropboxDrive(options): DropboxDrive

Defined in: drives-dropbox/src/provider.ts:166

Parameters ​

options ​

DropboxDriveOptions

Returns ​

DropboxDrive

Properties ​

allowedHosts ​

> readonly allowedHosts: readonly string[]

Defined in: drives-dropbox/src/provider.ts:155

The SSRF allowlist. www.dropbox.com is not on it: the consent URL is handed to a browser and is never fetched by the framework, so allowing the host would widen the guard for nothing.

Implementation of ​

DriveProvider.allowedHosts


authorization ​

> readonly authorization: DriveAuthorization

Defined in: drives-dropbox/src/provider.ts:158

Implementation of ​

DriveProvider.authorization


deltaIncludesExisting ​

> readonly deltaIncludesExisting: true = true

Defined in: drives-dropbox/src/provider.ts:157

list_folder enumerates before it streams changes — see START_CURSOR in this module.

Implementation of ​

DriveProvider.deltaIncludesExisting


name ​

> readonly name: "dropbox" = 'dropbox'

Defined in: drives-dropbox/src/provider.ts:149

Stable identifier, stored on every connection: google, microsoft, dropbox.

Implementation of ​

DriveProvider.name

Methods ​

delta() ​

> delta(session, cursor): Promise<DriveDelta>

Defined in: drives-dropbox/src/provider.ts:432

Reads one page of changes since cursor.

Parameters ​

session ​

DriveSession

cursor ​

string

Returns ​

Promise<DriveDelta>

Implementation of ​

DriveProvider.delta


download() ​

> download(session, item): Promise<DriveContent>

Defined in: drives-dropbox/src/provider.ts:341

Opens an item's bytes.

Streamed, never buffered: the response body goes straight back to the engine, which hands it to @basaltkit/files. The byte cap is the guarded fetch's and is enforced mid-flight, so an oversized file costs the abandoned prefix rather than its full size.

Parameters ​

session ​

DriveSession

item ​

DriveItem

Returns ​

Promise<DriveContent>

Implementation of ​

DriveProvider.download


get() ​

> get(session, externalId): Promise<DriveItem | null>

Defined in: drives-dropbox/src/provider.ts:307

Fetches one item's metadata. null when it no longer exists.

Parameters ​

session ​

DriveSession

externalId ​

string

Returns ​

Promise<DriveItem | null>

Implementation of ​

DriveProvider.get


list() ​

> list(session, options): Promise<DrivePage<DriveItem>>

Defined in: drives-dropbox/src/provider.ts:280

Lists one page of a folder.

Parameters ​

session ​

DriveSession

options ​

DriveListOptions

Returns ​

Promise<DrivePage<DriveItem>>

Implementation of ​

DriveProvider.list


retryAfterFromBody() ​

> retryAfterFromBody(body): number | undefined

Defined in: drives-dropbox/src/provider.ts:508

Dropbox puts its rate-limit hint in the body when it omits Retry-After.

Parameters ​

body ​

string

Returns ​

number | undefined

Implementation of ​

DriveProvider.retryAfterFromBody


startDelta() ​

> startDelta(session, options): Promise<string>

Defined in: drives-dropbox/src/provider.ts:428

See START_CURSOR in this module: the feed starts at the folder, not at "now".

Parameters ​

session ​

DriveSession

options ​
folderId? ​

string

Returns ​

Promise<string>

Implementation of ​

DriveProvider.startDelta


upload() ​

> upload(session, input): Promise<DriveItem>

Defined in: drives-dropbox/src/provider.ts:396

Single-shot upload.

The body is streamed onto the socket, not buffered: holding 150 MB per concurrent upload in memory is how an import pipeline takes a process down. The cap is enforced on the bytes that actually flow, so a source that lies about its size is caught mid-stream rather than trusted.

Files over the cap are refused up front with DRIVE_CONTENT_TOO_LARGE; files/upload_session/* is a documented limitation, not a silent one.

Parameters ​

session ​

DriveSession

input ​

DriveUploadInput

Returns ​

Promise<DriveItem>

Implementation of ​

DriveProvider.upload


verifyNotification() ​

> verifyNotification(input): DriveNotificationResult

Defined in: drives-dropbox/src/provider.ts:461

Dropbox has no per-connection subscription to register, so watch and unwatch are absent rather than throwing: the engine probes for the method and reports DRIVE_UNSUPPORTED, which is the honest answer.

The webhook URI is configured once per app in the App Console and fires for every user who has authorized it. That is why DriveNotificationResult.accountIds exists.

Parameters ​

input ​

DriveNotificationInput

Returns ​

DriveNotificationResult

Implementation of ​

DriveProvider.verifyNotification

Released under the MIT License.