dc-management-sdk-js
    Preparing search index...

    Class ContentItem

    Class representing the Content Item resource. Content Items are instances of content created from a content type.

    Hierarchy

    • BaseContentItem
      • ContentItem
    Index

    Constructors

    • Creates a new instance of the resource. If data is provided it will be parsed as if it had come from the remote api.

      Parameters

      • Optionaldata: any

      Returns ContentItem

    Properties

    _links?: Map<string, HalLink>
    assignedDate: string

    Timestamp representing when the assignees list was last updated in ISO 8601 format

    assignees: string[]

    List of user Id' who are assigned to the content item

    body: any

    Content item JSON body. The body must include the content type URL to indicate which content type this item will be created against, e.g.

    {
    "_meta": {
    "schema": "https://raw.githubusercontent.com/amplience/dc-content-types/master/text-block.json"
    }
    }

    The body will be validated against the content type and will reject if there are any validation errors.

    contentRepositoryId: string

    Content repository id

    createdBy: string

    Id of the user responsible for originally creating the content item

    createdDate: string

    Timestamp representing when the content item was originally created in ISO 8601 format

    deliveryId: string

    Unique id used by client applications to request the content from the delivery API

    folderId: string

    Id of the folder where this content item is placed. This will be undefined if the item is in the repository root.

    hierarchy?: HierarchyMeta

    Defined if content item is a member of a hierarchy

    id: string

    Unique id generated on creation

    label: string

    Friendly label for the content item

    lastModifiedBy: string

    Id of the user responsible for the last update to the content item

    lastModifiedDate: string

    Timestamp representing when the content item was last updated in ISO 8601 format

    locale?: string

    Locale

    related: {
        archive: () => Promise<ContentItem>;
        assignWorkflowState: (workflowState: WorkflowState) => Promise<ContentItem>;
        contentItemVersion: (version: number) => Promise<ContentItem>;
        contentRepository: () => Promise<ContentRepository>;
        localizations: (options?: Pageable) => Promise<Page<ContentItem>>;
        localize: (localesList: string[]) => Promise<any>;
        setLocale: (localeDefinition: string) => Promise<ContentItem>;
        unarchive: () => Promise<ContentItem>;
        unassignWorkflowState: () => Promise<ContentItem>;
        update: (
            mutation: ContentItem,
            params?: { ignoreSchemaValidation?: boolean },
        ) => Promise<ContentItem>;
    } = ...

    Resources and actions related to a Content Item

    Type declaration

    • archive: () => Promise<ContentItem>

      Archive content item

    • assignWorkflowState: (workflowState: WorkflowState) => Promise<ContentItem>

      Assign a WorkflowState

    • contentItemVersion: (version: number) => Promise<ContentItem>

      Retrieves a specific version of the content item

    • contentRepository: () => Promise<ContentRepository>

      Retrieves the ContentRepository this content item is stored in

    • localizations: (options?: Pageable) => Promise<Page<ContentItem>>

      Get localizations of the content item

    • localize: (localesList: string[]) => Promise<any>

      Create localizations of the content item

    • setLocale: (localeDefinition: string) => Promise<ContentItem>

      Sets a locale of the form ll-CC (language, country code)

    • unarchive: () => Promise<ContentItem>

      Unarchive content item

    • unassignWorkflowState: () => Promise<ContentItem>

      Unassign a WorkflowState

    • update: (
          mutation: ContentItem,
          params?: { ignoreSchemaValidation?: boolean },
      ) => Promise<ContentItem>

      Updates this Content Item with the changes in the mutation parameter. You must provide the current version number in the mutation to avoid overwriting other user's changes.

    status: Status

    Lifecycle status of the content item

    validationState?: "VALID" | "INVALID" | "EMPTY"

    Validation state

    version: number

    Version number of the content item returned. By default this is the latest version but content items accessed via a snapshot will return the version found in the snapshot.

    workflow?: AssignedWorkflow

    Assigned workflow state

    Methods

    • POST to an action endpoint with no resource response returned.

      Parameters

      • name: string
      • params: any
      • data: any
      • method: POST | PUT | PATCH = HttpMethod.POST

      Returns Promise<void>

    • Returns a copy of this resource's attributes excluding links and client references

      Returns any

    • Returns a copy of this resource's attributes excluding links and client references

      Returns any