reduct-js
Version:
ReductStore Client SDK for Javascript/NodeJS/Typescript
28 lines (27 loc) • 805 B
JavaScript
import { QueryOptions, QueryType } from "./QueryEntry";
/**
* Represents information about a bucket
*/
export class QueryLinkOptions {
constructor() {
/** bucket name */
this.bucket = "";
/** entry name */
this.entry = "";
/** record index */
this.index = 0;
/** query */
this.query = {};
/** expiration time as UNIX timestamp in seconds */
this.expireAt = new Date(0);
}
static serialize(options, start, stop) {
return {
bucket: options.bucket,
entry: options.entry,
index: options.index,
query: QueryOptions.serialize(QueryType.QUERY, options.query, start, stop),
expire_at: Math.floor(options.expireAt.getTime() / 1000),
};
}
}