reduct-js
Version:
ReductStore Client SDK for Javascript/NodeJS/Typescript
32 lines (31 loc) • 971 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryLinkOptions = void 0;
const QueryEntry_1 = require("./QueryEntry");
/**
* Represents information about a bucket
*/
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: QueryEntry_1.QueryOptions.serialize(QueryEntry_1.QueryType.QUERY, options.query, start, stop),
expire_at: Math.floor(options.expireAt.getTime() / 1000),
};
}
}
exports.QueryLinkOptions = QueryLinkOptions;