@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
87 lines • 4.55 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var QueryLoadConfiguration_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryLoadConfiguration = void 0;
const ta_json_1 = require("ta-json");
const culture_load_option_1 = require("./culture-load-option");
const property_load_option_1 = require("./property-load-option");
const relation_load_option_1 = require("./relation-load-option");
let QueryLoadConfiguration = QueryLoadConfiguration_1 = class QueryLoadConfiguration {
//#endregion
constructor(init) {
this.loadEntities = false;
Object.assign(this, init);
if (init != null && init.loadEntities == null) {
this.loadEntities = true;
}
}
deepClone() {
const result = new QueryLoadConfiguration_1();
result.loadEntities = this.loadEntities;
result.cultureLoadOption = this.cultureLoadOption && this.cultureLoadOption.deepClone();
result.propertyLoadOption = this.propertyLoadOption && this.propertyLoadOption.deepClone();
result.relationLoadOption = this.relationLoadOption && this.relationLoadOption.deepClone();
return result;
}
};
exports.QueryLoadConfiguration = QueryLoadConfiguration;
//#region Configurations
QueryLoadConfiguration.Ids = new QueryLoadConfiguration_1({
cultureLoadOption: culture_load_option_1.CultureLoadOption.None,
propertyLoadOption: property_load_option_1.PropertyLoadOption.None,
relationLoadOption: relation_load_option_1.RelationLoadOption.None,
loadEntities: false,
});
QueryLoadConfiguration.Minimal = new QueryLoadConfiguration_1({
cultureLoadOption: culture_load_option_1.CultureLoadOption.None,
propertyLoadOption: property_load_option_1.PropertyLoadOption.None,
relationLoadOption: relation_load_option_1.RelationLoadOption.None,
});
QueryLoadConfiguration.Default = new QueryLoadConfiguration_1({
cultureLoadOption: culture_load_option_1.CultureLoadOption.Default,
propertyLoadOption: property_load_option_1.PropertyLoadOption.All,
relationLoadOption: relation_load_option_1.RelationLoadOption.None,
});
QueryLoadConfiguration.DefaultCultureFull = new QueryLoadConfiguration_1({
cultureLoadOption: culture_load_option_1.CultureLoadOption.Default,
propertyLoadOption: property_load_option_1.PropertyLoadOption.All,
relationLoadOption: relation_load_option_1.RelationLoadOption.All,
});
QueryLoadConfiguration.Full = new QueryLoadConfiguration_1({
cultureLoadOption: culture_load_option_1.CultureLoadOption.All,
propertyLoadOption: property_load_option_1.PropertyLoadOption.All,
relationLoadOption: relation_load_option_1.RelationLoadOption.All,
});
__decorate([
(0, ta_json_1.JsonProperty)("load_entities"),
__metadata("design:type", Boolean)
], QueryLoadConfiguration.prototype, "loadEntities", void 0);
__decorate([
(0, ta_json_1.JsonProperty)("culture_option"),
(0, ta_json_1.JsonType)(culture_load_option_1.CultureLoadOption),
__metadata("design:type", Object)
], QueryLoadConfiguration.prototype, "cultureLoadOption", void 0);
__decorate([
(0, ta_json_1.JsonProperty)("property_option"),
(0, ta_json_1.JsonType)(property_load_option_1.PropertyLoadOption),
__metadata("design:type", Object)
], QueryLoadConfiguration.prototype, "propertyLoadOption", void 0);
__decorate([
(0, ta_json_1.JsonProperty)("relation_option"),
(0, ta_json_1.JsonType)(relation_load_option_1.RelationLoadOption),
__metadata("design:type", Object)
], QueryLoadConfiguration.prototype, "relationLoadOption", void 0);
exports.QueryLoadConfiguration = QueryLoadConfiguration = QueryLoadConfiguration_1 = __decorate([
(0, ta_json_1.JsonObject)(),
__metadata("design:paramtypes", [Object])
], QueryLoadConfiguration);
//# sourceMappingURL=query-load-configuration.js.map