Broadleaf Microservices
  • v1.0.0-latest-prod

Content Types

Author

Represents an author of content.

Property Type Description

id

string

Id of the author user.

name

string

Name of the author user.

username

string

Username of the author user.

ContentClientCallOptions

extends ClientCallOptions

Property Type Description

contentContext?

ContentContext

Provide Content Context to filter result

ContentContext

Property Type Description

locale?

string

The locale used in the context.

attributes?

Record<string, unknown>

Additional, unspecified attributes.

[key: string]

unknown

ContentField

Represents the definition of a FieldData. This includes its type and other metadata.

Property Type Description

id

string

Id of the field.

name

string

The unique name of the field.

type

DefaultContentFieldType | string

The type of this content field such as STRING or HTML.

referenceType?

DefaultContentFieldReferenceType | string

When the type is REFERENCE, this field holds the type of entity this field links to such as PRODUCT or CONTENT.

allowedModels

Array<string>

When the referenceType is CONTENT, this field holds allowed content models. If empty, allows all.

collection

boolean

Whether this field represents a collections

required

boolean

Whether the related FieldData requires a value.

helpText?

string

Help text to display on the field (appears as a ? icon by the field that can be hovered over).

hint?

string

Hint text to display below the field in the admin (appears beneath the field, always visible).

displayOrder?

number

The display order of this field in relation to other fields.

attributes

Record<string, string>

Additional attributes needed to further define this field.

ContentItem

Represents some content that should be displayed on the associated application.

Property Type Description

id

string

The item’s ID.

name

string

A unique name for the item.

model

Partial<ContentModel>

The content model for this content.

uri?

string

SEO-friendly URI to identify this content item. This will be appended to the parent ContentModel’s uri and used if the model is addressableByUri.

fields

Record<string, FieldData>

The individual field data for this content

activeStartDate

string

Defines the beginning time for which this content item is active.

activeEndDate?

string

Defines the ending time for which this content item is active.

author

Author

Information on the user who created this item.

ContentModel

Property Type Description

id

string

Id of the model.

name

string

The unique name of this model.

addressableByUri

boolean

Whether all of this model can be retrieved by navigating to #uri from a storefront app. For example, navigating to /blogs would result in all Content Items using the "Blog" model being fetching. Moreover, those content items would have their own URIs that would be appended to the model’s, e.g., /:ContentModel.uri/:ContentItem.uri.

uri?

string

SEO-friendly URI to retrieve ContentItems of this model.

fields

Array<ContentField>

The list of fields that make up this content model.

ContentRequestHeaderType (Enum)

Name Value Description

CONTENT_CONTEXT

'X-Content-Context'

ContentResolverRequest

Represents a request to retrieve ContentItems from a commerce-facing context.

Property Type Description

contentZoneName?

string

Name of the [ContentZone] to retrieve ContentItems for.

<p> If present, all other request attributes will be ignored.

itemNames?

Array<string>

Names of ContentItems to retrieve.

<p> If uri, itemIds, modelId, or modelName are present, then this will be ignored.

itemIds?

Array<string>

Ids of ContentItems to retrieve.

<p> If uri, modelId, or modelName are present, then this will be ignored. If this is present, then itemNames will be ignored.

modelName?

string

Name of a ContentModel all of whose ContentItems to retrieve.

<p> If present, itemIds and itemNames will be ignored will be ignored. If uri or modelId are present, then this will be ignored.

modelId?

string

Id of a ContentModel all of whose ContentItems to retrieve.

<p> If present, modelId, itemIds, and itemNames will be ignored will be ignored. If uri is present, then this will be ignored.

pageRequest?

NarrowedPageRequest

Pagination options to use on the result set. If not provided, a list of all results will be returned instead.

uri?

string

URI of either a ContentModel all of whose ContentItems should be retrieved or else that of a single ContentItem. In the latter case, the parent ContentModel’s uri should be appended in the request.

[key: string]

unknown

Any additional params.

ContentResolverResponse

Represents a response to fetch CMS content to retrieve for a commerce-facing context.

Property Type Description

results

Array<ContentItem>

Unpaginated list of results. Only present if no pagination params were present in the request.

paginatedResults?

UntotalledPage<ContentItem, NarrowedPageable>

Paginated results. Only present if pagination params were present in the request.

namesNotFound

Array<string>

Any requested names that did not match active content.

idsNotFound

Array<string>

Any requested ids that did not match active content.

hasResults

boolean

Whether any results are present.

DefaultContentFieldReferenceType (Enum)

Default reference types available for ContentFields.

Name Value Description

CONTENT

'CONTENT'

CATEGORY

'CATEGORY'

PRODUCT

'PRODUCT'

DefaultContentFieldType (Enum)

Default types of a ContentField.

Name Value Description

STRING

'STRING'

HTML

'HTML'

DERIVED_URL

'DERIVED_URL'

LONG

'LONG'

DATE

'DATE'

ASSET_DROPZONE

'ASSET_DROPZONE'

BOOLEAN

'BOOLEAN'

REFERENCE

'REFERENCE'

FieldData

Represents the field data for fields on a ContentItem as defined by a ContentModel (see also ContentField).

Property Type Description

id

string

Id of the field.

contentItem

Partial<ContentItem>

The parent ContentItem. Usually this just contains the item’s ID and not the full projection.

name

string

The name of the field.

value

unknown

The value of the field.

ThemeFieldsResponse

Property Type Description

[key: string]

Record<string, unknown>

Map from theme field group name to another map of theme field names to values. E.g., { 'colors': { 'button-primary': 'black' } }.