Shared TypeScript types and utilities for dosya.dev clients.
This package is not published to the npm registry. It is an internal workspace package of the dosya.dev monorepo, consumed through a local path dependency:
"dependencies": {
"@dosya-dev/shared": "file:../../packages/shared"
}Do not run npm install @dosya-dev/shared: the @dosya-dev scope carries no
packages, so that command can only ever resolve to something we did not
publish.
import type { User, FileItem, Workspace, ApiResponse } from '@dosya-dev/shared'User- User profile (email, name, subscription, avatar)Session- Device session with IP and location
Workspace- Workspace metadataWorkspaceMember- Member with role and join dateWorkspaceSettings- Storage limits, upload settings, security policies
FileItem- File metadata (name, size, mime type, locked/hidden)FolderItem- Folder metadataFileVersion- File version historyFileInfo- Minimal file info for share linksFolderTreeNode- Recursive folder tree
ShareLink- Share link with token, password, expiryFileRequest- File request inbox
ActivityLog- User action logsDashboardStats- Aggregated metricsDashboardData- Full dashboard payload
PlanId-"free" | "starter" | "plus" | "pro" | "business"Subscription- Plan status and period info
ApiSuccess<T>- Success response wrapperApiError- Error responseApiResponse<T>- Union of success/errorPaginatedResponse<T>- Paginated list
import { nowUnix, formatBytes, isValidEmail, validatePassword } from '@dosya-dev/shared'
nowUnix() // Current Unix timestamp (seconds)
formatBytes(1048576) // "1.00 MB"
isValidEmail('a@b.com') // true
validatePassword('abc') // "Password must be at least 8 characters"Every dosya.dev client is source-available. Your files are yours - this repository lets you verify exactly what our clients send to and receive from our servers: what gets uploaded, what metadata travels with it, and what comes back. If a claim we make about privacy or sync behavior can't be verified in this code, open an issue and call it out.
Source-available under the Dosya Source Available License 1.0:
- You can read and audit the code, use it when building and running the official dosya.dev clients, and contribute improvements.
- You can't redistribute it, use it with any backend other than dosya.dev, or offer it as a service. Building your own integration? Use the MIT-licensed dosya-js or dosya-java SDKs instead.
See LICENSE for the exact terms. Versions of this code previously published under the MIT license remain MIT for those who obtained them then.
Issues and pull requests are welcome. By submitting a contribution you license it to dosya.dev under the contribution terms in LICENSE.
Found a vulnerability? Please report it privately via GitHub private vulnerability reporting rather than a public issue.
| Repository | What it is | License |
|---|---|---|
| desktop | Desktop client - sync, upload, manage | Source-available |
| cli | Command-line interface | Source-available |
| app.dosya.dev | Web application | Source-available |
| shared | Shared TypeScript types & utilities | Source-available |
| dosya-js | Official JavaScript SDK | MIT |
| dosya-java | Official Java SDK | MIT |