reveal-sdk-node
Version:
RevealBI Node.js SDK
66 lines (65 loc) • 3.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVDateRange = exports.RVDateFilterType = exports.RVDateDashboardFilter = void 0;
class RVDateDashboardFilter {
constructor(arg1, arg2, arg3) {
this.filterType = RVDateFilterType.CustomRange;
this.range = null;
this.title = null;
//Case: new RVDateDashboardFilter(title, RVDateFilterType, RVDateRange)
if (typeof arg1 === "string" && typeof arg2 === "number" && arg3 instanceof RVDateRange) {
this.title = arg1;
this.filterType = arg2;
this.range = arg3;
}
// Case: new RVDateDashboardFilter("My title", RVDateFilterType)
else if (typeof arg1 === "string" && typeof arg2 === "number") {
this.title = arg1;
this.filterType = arg2;
}
// Case: new RVDateDashboardFilter(RVDateFilterType.Range, new RVDateRange(...))
else if (typeof arg1 === "number" && arg2 instanceof RVDateRange) {
this.filterType = arg1;
this.range = arg2;
}
// Case: new RVDateDashboardFilter(RVDateFilterType)
else if (typeof arg1 === "number" && arg2 === undefined) {
this.filterType = arg1;
}
else {
throw new Error("Invalid constructor arguments");
}
}
}
exports.RVDateDashboardFilter = RVDateDashboardFilter;
var RVDateFilterType;
(function (RVDateFilterType) {
RVDateFilterType[RVDateFilterType["AllTime"] = 0] = "AllTime";
RVDateFilterType[RVDateFilterType["CustomRange"] = 1] = "CustomRange";
RVDateFilterType[RVDateFilterType["LastWeek"] = 2] = "LastWeek";
RVDateFilterType[RVDateFilterType["LastMonth"] = 3] = "LastMonth";
RVDateFilterType[RVDateFilterType["LastYear"] = 4] = "LastYear";
RVDateFilterType[RVDateFilterType["YearToDate"] = 5] = "YearToDate";
RVDateFilterType[RVDateFilterType["QuarterToDate"] = 6] = "QuarterToDate";
RVDateFilterType[RVDateFilterType["MonthToDate"] = 7] = "MonthToDate";
RVDateFilterType[RVDateFilterType["Yesterday"] = 8] = "Yesterday";
RVDateFilterType[RVDateFilterType["Today"] = 9] = "Today";
RVDateFilterType[RVDateFilterType["ThisMonth"] = 10] = "ThisMonth";
RVDateFilterType[RVDateFilterType["ThisQuarter"] = 11] = "ThisQuarter";
RVDateFilterType[RVDateFilterType["ThisYear"] = 12] = "ThisYear";
RVDateFilterType[RVDateFilterType["PreviousMonth"] = 13] = "PreviousMonth";
RVDateFilterType[RVDateFilterType["PreviousQuarter"] = 14] = "PreviousQuarter";
RVDateFilterType[RVDateFilterType["PreviousYear"] = 15] = "PreviousYear";
RVDateFilterType[RVDateFilterType["NextMonth"] = 16] = "NextMonth";
RVDateFilterType[RVDateFilterType["NextQuarter"] = 17] = "NextQuarter";
RVDateFilterType[RVDateFilterType["NextYear"] = 18] = "NextYear";
RVDateFilterType[RVDateFilterType["TrailingTwelveMonths"] = 19] = "TrailingTwelveMonths";
RVDateFilterType[RVDateFilterType["CustomRule"] = 20] = "CustomRule";
})(RVDateFilterType = exports.RVDateFilterType || (exports.RVDateFilterType = {}));
class RVDateRange {
constructor(from, to) {
this.from = from;
this.to = to;
}
}
exports.RVDateRange = RVDateRange;