UNPKG

contensis-core-api

Version:

A dependency library used by contensis-delivery-api and contensis-management-api

33 lines (32 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ZenqlQuery = void 0; var ZenqlQuery = /** @class */ (function () { function ZenqlQuery(zenql) { this.zenql = ''; this.pageIndex = 0; this.pageSize = 20; this.fieldLinkDepths = {}; this.fields = []; this.aggregations = {}; this.zenql = zenql; } ZenqlQuery.prototype.toJSON = function () { var result = {}; result.pageIndex = this.pageIndex; result.pageSize = this.pageSize; result.zenql = this.zenql; if (this.fields && this.fields.length > 0) { result.fields = this.fields; } if (this.fieldLinkDepths && Object.keys(this.fieldLinkDepths).length > 0) { result.fieldLinkDepths = this.fieldLinkDepths; } if (this.aggregations && Object.keys(this.aggregations).length > 0) { result.aggregations = this.aggregations; } return result; }; return ZenqlQuery; }()); exports.ZenqlQuery = ZenqlQuery;