@configurator/ravendb
Version:
RavenDB client for Node.js
92 lines • 3.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryIncludeBuilder = void 0;
const IncludeBuilderBase_1 = require("./IncludeBuilderBase");
const TypeUtil_1 = require("../../../Utility/TypeUtil");
const TimeValue_1 = require("../../../Primitives/TimeValue");
const Constants_1 = require("../../../Constants");
class QueryIncludeBuilder extends IncludeBuilderBase_1.IncludeBuilderBase {
constructor(conventions) {
super(conventions);
}
includeCounter(pathOrName, name) {
if (TypeUtil_1.TypeUtil.isUndefined(name)) {
this._includeCounter("", pathOrName);
}
else {
this._includeCounterWithAlias(pathOrName, name);
}
return this;
}
includeCounters(pathOrNames, names) {
if (TypeUtil_1.TypeUtil.isUndefined(names)) {
this._includeCounters("", pathOrNames);
}
else {
this._includeCounterWithAlias(pathOrNames, names);
}
return this;
}
includeAllCounters(path) {
if (arguments.length === 1) {
this._includeAllCountersWithAlias(path);
}
else {
this._includeAllCounters("");
}
return this;
}
includeDocuments(path) {
this._includeDocuments(path);
return this;
}
includeTimeSeries(nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount, to) {
if (TypeUtil_1.TypeUtil.isArray(nameOrPathOrNames)) {
if (TypeUtil_1.TypeUtil.isNumber(toOrFromOrTimeOrCount)) {
this._includeArrayOfTimeSeriesByRangeTypeAndCount(nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount);
}
else {
this._includeArrayOfTimeSeriesByRangeTypeAndTime(nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount);
}
}
else if (toOrFromOrTimeOrCount instanceof TimeValue_1.TimeValue) {
this._includeTimeSeriesByRangeTypeAndTime("", nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount);
}
else if (TypeUtil_1.TypeUtil.isNumber(toOrFromOrTimeOrCount)) {
this._includeTimeSeriesByRangeTypeAndCount("", nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount);
}
else if (TypeUtil_1.TypeUtil.isString(fromOrNameOrType)) {
this._withAlias();
this._includeTimeSeriesFromTo(nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount, to);
}
else {
this._includeTimeSeriesFromTo("", nameOrPathOrNames, fromOrNameOrType, toOrFromOrTimeOrCount);
}
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);
}
else {
this._includeRevisionsBefore(pathOrDate);
}
return this;
}
}
exports.QueryIncludeBuilder = QueryIncludeBuilder;
//# sourceMappingURL=QueryIncludeBuilder.js.map