API reference / @evolu/common / local-first / OwnerUsage

Interface: OwnerUsage

Defined in: packages/common/src/local-first/Owner.ts:398

Usage data for an OwnerId.

Tracks storage usage to enforce quotas if needed, and some other stuff.

TODO:

  • Add transferredBytes for billing and monitoring network usage.

Properties

PropertyModifierTypeDescriptionDefined in
firstTimestampreadonly| Uint8Array<ArrayBufferLike> & Brand<"TimestampBytes"> | nullTracks the earliest timestamp for timestamp insertion strategies.packages/common/src/local-first/Owner.ts:419
lastTimestampreadonly| Uint8Array<ArrayBufferLike> & Brand<"TimestampBytes"> | nullTracks the latest timestamp for timestamp insertion strategies. Free relays can use it to identify inactive accounts for cleanup.packages/common/src/local-first/Owner.ts:426
ownerIdreadonlyUint8Array<ArrayBufferLike> & Brand<"Length16"> & Brand<"IdBytes"> & Brand<"OwnerIdBytes">The Owner this usage data belongs to.packages/common/src/local-first/Owner.ts:400
storedBytesreadonlynumber & Brand<"Int"> & Brand<"NonNegative">Total logical data bytes stored. Measures the size of EncryptedDbChanges only, excluding Storage implementation overhead (with SqliteStorage: indexes, skiplist columns, etc.). This provides: - Predictable measurement - same data = same byte count across all instances - Quota enforcement - consistent billing/limits independent of storage implementation - Overhead tracking - actual Storage size can be compared against this to monitor efficiencypackages/common/src/local-first/Owner.ts:416

Was this page helpful?