reduct-js
Version:
ReductStore Client SDK for Javascript/NodeJS/Typescript
46 lines (45 loc) • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BucketInfo = void 0;
/**
* Represents information about a bucket
*/
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,
};
}
}
exports.BucketInfo = BucketInfo;