UNPKG

kentico-cloud-delivery

Version:

Official Kentico Cloud Delivery SDK

53 lines 2.24 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { BaseQuery } from '../common/base-query.class'; var BaseTypeQuery = /** @class */ (function (_super) { __extends(BaseTypeQuery, _super); function BaseTypeQuery(config, queryService) { var _this = _super.call(this, config, queryService) || this; _this.config = config; _this.queryService = queryService; _this.parameters = []; _this._queryConfig = {}; return _this; } /** * Used to configure query * @param queryConfig Query configuration */ BaseTypeQuery.prototype.queryConfig = function (queryConfig) { this._queryConfig = queryConfig; return this; }; /** * Gets headers used by this query */ BaseTypeQuery.prototype.getHeaders = function () { return this.queryService.getHeaders(this._queryConfig); }; BaseTypeQuery.prototype.getSingleTypeQueryUrl = function (codename) { var action = '/types/' + codename; return _super.prototype.resolveUrlInternal.call(this, action); }; BaseTypeQuery.prototype.getMultipleTypesQueryUrl = function () { var action = '/types'; return _super.prototype.resolveUrlInternal.call(this, action); }; BaseTypeQuery.prototype.runMultipleTypesQuery = function () { return this.queryService.getMultipleTypes(this.getMultipleTypesQueryUrl(), this._queryConfig); }; BaseTypeQuery.prototype.runSingleTypeQuery = function (codename) { return this.queryService.getSingleType(this.getSingleTypeQueryUrl(codename), this._queryConfig); }; return BaseTypeQuery; }(BaseQuery)); export { BaseTypeQuery }; //# sourceMappingURL=base-type-query.class.js.map