ByteShelfCommon 3.1.0
See the version list below for details.
dotnet add package ByteShelfCommon --version 3.1.0
NuGet\Install-Package ByteShelfCommon -Version 3.1.0
<PackageReference Include="ByteShelfCommon" Version="3.1.0" />
<PackageVersion Include="ByteShelfCommon" Version="3.1.0" />
<PackageReference Include="ByteShelfCommon" />
paket add ByteShelfCommon --version 3.1.0
#r "nuget: ByteShelfCommon, 3.1.0"
#:package ByteShelfCommon@3.1.0
#addin nuget:?package=ByteShelfCommon&version=3.1.0
#tool nuget:?package=ByteShelfCommon&version=3.1.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. |
FileCriteria |
Which of a shelf's files a search looks at: the directory, text, type, sizes, times, SHA-256, whether it has a description, and what the server read from the contents (taken times, a GPS position, durations, page counts), checked by NormalizeCriteria. Both searches below take their criteria from it. |
FileSearch, FileSearchResults |
The files that meet the criteria, a page at a time by path, and one page of them. |
DuplicateSearch, DuplicateSearchResults, DuplicateGroup, DuplicateCursor |
The groups of plain, non-empty files with the same contents among those that meet the criteria, a page of groups at a time, most repeated bytes first, and where a page ended. DuplicateSearchResults.Page groups, orders and pages them, for the server and the in-memory client alike. |
DownloadLink |
A link to a file's contents that works without a token until it runs out or is revoked, with its id, 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, with its id, and asking for one (Lifetime: 15 minutes by default, at most 24 hours). |
ShelfLink, ShelfLinkKind, LinkMaker, LinkMakerKind |
A download or upload link as listed, to revoke by its id: what it reaches, who made it, and when it runs out. |
FileMetadata |
What the server read from a file's contents (when and where a photo was taken, the camera, a video's length, a PDF's title and pages), and whether it reads that file at all (Readable). |
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. |
ShelfGrants |
ValidatePermission, which refuses a value that is no ShelfAccessPermission. |
ShelfKeyInfo, ShelfKeyGrantInfo, CreateShelfKeyRequest, CreatedShelfKey, SetShelfKeyGrantRequest, ShelfKeyPermission |
A program's key with the shelves it works on and what it may do on each, creating one on a shelf, and giving it another. |
ShelfKeys |
The X-Api-Key header a key is sent in, the secret's prefix, which also tells a key sent as the bearer token from a session token, and ValidatePermission, which refuses a value that is no ShelfKeyPermission. |
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. |
ServerVersion, ReleaseVersion |
The release a server runs, which only signed-in users and keys may read, and reading an assembly's release from its informational version, without the commit after the +. |
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.FileCriteria.NormalizeCriteriachecks the criteria: sizes, durations and page counts not negative, a duration a finite number of seconds, ranges not empty (a time range includes its start and excludes its end; sizes, durations and page counts are inclusive), a content type that is one media type or a family such asimage/*, and a SHA-256 of 64 hex digits.FileSearch.Normalizeadds a page of 1 to 1,000 files (100 by default), andDuplicateSearch.Normalizea page of 1 to 1,000 groups (100 by default).Foldis how search compares text, both sides: normalization form C, then invariant lowercase.ContentHashchecks a SHA-256 named in a request (64 hex digits, in either case) and answers it lowercase, as the server stores it.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, and a lifetime withinUploadLink.Lifetime.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,ContentHash,ContentTypes,FileDescription,FileSearch,DuplicateSearch, 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 |
Adds ServerVersion, the release a ByteShelf server runs with its deploy id, as its api/version/release answers it to a signed-in user or a shelf key, and ReleaseVersion, which reads an assembly's release from its informational version without the commit after the +. ShelfGrants.ValidatePermission refuses a value that is no ShelfAccessPermission with ArgumentException naming the parameter, as ShelfKeys.ValidatePermission does for a key's. See https://github.com/AdamTovatt/byte-shelf/blob/client-v3.1.0/ByteShelfCommon/README.md