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
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
firstTimestamp | readonly | | Uint8Array<ArrayBufferLike> & Brand<"TimestampBytes"> | null | Tracks the earliest timestamp for timestamp insertion strategies. | packages/common/src/local-first/Owner.ts:419 |
lastTimestamp | readonly | | Uint8Array<ArrayBufferLike> & Brand<"TimestampBytes"> | null | Tracks 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 |
ownerId | readonly | Uint8Array<ArrayBufferLike> & Brand<"Length16"> & Brand<"IdBytes"> & Brand<"OwnerIdBytes"> | The Owner this usage data belongs to. | packages/common/src/local-first/Owner.ts:400 |
storedBytes | readonly | number & 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 efficiency | packages/common/src/local-first/Owner.ts:416 |