@configurator/ravendb
Version:
RavenDB client for Node.js
27 lines • 1.45 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionDocumentRollupTypedTimeSeries = void 0;
const SessionTimeSeriesBase_1 = require("./SessionTimeSeriesBase");
const TypedTimeSeriesRollupEntry_1 = require("./TimeSeries/TypedTimeSeriesRollupEntry");
const TypeUtil_1 = require("../../Utility/TypeUtil");
class SessionDocumentRollupTypedTimeSeries extends SessionTimeSeriesBase_1.SessionTimeSeriesBase {
constructor(session, documentIdOrEntity, name, clazz) {
super(session, documentIdOrEntity, name);
this._clazz = clazz;
}
async get(from, to, start = 0, pageSize = TypeUtil_1.TypeUtil.MAX_INT32) {
if (this._notInCache(from, to)) {
const results = await this.getTimeSeriesAndIncludes(from, to, null, start, pageSize);
return results.map(x => TypedTimeSeriesRollupEntry_1.TypedTimeSeriesRollupEntry.fromEntry(x, this._clazz));
}
const results = await this._getFromCache(from, to, null, start, pageSize);
return results
.map(x => TypedTimeSeriesRollupEntry_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