UNPKG

reduct-js

Version:

ReductStore Client SDK for Javascript/NodeJS/Typescript

42 lines (41 loc) 1.12 kB
/** * Represents information about a bucket */ export class BucketInfo { constructor() { /** * Name of the bucket */ this.name = ""; /** * Number of entries in the bucket */ this.entryCount = 0n; /** * Size of stored data in the bucket in bytes */ this.size = 0n; /** * Unix timestamp of the oldest record in microseconds */ this.oldestRecord = 0n; /** * Unix timestamp of the latest record in microseconds */ this.latestRecord = 0n; /** * Is the bucket provisioned, and you can't remove it or change its settings */ this.isProvisioned = false; } static parse(bucket) { return { name: bucket.name, entryCount: BigInt(bucket.entry_count), size: BigInt(bucket.size), oldestRecord: BigInt(bucket.oldest_record), latestRecord: BigInt(bucket.latest_record), isProvisioned: bucket.is_provisioned ?? false, }; } }