ravendb
Version:
RavenDB client for Node.js
83 lines • 2.9 kB
JavaScript
import { IncludeBuilderBase } from "./IncludeBuilderBase.js";
import { TypeUtil } from "../../../Utility/TypeUtil.js";
import { TIME_SERIES } from "../../../Constants.js";
export class IncludeBuilder extends 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.isArray(nameOrNames)) {
if (TypeUtil.isNumber(toOrTimeOrCount)) {
this._includeArrayOfTimeSeriesByRangeTypeAndCount(nameOrNames, fromOrType, toOrTimeOrCount);
}
else { // names + time
this._includeArrayOfTimeSeriesByRangeTypeAndTime(nameOrNames, fromOrType, toOrTimeOrCount);
}
}
else { // name
if (TypeUtil.isNumber(toOrTimeOrCount)) {
this._includeTimeSeriesByRangeTypeAndCount("", nameOrNames, fromOrType, toOrTimeOrCount);
}
else { // name + time
this._includeTimeSeriesByRangeTypeAndTime("", nameOrNames, fromOrType, toOrTimeOrCount);
}
}
}
return this;
}
includeCompareExchangeValue(path) {
this._includeCompareExchangeValue(path);
return this;
}
includeAllTimeSeries(type, timeOrCount) {
if (TypeUtil.isNumber(timeOrCount)) {
this._includeTimeSeriesByRangeTypeAndCount("", TIME_SERIES.ALL, type, timeOrCount);
}
else {
this._includeTimeSeriesByRangeTypeAndTime("", TIME_SERIES.ALL, type, timeOrCount);
}
return this;
}
includeRevisions(pathOrDate) {
if (TypeUtil.isString(pathOrDate)) {
this._withAlias();
this._includeRevisionsByChangeVectors(pathOrDate);
return this;
}
else {
this._includeRevisionsBefore(pathOrDate);
return this;
}
}
}
//# sourceMappingURL=IncludeBuilder.js.map