UNPKG

@configurator/ravendb

Version:
87 lines 3.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IncludeBuilder = void 0; const IncludeBuilderBase_1 = require("./IncludeBuilderBase"); const TypeUtil_1 = require("../../../Utility/TypeUtil"); const Constants_1 = require("../../../Constants"); class IncludeBuilder extends IncludeBuilderBase_1.IncludeBuilderBase { constructor(conventions) { super(conventions); } includeDocuments(path) { this._includeDocuments(path); return this; } includeCounter(pathOrName, name) { if (arguments.length === 1) { this._includeCounter("", pathOrName); } else { this._includeCounterWithAlias(pathOrName, name); } return this; } includeCounters(pathOrNames, names) { if (arguments.length === 1) { this._includeCounters("", pathOrNames); } else { this._includeCounterWithAlias(pathOrNames, names); } return this; } includeAllCounters() { this._includeAllCounters(""); return this; } includeTimeSeries(nameOrNames, fromOrType, toOrTimeOrCount) { if (!fromOrType || fromOrType instanceof Date) { this._includeTimeSeriesFromTo("", nameOrNames, fromOrType, toOrTimeOrCount); } else { if (TypeUtil_1.TypeUtil.isArray(nameOrNames)) { if (TypeUtil_1.TypeUtil.isNumber(toOrTimeOrCount)) { this._includeArrayOfTimeSeriesByRangeTypeAndCount(nameOrNames, fromOrType, toOrTimeOrCount); } else { this._includeArrayOfTimeSeriesByRangeTypeAndTime(nameOrNames, fromOrType, toOrTimeOrCount); } } else { if (TypeUtil_1.TypeUtil.isNumber(toOrTimeOrCount)) { this._includeTimeSeriesByRangeTypeAndCount("", nameOrNames, fromOrType, toOrTimeOrCount); } else { this._includeTimeSeriesByRangeTypeAndTime("", nameOrNames, fromOrType, toOrTimeOrCount); } } } return this; } includeCompareExchangeValue(path) { this._includeCompareExchangeValue(path); return this; } includeAllTimeSeries(type, timeOrCount) { if (TypeUtil_1.TypeUtil.isNumber(timeOrCount)) { this._includeTimeSeriesByRangeTypeAndCount("", Constants_1.TIME_SERIES.ALL, type, timeOrCount); } else { this._includeTimeSeriesByRangeTypeAndTime("", Constants_1.TIME_SERIES.ALL, type, timeOrCount); } return this; } includeRevisions(pathOrDate) { if (TypeUtil_1.TypeUtil.isString(pathOrDate)) { this._withAlias(); this._includeRevisionsByChangeVectors(pathOrDate); return this; } else { this._includeRevisionsBefore(pathOrDate); return this; } } } exports.IncludeBuilder = IncludeBuilder; //# sourceMappingURL=IncludeBuilder.js.map