UNPKG

kentico-cloud-delivery

Version:

Official Kentico Cloud Delivery SDK

35 lines 1.22 kB
"use strict"; exports.__esModule = true; var models_1 = require("../../models"); var BaseQuery = /** @class */ (function () { function BaseQuery(config, queryService) { this.config = config; this.queryService = queryService; this.parameters = []; } BaseQuery.prototype.customParameter = function (name, value) { this.parameters.push(new models_1.Parameters.CustomParameter(name, value)); return this; }; BaseQuery.prototype.withUrl = function (url) { this.customUrl = url; return this; }; BaseQuery.prototype.getParameters = function () { return this.parameters; }; BaseQuery.prototype.getPromise = function () { return this.getObservable().toPromise(); }; BaseQuery.prototype.resolveUrlInternal = function (action) { // use custom URL if user specified it if (this.customUrl) { return this.customUrl; } // use original url return this.queryService.getUrl(action, this._queryConfig, this.getParameters()); }; return BaseQuery; }()); exports.BaseQuery = BaseQuery; //# sourceMappingURL=base-query.class.js.map