Skip to main content

GOOGLE_DRIVE API Reference

Module Information

Service Files:

  • Private: service/private/google_drive.js

Available Services: 9 Documented Services: 8


google_drive.has_drive_scope

Returns { ok: true } when the user already has an oauth_accounts row with drive.readonly scope and a refresh_token.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.has_drive_scope

Returns

FieldTypeDescription
typeany-
propertiesany-

google_drive.connect

Mint the Google OAuth elevation URL (scope=drive.readonly, prompt=consent, access_type=offline). FE opens it in a popup window; the user grants consent; butler.google_drive_callback writes back to oauth_accounts and posts a message to the opener.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.connect

Returns

FieldTypeDescription
typeany-
propertiesany-

google_drive.list

Browse one Google Drive folder for the in-app migration picker tree. Read-only, My Drive only. Returns { files: [{ id, name, is_folder, mime_type, size }], next_page_token }.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.list

Parameters

ParameterTypeRequiredDefaultDescription
folder_idstringNo"root"-
page_tokenstringNo--

Returns

FieldTypeDescription
typeany-
propertiesany-

google_drive.start_migration

Create a migration_jobs row and enqueue the Bull worker. Returns the job_id immediately — the request does NOT wait for the migration to finish.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.start_migration

Parameters

ParameterTypeRequiredDefaultDescription
hub_idstringYes--
nidstringYes--
source_folder_idstringNo"root"-
include_shared_drivesintegerNo0-
conflict_policystringNo"skip"-
modestringNo"all"-
selectionsobjectNo--

Returns

FieldTypeDescription
typeany-
propertiesany-

google_drive.get_status

Poll a Bull job by id. Returns { job_id, status, processed_files, total_files, total_folders, current_filename, errors, attempts, failed_reason, started_at, finished_at } translated from the Bull state machine to the FE popup states (queued / running / done / failed / cancelled / none).

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.get_status

Parameters

ParameterTypeRequiredDefaultDescription
job_idstringYes--

google_drive.cancel

Mark the job cancelled. Removes the job from Bull's waiting queue; an active worker will exit at the next file boundary.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.cancel

Parameters

ParameterTypeRequiredDefaultDescription
job_idintegerYes--

google_drive.dismiss_post_onboarding

Set profile.tools_migration_skipped.google_drive = 1 so the Desk auto-launch doesn't re-show the popup on every reload.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.dismiss_post_onboarding

google_drive.get_state

Consolidated popup-open state so the FE can reconnect to an in-flight migration (or show a just-finished result once) instead of defaulting to the Start screen. Returns { ok (has drive scope), job (shaped getUserJob snapshot or null), seen_job_id (last dismissed result) }.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.get_state

Returns

FieldTypeDescription
typeany-
propertiesany-

google_drive.ack_result

Mark a finished migration result as seen (profile.gdrive_seen_job=job_id) so reopening the popup won't show that result again.

PropertyValue
ScopeHub (requires hub context)
PermissionOwner (32)

Endpoint:

https://hostname/-/svc/google_drive.ack_result

Parameters

ParameterTypeRequiredDefaultDescription
job_idstringYes--