dc-management-sdk-js
Version:
Amplience Dynamic Content Management SDK
78 lines (77 loc) • 2.13 kB
TypeScript
import { ContentItemPublishingStatus } from './PublishingStatus';
import { HalResource } from '../hal/models/HalResource';
import { HierarchyParents } from './HierarchyParents';
import { HierarchyChildren } from './HierarchyChildren';
import { ContentItem } from './ContentItem';
export type HierarchyNodeModel = HierarchyMeta & {
/**
* Unique id generated on creation
*/
id: string;
/**
* Friendly label for the content item
*/
label: string;
/**
* Unique id of the repository this content item is saved within
*/
repositoryId: string;
/**
* Schema URI of the content item
*/
contentTypeUri: string;
/**
* Boolean to denote weather the hierarchy node has children
*/
hasChildren: boolean;
/**
* publishing status of the content item
*
* NONE - hasn't been published before
*
* EARLY - changes have been made since last publish
*
* LATEST - no changes have been made since last publish
*/
publishingStatus: ContentItemPublishingStatus | string;
};
export interface HierarchyMeta {
/**
* Unique id of the parent node
*/
parentId?: string;
/**
* Boolean denoting if this is the root of a hierarchy
*/
root: boolean;
}
export declare class HierarchyNode extends HalResource implements HierarchyNodeModel {
id: string;
label: string;
parentId?: string;
repositoryId: string;
contentTypeUri: string;
root: boolean;
hasChildren: boolean;
publishingStatus: ContentItemPublishingStatus | string;
related: {
contentItem: {
/**
* Retrieve the content item associated with this node
*/
get: () => Promise<ContentItem>;
};
children: {
/**
* Retrieve children of the associated node
*/
get: () => Promise<HierarchyChildren>;
};
parents: {
/**
* Retrieve parents of the associated node
*/
get: () => Promise<HierarchyParents>;
};
};
}