kentico-cloud-delivery
Version:
Official Kentico Cloud Delivery SDK
101 lines • 4.27 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { map } from 'rxjs/operators';
import { BaseDeliveryQueryService } from './base-delivery-query.service';
var QueryService = /** @class */ (function (_super) {
__extends(QueryService, _super);
function QueryService(config, httpService, sdkInfo, mappingService) {
return _super.call(this, config, httpService, sdkInfo, mappingService) || this;
}
/**
* Gets single item from given url
* @param url Url used to get single item
* @param queryConfig Query configuration
*/
QueryService.prototype.getSingleItem = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.viewContentItemResponse(response, queryConfig);
}));
};
/**
* Gets multiple items from given url
* @param url Url used to get multiple items
* @param queryConfig Query configuration
*/
QueryService.prototype.getMultipleItems = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.listContentItemsResponse(response, queryConfig);
}));
};
/**
* Gets single content type from given url
* @param url Url used to get single type
* @param queryConfig Query configuration
*/
QueryService.prototype.getSingleType = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.viewContentTypeResponse(response);
}));
};
/**
* Gets multiple content types from given url
* @param url Url used to get multiple types
* @param queryConfig Query configuration
*/
QueryService.prototype.getMultipleTypes = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.listContentTypesResponse(response);
}));
};
/**
* Gets single taxonomy from given url
* @param url Url used to get single taxonomy
* @param queryConfig Query configuration
*/
QueryService.prototype.getTaxonomy = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.viewTaxonomyGroupResponse(response);
}));
};
/**
* Gets multiple taxonomies from given url
* @param url Url used to get multiple taxonomies
* @param queryConfig Query configuration
*/
QueryService.prototype.getTaxonomies = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.listTaxonomyGroupsResponse(response);
}));
};
/**
* Gets single content type element from given url
* @param url Url used to get single content type element
* @param queryConfig Query configuration
*/
QueryService.prototype.getElement = function (url, queryConfig) {
var _this = this;
return this.getResponse(url, queryConfig).pipe(map(function (response) {
return _this.mappingService.viewContentTypeElementResponse(response);
}));
};
return QueryService;
}(BaseDeliveryQueryService));
export { QueryService };
//# sourceMappingURL=delivery-query.service.js.map