UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

84 lines 3.86 kB
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; import { JsonObject, JsonProperty, JsonType } from "ta-json"; import { CultureLoadOption } from "./culture-load-option"; import { PropertyLoadOption } from "./property-load-option"; import { RelationLoadOption } from "./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; } }; //#region Configurations QueryLoadConfiguration.Ids = new QueryLoadConfiguration_1({ cultureLoadOption: CultureLoadOption.None, propertyLoadOption: PropertyLoadOption.None, relationLoadOption: RelationLoadOption.None, loadEntities: false, }); QueryLoadConfiguration.Minimal = new QueryLoadConfiguration_1({ cultureLoadOption: CultureLoadOption.None, propertyLoadOption: PropertyLoadOption.None, relationLoadOption: RelationLoadOption.None, }); QueryLoadConfiguration.Default = new QueryLoadConfiguration_1({ cultureLoadOption: CultureLoadOption.Default, propertyLoadOption: PropertyLoadOption.All, relationLoadOption: RelationLoadOption.None, }); QueryLoadConfiguration.DefaultCultureFull = new QueryLoadConfiguration_1({ cultureLoadOption: CultureLoadOption.Default, propertyLoadOption: PropertyLoadOption.All, relationLoadOption: RelationLoadOption.All, }); QueryLoadConfiguration.Full = new QueryLoadConfiguration_1({ cultureLoadOption: CultureLoadOption.All, propertyLoadOption: PropertyLoadOption.All, relationLoadOption: RelationLoadOption.All, }); __decorate([ JsonProperty("load_entities"), __metadata("design:type", Boolean) ], QueryLoadConfiguration.prototype, "loadEntities", void 0); __decorate([ JsonProperty("culture_option"), JsonType(CultureLoadOption), __metadata("design:type", Object) ], QueryLoadConfiguration.prototype, "cultureLoadOption", void 0); __decorate([ JsonProperty("property_option"), JsonType(PropertyLoadOption), __metadata("design:type", Object) ], QueryLoadConfiguration.prototype, "propertyLoadOption", void 0); __decorate([ JsonProperty("relation_option"), JsonType(RelationLoadOption), __metadata("design:type", Object) ], QueryLoadConfiguration.prototype, "relationLoadOption", void 0); QueryLoadConfiguration = QueryLoadConfiguration_1 = __decorate([ JsonObject(), __metadata("design:paramtypes", [Object]) ], QueryLoadConfiguration); export { QueryLoadConfiguration }; //# sourceMappingURL=query-load-configuration.js.map