ravendb
Version:
RavenDB client for Node.js
28 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionDocumentRollupTypedTimeSeries = void 0;
const SessionTimeSeriesBase_js_1 = require("./SessionTimeSeriesBase.js");
const TypedTimeSeriesRollupEntry_js_1 = require("./TimeSeries/TypedTimeSeriesRollupEntry.js");
const TypeUtil_js_1 = require("../../Utility/TypeUtil.js");
class SessionDocumentRollupTypedTimeSeries extends SessionTimeSeriesBase_js_1.SessionTimeSeriesBase {
_clazz;
constructor(session, documentIdOrEntity, name, clazz) {
super(session, documentIdOrEntity, name);
this._clazz = clazz;
}
async get(from, to, start = 0, pageSize = TypeUtil_js_1.TypeUtil.MAX_INT32) {
if (this._notInCache(from, to)) {
const results = await this.getTimeSeriesAndIncludes(from, to, null, start, pageSize);
return results.map(x => TypedTimeSeriesRollupEntry_js_1.TypedTimeSeriesRollupEntry.fromEntry(x, this._clazz));
}
const results = await this._getFromCache(from, to, null, start, pageSize);
return results
.map(x => TypedTimeSeriesRollupEntry_js_1.TypedTimeSeriesRollupEntry.fromEntry(x, this._clazz));
}
append(entry) {
const values = entry.getValuesFromMembers();
this._appendInternal(entry.timestamp, values, entry.tag);
}
}
exports.SessionDocumentRollupTypedTimeSeries = SessionDocumentRollupTypedTimeSeries;
//# sourceMappingURL=SessionDocumentRollupTypedTimeSeries.js.map