ByteShelfCommon 2.0.0
See the version list below for details.
dotnet add package ByteShelfCommon --version 2.0.0
NuGet\Install-Package ByteShelfCommon -Version 2.0.0
<PackageReference Include="ByteShelfCommon" Version="2.0.0" />
<PackageVersion Include="ByteShelfCommon" Version="2.0.0" />
<PackageReference Include="ByteShelfCommon" />
paket add ByteShelfCommon --version 2.0.0
#r "nuget: ByteShelfCommon, 2.0.0"
#:package ByteShelfCommon@2.0.0
#addin nuget:?package=ByteShelfCommon&version=2.0.0
#tool nuget:?package=ByteShelfCommon&version=2.0.0
ByteShelfCommon
The contract shared by the ByteShelf server and its clients: the request and response types they exchange, the rules for paths and shelf names, and source-generated JSON. Targets net8.0 and is AOT-compatible.
Types
| Type | What it is |
|---|---|
ShelfInfo |
A shelf with its quota and usage. |
CreateShelfRequest, UpdateShelfRequest |
Creates a shelf, and replaces its name and quota. |
ShelfFile |
A file's record: id, path, size, content type, SHA-256, timestamps, description, and whether its contents are encrypted (Encrypted). |
SetDescriptionRequest, FileDescription |
Setting a file's description, and its rules. |
FileSearch, FileSearchResults |
What to look for among a shelf's files, and one page of what was found. |
DownloadLink |
A link to a file's contents that works without a token until it runs out, and the bounds of its lifetime (Lifetime: a day by default, at most 7 days). |
UploadLink, CreateUploadLinkRequest, NormalizedUploadLinkRequest |
A link that stores one file sent to it without a token, and asking for one (Lifetime: 15 minutes by default, at most 24 hours). |
LinkLifetime |
One kind of link's lifetime rule: its default, its bounds and Normalize. |
FileEncryption, EncryptedFolder, PathEncryption, SetFolderEncryptionRequest |
Password encryption: how an age file starts, an encrypted directory's check text, an encrypted directory with its check, what a path is encrypted under, and encrypting a directory. |
ShelfDirectory, DirectoryListing, ListedDirectory |
A directory and whether it is encrypted (Encrypted), what one holds, and a directory in a listing with the size and count of the files under it, and how many are encrypted. |
TreeQuery, DirectoryTree, TreeEntry |
What to list of everything under a directory (a depth, a page), one page of it, and one entry of a page, a directory or a file. |
StoredOrder |
The order names and paths are listed in: by code point, as the server's database sorts them. |
CreateDirectoryRequest, MoveRequest |
Creates a directory; moves or renames a file or directory. |
StartUploadRequest, StartContentSwapRequest, UploadSession |
Starting and following a resumable upload, of a new file or swapping a file's contents in place. |
TrashEntry, TrashEntryKind |
A deletion that can still be restored. |
ShelfAccessGrant, SetShelfAccessRequest, ShelfAccessPermission |
A user's access to a shelf, and giving it. |
ShelfKeyInfo, CreateShelfKeyRequest, CreatedShelfKey, ShelfKeyPermission |
A program's key to one shelf, and creating one. |
ShelfKeys |
The X-Api-Key header a key is sent in, and the secret's prefix, which also tells a key sent as the bearer token from a session token. |
EntryReference |
Names a file or directory by path or by id; a path or an id converts to one. |
UserInfo, CreateUserRequest, UpdateRolesRequest, UpdatePasswordRequest, UserRoles |
Users and changing them. |
RequestPasswordResetRequest, CompletePasswordResetRequest |
Asking for a reset link, and using it. |
SignInRequest, SessionTokens, RefreshTokenRequest |
Signing in, refreshing and signing out at /api/auth. |
ReplicationStatus, ReplicaInfo, ReplicationSourceInfo, PairingCodeResponse, PairWithPrimaryRequest, PromoteResponse |
A server's replicas or the primary it follows, pairing one, and promoting it. |
ErrorResponse, ErrorCodes |
Every error body, with a machine-readable code. |
UploadLimits |
The server's limits, such as the largest chunk. |
Rules
ShelfPathnormalizes and validates paths inside a shelf: a leading/, names separated by/, no empty names,.,.., backslashes, control or invisible formatting characters, and every name in Unicode normalization form C. Names that are valid on a shelf are not always valid file names on every operating system (Windows refusesCONand a trailing dot), so a client that writes files to disk maps them itself.ShelfNamevalidates shelf names: 1 to 63 lowercase letters, digits,-,_and., starting with a letter or digit.ShelfSettingsadds that a quota cannot be negative.FileDescriptiontrims a description and puts it in normalization form C; blank is none, and it holds at most 2,000 characters, counted as code points.FileSearch.Normalizechecks a search: a page of 1 to 1,000 files (100 by default), sizes not negative and ranges not empty (a range includes its start and excludes its end), a content type that is one media type or a family such asimage/*, and a SHA-256 of 64 hex digits.Foldis how search compares text, both sides: normalization form C, then invariant lowercase.ContentTypeschecks the media type stored with a file, andForUploadpicks it when an upload gives none: the one its path's extension names, elseapplication/octet-stream.NormalizedUploadLinkRequest.Createchecks an upload link's request: a file's path (never the root), a description, a lifetime withinUploadLink.Lifetime, and at most 4,096 bytes of UTF-8 for the path and description together, since the link's URL carries both.PasswordPolicychecks a password,UserFieldsan email and display name,DisplayTextshort names such as a key's, andUserRolesa user's roles.- The server applies every rule, and so does the in-memory client in ByteShelfClient. The HTTP
client applies
ShelfPath,ContentTypes,FileDescription,FileSearch, the link lifetimes andNormalizedUploadLinkRequestbefore sending, since they shape the request, and leaves the rest to the server.
JSON
ByteShelfCommon.Serialization.ByteShelfJsonContext serializes every type without reflection, in
camelCase like the server. Enums are written as camelCase strings and read back ignoring case, by
CamelCaseEnumConverter, set on each enum type so the server and every client agree.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ByteShelfCommon:
| Package | Downloads |
|---|---|
|
ByteShelfClient
Client for ByteShelf, a self-hosted file store: an interface over shelves, files and directories, an HTTP implementation, and an in-memory one for tests. |
|
|
EasyReasy.ByteShelfProvider
Enables resources from ByteShelf for EasyReasy |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1 | 44 | 11/26/2026 |
| 4.0.0 | 55 | 11/25/2026 |
| 3.1.0 | 77 | 11/20/2026 |
| 3.0.0 | 69 | 11/20/2026 |
| 2.2.0 | 186 | 11/20/2026 |
| 2.1.0 | 114 | 11/19/2026 |
| 2.0.0 | 150 | 11/15/2026 |
| 1.3.0 | 559 | 10/12/2025 |
| 1.2.2 | 490 | 7/14/2025 |
| 1.2.1 | 252 | 7/13/2025 |
| 1.2.0 | 239 | 7/13/2025 |
| 1.1.1 | 257 | 7/11/2025 |
| 1.1.0 | 281 | 7/3/2025 |
| 1.0.0 | 267 | 6/18/2025 |