@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
140 lines (139 loc) • 5.77 kB
TypeScript
import type { MapCultureTo } from "../../base-types";
import { ConditionalValidationResource } from "../../models/conditional-validation-resource";
import { IMemberDefinition, MemberDefinition } from "./member-definition";
import { MemberDefinitionType } from "./member-definition-type";
import { RelationCardinality } from "./relation-cardinality";
import { RelationRole } from "./relation-role";
/**
* Represents a data schema / domain model for relations on an {@link IEntityDefinition}.
*/
export interface IRelationDefinition extends IMemberDefinition {
/**
* Role of the relation on the {@link IEntityDefinition}.
* Parent and child entity definitions share the same conceptual relation definition.
*/
role: RelationRole;
/**
* Cardinality of the relation from the parent's point of view.
*/
cardinality: RelationCardinality;
/**
* Name of the {@link IEntityDefinition} that is linked to the other end ({@link RelationRole}) of this
* relation definition.
*/
associatedEntityDefinitionName: string;
/**
* Indicates whether relations of this definition must have at least one child.
*/
childIsMandatory: boolean;
/**
* An optional set of conditions that dictate under what conditions the the child of this relation should be required.
*/
childConditionalValidation?: ConditionalValidationResource;
/**
* Indicates whether relations of this definition must have at least one parent.
*/
parentIsMandatory: boolean;
/**
* An optional set of conditions that dictate under what conditions the the parent of this relation should be required.
*/
parentConditionalValidation?: ConditionalValidationResource;
/**
* Indicates if this relation is used to inherit any security related meta data (parents -\> children).
*/
inheritsSecurity: boolean;
/**
* Indicates whether this relation can be used for navigation to parents or children in the external services
* (e.g. REST API). This can prevent potentially serious memory intensive operations.
*/
allowNavigation: boolean;
/**
* Indicates whether the relation allows nesting of properties on the associated entity when accessed via the
* external services (e.g. REST API).
*/
isNested: boolean;
/**
* Collection of the property names of the associated entity to be used for nesting.
*/
nestedProperties: Array<string>;
/**
* Indicates whether permissions are included when nesting this relation in an external service, in similar fashion
* as with property nesting.
*/
nestedPermissions: boolean;
/**
* Indicates whether the relation establishes a taxonomy.
*/
isTaxonomyRelation: boolean;
/**
* Indicates if the relation provides a link between parent and child taxonomy entities of the same entity
* definition, thus creating a taxonomy hierarchy.
*/
isTaxonomyHierarchyRelation: boolean;
/**
* Indicates if the child of the relation copies full text search content of the ancestors connected via such marked
* relations into its full text search
* content.
*/
contentIsCopied: boolean;
/**
* Indicates whether the child of the relation copies words collection, used for the auto–complete, of the ancestors
* connected via such marked relations into its collection of words used for the auto-complete functionality.
*/
completionIsCopied: boolean;
/**
* Indicates whether this relation provides a link between a parent entity with
* {@link IEntityDefinition.isPathEnabledDefinition} or an entity with such an ancestor.
*/
isPathRelation: boolean;
/**
* Indicates whether this relation provides a link between {@link IEntityDefinition.isPathEnabledDefinition}
* thus creating a path hierarchy.
*/
isPathHierarchyRelation: boolean;
/**
* Score given to the relation which is marked as {@link IsPathHierarchyRelation}.
* If entity has multiple parent hierarchy relations, the paths of entity will be sorted according to this score in
* ascending way. The first path, if not marked otherwise, will be used as a sole entity path when only one path is
* required.
*/
pathHierarchyScore: string;
/**
* Indicates whether this relation can be used to retrieve renditions.
*/
isRenditionRelation: boolean;
/**
* Collection of the culture specific member labels of the associated relation definition.
*/
associatedLabels: MapCultureTo<string>;
/**
* Indicates whether this relation is multi-value or not.
*/
isMultiValue: boolean;
}
export declare class RelationDefinition extends MemberDefinition implements IRelationDefinition {
role: RelationRole;
cardinality: RelationCardinality;
associatedEntityDefinitionName: string;
childIsMandatory: boolean;
childConditionalValidation?: ConditionalValidationResource;
parentIsMandatory: boolean;
parentConditionalValidation?: ConditionalValidationResource;
inheritsSecurity: boolean;
allowNavigation: boolean;
isNested: boolean;
nestedProperties: Array<string>;
nestedPermissions: boolean;
isTaxonomyRelation: boolean;
isTaxonomyHierarchyRelation: boolean;
contentIsCopied: boolean;
completionIsCopied: boolean;
isPathRelation: boolean;
isPathHierarchyRelation: boolean;
pathHierarchyScore: string;
isRenditionRelation: boolean;
associatedLabels: MapCultureTo<string>;
get definitionType(): MemberDefinitionType;
get isMultiValue(): boolean;
constructor(name: string, init?: Omit<Partial<RelationDefinition>, "name">);
}