Providers
Providers define how Drive reads, mutates, uploads, and opens files.
Drive uses provider contracts so the UI does not need to know how storage is implemented.
Shared contract idea
The package defines a base DriveReader plus optional capabilities such as:
DriveNodeMutationsDriveDirectUploadDrivePresignedUploadDrivePreviewGeneratorDriveReadonlyDriveArchive
This is not just a docs abstraction. These contracts match the way the package is split in code:
- shared validators and DTO types live in
@tulip-systems/drive - provider-specific schemas and commands live in
.../localand.../google - client shells consume a provider-shaped node model without caring where it came from
Local provider
Use the local provider when your product owns:
- persistence
- upload sessions
- preview generation
- serving URLs
- archive and readonly policies
The local provider is the richer implementation today. It includes:
- upload intents and confirmation
- a route handler for opening files
- private/public asset visibility handling
- optimistic upload state
- archive and readonly toggles
Google provider
Use the Google provider when your product should work directly against a Google Drive tree while still rendering the same style of interface.
The Google provider maps Google-specific fields into the shared node model, while still exposing provider-specific metadata such as:
googleDriveIdmimeTypewebViewLinkwebContentLinkthumbnailLinktrashed/trashedAtgoogleParentscanEdit
How to choose
Choose local when your app is the source of truth.
Choose google when Google Drive is the source of truth.
Avoid building a generic screen that assumes both providers behave identically around:
- upload flow
- URL generation
- archive semantics
- readonly enforcement
- remote consistency and caching