@acoustic-content-sdk/api 中文文档教程
支持 Acoustic 站点 SDK 和相关模块的接口和常量。
Home > @acoustic-content-sdk/api
api package
支持声学网站 SDK 和相关模块的接口和常量。
Enumerations
Enumeration | Description |
---|---|
CYCLE_HANDLING | Cycle handling strategy |
DraftStatus | Possible values for draft status |
SdkMode | |
Status | |
TENANT_TIER |
Functions
Function | Description |
---|---|
createVersion(aVersionString, aBuildDate) | Constructs a version object from a version string and a build date |
createVersionString(aVersion) | Converts the version object into a version string |
Interfaces
Interface | Description |
---|---|
AbstractElement | |
ActivePage | |
ActivePageV2 | |
Asset | |
AssetPublishApproval | |
AuthoringAsset | |
AuthoringAssetMetadata | |
AuthoringAssetProfileRendition | |
AuthoringCategoryElement | |
AuthoringCommerceProductCategoryElement | |
AuthoringCommerceProductElement | |
AuthoringContentItem | |
AuthoringContentItemThumbnail | |
AuthoringContentThumbnail | |
AuthoringDatetimeElement | |
AuthoringElement | |
AuthoringFileElement | |
AuthoringFormattedTextElement | |
AuthoringGroup | |
AuthoringGroupElement | |
AuthoringImage | |
AuthoringImageElement | |
AuthoringLayout | |
AuthoringLayoutItem | |
AuthoringLayoutMapping | |
AuthoringLayoutMappingLayout | |
AuthoringLayoutMappingMapping | |
AuthoringLayoutMappingType | |
AuthoringLinkElement | |
AuthoringLocationElement | |
AuthoringNumberElement | |
AuthoringOption | |
AuthoringOptionSelectionElement | |
AuthoringPlaceholder | |
AuthoringReference | |
AuthoringReferenceElement | |
AuthoringReferenceValue | |
AuthoringSelectedLayout | |
AuthoringText | |
AuthoringTextElement | |
AuthoringThumbnail | |
AuthoringToggleElement | |
AuthoringType | |
AuthoringUiExtensions | |
AuthoringVariableTypeElement | |
AuthoringVideo | |
AuthoringVideoElement | |
AuthStatus | Exposes the authentication status |
BaseAuthoringItem | Base interface for all items |
BaseDeliveryItem | Base interface for all items |
Category | Category is a reference element. The contents that are stored in the category element are references to categories created in content hub. When ?include=metadata is used, the categories property is included which has the full name path for each selected category.Note: When you set categories on the category element, you need to add the UUID of the category to the categoryIds property. The categories property, which returns the name path of the category is a read-only property and is not used when the content is updated. If you set it during an update, it is ignored. |
CategoryElement | Category is a reference element. The contents that are stored in the category element are references to categories created in content hub. When ?include=metadata is used, the categories property is included which has the full name path for each selected category.Note: When you set categories on the category element, you need to add the UUID of the category to the categoryIds property. The categories property, which returns the name path of the category is a read-only property and is not used when the content is updated. If you set it during an update, it is ignored. |
ContentItem | Representation of a generic content item. |
ContentItemWithLayout | |
ContentPublishApproval | |
DateElement | Common base class for all date elements |
DeliveryAccess | |
DeliveryAsset | |
DeliveryCategoryElement | |
DeliveryContentItem | |
DeliveryContentMetadata | Common fields in all metadata records |
DeliveryFileElement | |
DeliveryGroupElement | |
DeliveryGroupElementMetadata | |
DeliveryImageAsset | |
DeliveryImageCrop | |
DeliveryImageElement | |
DeliveryImageRendition | |
DeliveryImageTransform | |
DeliveryLayoutRef | |
DeliveryLinkElement | |
DeliveryLocationElement | |
DeliveryReferenceElement | |
DeliveryReferenceElementMetadata | |
DeliverySelectedLayout | |
DeliveryThumbnail | |
DeliveryVideoElement | |
DynamicLoggerFactory | Instantiator for loggers. Clients of the SDK can use this interface to inject their custom logger implementation. |
ElementMap | |
ElementWithMarkup | |
ErrorDetail | |
ErrorResponse | JSON structure of an error response |
ExtendedContext | |
ExtendedContextV2 | |
File | |
FileElement | Common base class for all file elements |
FormattedTextElement | Common base class for all text elements |
Group | Interface that represents a grouping of elements |
GroupElement | Common base class for all group elements |
HttpResourceOptions | |
HubContext | |
HubInfo | Exposes information required to access the content hub REST API. This information can be obtained via the 'Watson Content Hub information' section. |
HubInfoConfig | Base class for services providing hub information. We need a base class to be able to specify this service as injectable |
IbmCommerce | |
Image | |
ImageElement | Common base class for all image elements |
Layout | Representation of a layout descriptor in the delivery artifacts |
Link | |
LinkElement | Common base class for all link elements |
Location | |
LocationElement | |
Logger | Abstraction of the logger interface, trying to be as generic as possible. The identity of the logger is passed at creation time via the factory. Note that this interface is compatible to the console instance. |
LoggerFactory | Instantiator for loggers. Clients of the SDK can use this interface to inject their custom logger implementation. |
LoggerService | Service to return a logger for a given name. Calling the getter multiple times with the same name will return the same instance of the logger. |
MultiDateElement | Date element uses a string property, the value must be an ISO 8601 date time. |
MultiFileElement | |
MultiFormattedTextElement | The text element holds text value in a JSON string. |
MultiGroupElement | The text element holds text value in a JSON string. |
MultiImageElement | |
MultiLinkElement | Link element has three text fields linkURL, linkText, and linkDescription. |
MultiNumberElement | The Number element stores the value in the JSON as a number type. |
MultiOptionSelectionElement | The text element holds text value in a JSON string. |
MultiProductElement | The text element holds text value in a JSON string. |
MultiReferenceElement | |
MultiTextElement | The text element holds text value in a JSON string. |
MultiToggleElement | Toggle just uses JSON Boolean. |
MultiVideoElement | |
NumberElement | Common base class for all number elements |
OptionSelection | Representation of a selection |
OptionSelectionElement | Common base class for all options election elements |
PageSearchResult | |
ProductElement | |
Query | |
ReferenceElement | Common base class for all reference elements |
RenderingContext | |
RenderingContextGroupElement | |
RenderingContextInterceptor | Interceptor that can expose transforms for the rendering contexts. |
RenderingContextProvider | |
RenderingContextProviderV2 | |
RenderingContextQueryResult | |
RenderingContextReferenceElement | |
RenderingContextSearchResult | |
RenderingContextV2 | |
Rendition | |
Resource | |
SdkActiveRouteEvent | |
SdkErrorResponse | Response sent when processing a message fails |
SdkMessageHandler | |
SdkMessagePayload | Base interfaces for events that can be sent to the SDK |
SdkModeEvent | |
SdkNavigateByPathEvent | |
SdkNavigateByPathResponse | Response to the navigation event |
SdkRefreshEvent | |
SdkRouteEvent | |
SdkSetModeEvent | |
SdkSetModeResponse | Response to the set mode event |
SdkSubscribeActiveRouteEvent | |
SdkSubscribeActiveRouteEventResponse | |
SdkSubscribeEventResponse | Response to a subscription |
SdkSubscribeModeEvent | |
SdkSubscribeModeEventResponse | |
SdkSubscribeRouteEvent | |
SdkSubscribeRouteEventResponse | |
SdkUnsubscribeEvent | |
SearchResult | |
SearchResults | |
SingleDateElement | Date element uses a string property, the value must be an ISO 8601 date time. |
SingleFileElement | File element is the most basic asset reference element. It is a reference element that is used to point to an asset in content hub. Except for asset ID, all the other properties are read-only and are added from the asset at the time it is selected on a content.With asset references most of the properties are read-only and come from the asset. So when you set a file on file element you need to set the asset.id property. The other information is fetched automatically by the content service and stored in read-only fields. |
SingleFormattedTextElement | The text element holds text value in a JSON string. |
SingleGroupElement | The text element holds group value in a JSON string. |
SingleImageElement | Image is one of the more complex elements and the following section describes a normal image without an image profile configured. For information on updating and formatting the image element, go to Updating image element format.Note: You are always selecting a rendition of an asset and not the asset directly. As a result interactions with image elements involve setting and updating a rendition reference. Most other fields that are displayed in image element are read only! |
SingleLinkElement | Link element has three text fields linkURL, linkText, and linkDescription. |
SingleNumberElement | The Number element stores the value in the JSON as a number type. |
SingleOptionSelectionElement | The text element holds text value in a JSON string. |
SingleProductElement | The text element holds text value in a JSON string. |
SingleReferenceElement | |
SingleTextElement | The text element holds text value in a JSON string. |
SingleToggleElement | Toggle just uses JSON Boolean. |
SingleVideoElement | Standard video element is similar to the file element. The video asset is represented in the asset section. Optionally a video asset can have a caption and a thumbnail as well, and in this case both of these point two resources in content hub. As mentioned with file, most of the properties here are inlined data from the asset/resource and is read-only. To update a video asset or its caption/thumbnail update the relevant asset/resource ID. The related information is retrieved again and added. Attempts to change the read-only fields are ignored. |
Site | |
SiteChild | |
SiteContext | |
SiteDeliveryContentItem | |
SiteNavigationDeliveryContentItem | Delivery record for the site content item843fb991-7413-4517-bfcb-b59fc4b1f449 |
SiteNavigationPage | Reference to a page in the site navigation |
SitePage | |
SitePagesQueryResult | |
SiteRoot | |
Tenant | |
TextElement | Common base class for all text elements |
ToggleElement | Common base class for all toggle elements |
TypeRef | Reference to a content type |
UrlConfig | Exposes the URL configuration to the client.See HubInfoConfig |
User | Representation of a user |
Video | |
VideoElement | Common base class for all video elements |
WchHttp | |
WchSdk | |
WchSdkRouter | |
WchSdkSearch | |
WchSdkVersion | Defines the version number and the build date of the SDK. |
Variables
Type Aliases
Home > @acoustic-content-sdk/api > CYCLE_HANDLING
CYCLE_HANDLING enum
Cycle handling strategy
Signature:
export declare enum CYCLE_HANDLING
Enumeration Members
Member | Value | Description |
---|---|---|
BREAK | 0 |
Stop rendering contexts at detected cycles |
RESOLVE | 1 |
Resolve cycles by building cyclic in-memory structures |
Home > @acoustic-content-sdk/api > DraftStatus
DraftStatus enum
Possible values for draft status
Signature:
export declare enum DraftStatus
Enumeration Members
Member | Value | Description |
---|---|---|
APPROVED | "approved" |
|
IN_PROGRESS | "in-progress" |
|
IN_REVIEW | "in-review" |
Home > @acoustic-content-sdk/api > SdkMode
SdkMode enum
Signature:
export declare enum SdkMode
Enumeration Members
Member | Value | Description |
---|---|---|
PROTECTED | "protected" |
|
PUBLIC | "public" |
Home > ; @acoustic-content-sdk/api > Status
Status enum
Signature:
export declare enum Status
Enumeration Members
Member | Value | Description |
---|---|---|
DRAFT | "draft" |
|
READY | "ready" |
|
RETIRED | "retired" |
Home > ; @acoustic-content-sdk/api > TENANT_TIER
TENANT_TIER enum
Signature:
export declare enum TENANT_TIER
Enumeration Members
Member | Value | Description |
---|---|---|
BASE | "Base" |
|
PLUS | "Plus" |
|
STANDARD | "Standard" |
|
TRIAL | "Trial" |
Home > ; @acoustic-content-sdk/api > createVersion
createVersion() function
警告:此 API 现已过时。
从版本字符串和构建日期构建版本对象
签名:
export declare function createVersion(aVersionString: string, aBuildDate: string): WchSdkVersion;
Parameters
Parameter | Type | Description |
---|---|---|
aVersionString | string |
the version string such as in package json |
aBuildDate | string |
the build date in ISO format |
返回:
WchSdkVersion
SDK 版本对象
主页 > @acoustic-content-sdk/api > createVersionString
createVersionString() function
将版本对象转换为版本字符串
签名:
export declare function createVersionString(aVersion: WchSdkVersion): string;
Parameters
Parameter | Type | Description |
---|---|---|
aVersion | WchSdkVersion |
the version object |
返回:
string
版本字符串
@acoustic-content-sdk/api > AbstractElement
AbstractElement interface
Signature:
export interface AbstractElement
Properties
Property | Type | Description |
---|---|---|
elementType | ELEMENT_TYPE |
Home > ; @acoustic-content-sdk/api > ActivePage
ActivePage interface
Signature:
export interface ActivePage extends RenderingContextProvider
Properties
Property | Type | Description |
---|---|---|
onRenderingContext | Observable<RenderingContext> |
Retrieves the rendering context for the content item rendered for the currently selected page. |
Home > ; @acoustic-content-sdk/api > ActivePageV2
ActivePageV2 interface
Signature:
export interface ActivePageV2 extends RenderingContextProviderV2
Properties
Property | Type | Description |
---|---|---|
renderingContext$ | Observable<RenderingContextV2> |
Retrieves the rendering context for the content item rendered for the currently selected page. |
Home > ; @acoustic-content-sdk/api > Asset
Asset interface
Signature:
export interface Asset
Properties
Property | Type | Description |
---|---|---|
altText | string |
|
fileName | string |
|
fileSize | number |
|
height | number |
|
id | string |
|
mediaType | string |
|
resourceUri | string |
|
width | number |
added by delivery |
Home > ; @acoustic-content-sdk/api > AssetPublishApproval
AssetPublishApproval interface
Signature:
export interface AssetPublishApproval
Properties
Property | Type | Description |
---|---|---|
enabled | boolean |
True if mandatory approval is enabled |
exemptAssetTypes | string[] |
Home > ; @acoustic-content-sdk/api > AuthoringAsset
AuthoringAsset interface
Signature:
export interface AuthoringAsset extends BaseAuthoringItem
Properties
Property | Type | Description |
---|---|---|
altText | string |
|
assetType | string |
|
caption | string |
|
classification | 'asset' |
The classification defines the document type. For content items, all documents are classified as "content". |
digest | string |
|
fileName | string |
|
fileSize | number |
|
isManaged | boolean |
|
mediaType | string |
|
metadata | AuthoringAssetMetadata |
|
path | string |
|
profileRenditions | AuthoringAssetProfileRendition[] |
|
resource | string |
Home > ; @acoustic-content-sdk/api > AuthoringAssetMetadata
AuthoringAssetMetadata interface
Signature:
export interface AuthoringAssetMetadata
Properties
Property | Type | Description |
---|---|---|
camera | any |
|
coverage | any |
|
creator | string |
|
description | string |
|
headline | string |
|
heigth | number |
|
publisher | string |
|
rights | string |
|
source | string |
|
subject | string[] |
|
title | string |
|
width | number |
Home > ; @acoustic-content-sdk/api > AuthoringAssetProfileRendition
AuthoringAssetProfileRendition interface
Signature:
export interface AuthoringAssetProfileRendition
Properties
Property | Type | Description |
---|---|---|
height | number |
|
key | string |
|
profileId | string |
|
transform | any |
|
uri | string |
|
width | number |
Home > ; @acoustic-content-sdk/api > AuthoringCategoryElement
AuthoringCategoryElement interface
Signature:
export interface AuthoringCategoryElement extends AuthoringElement
Properties
Property | Type | Description |
---|---|---|
elementType | 'category' |
|
restrictedParents | string[] |
|
searchKey | AUTHORING_ELEMENT_TEXT_SEARCH_KEY |
Home > ; @acoustic-content-sdk/api > AuthoringCommerceProductCategoryElement
AuthoringCommerceProductCategoryElement interface
Signature:
export interface AuthoringCommerceProductCategoryElement extends AuthoringElement
Properties
Property | Type | Description |
---|---|---|
elementType | 'productcategory' |
|
restrictedParent | string |
|
searchKey | AUTHORING_ELEMENT_TEXT_SEARCH_KEY |
Home > ; @acoustic-content-sdk/api > AuthoringCommerceProductElement
AuthoringCommerceProductElement interface
Signature:
export interface AuthoringCommerceProductElement extends AuthoringElement
Properties
Property | Type | Description |
---|---|---|
elementType | 'product' |
|
restrictedCategories | string[] |
|
searchKey | AUTHORING_ELEMENT_TEXT_SEARCH_KEY |
Home > ; @acoustic-content-sdk/api > AuthoringContentItem
AuthoringContentItem interface
Signature:
export interface AuthoringContentItem extends BaseAuthoringItem
Properties
Property | Type | Description |
---|---|---|
classification | 'content' |
|
deliveryAccess | 'secured' |
|
draftStatus | DraftStatus |
|
elements | Record<string, any> |
|
form | any[] |
|
id | string |
|
keywords | string[] |
|
kind | AUTHORING_CONTENT_ITEM_KIND[] |
|
lastModified | string |
|
lastModifier | string |
|
lastModifierId | string |
|
linkedDocId | string |
|
links | Record<string, any> |
|
locale | string |
|
projectId | string |
|
projects | string[] |
|
publishing | Record<string, any> |
|
review | Record<string, any> |
|
reviewHistory | string[] |
|
reviewId | string |
|
schema | Record<string, any> |
|
selectedLayouts | AuthoringSelectedLayout[] |
|
status | Status |
|
systemModified | string |
|
tags | string[] |
|
thumbnail | AuthoringContentItemThumbnail |
|
type | string |
|
typeId | string |
|
valid | boolean |
Home > ; @acoustic-content-sdk/api > AuthoringContentItemThumbnail
AuthoringContentItemThumbnail interface
Signature:
export interface AuthoringContentItemThumbnail extends AuthoringThumbnail
Properties
Property | Type | Description |
---|---|---|
id | string |
Home > ; @acoustic-content-sdk/api > AuthoringContentThumbnail
AuthoringContentThumbnail interface
Signature:
export interface AuthoringContentThumbnail
Properties
Property | Type | Description |
---|---|---|
imageElement | string |
|
source | 'imageElementOrType' | 'imageElement' | 'type' | 'none' |
Home > ; @acoustic-content-sdk/api > AuthoringDatetimeElement
AuthoringDatetimeElement interface
Signature:
export interface AuthoringDatetimeElement extends AuthoringElement
Properties
Property | Type | Description |
---|---|---|
elementType | 'datetime' |
|
fieldType | 'date' | 'date-time' |
|
searchKey | AUTHORING_ELEMENT_DATETIME_SEARCH_KEY |
Home > ; @acoustic-content-sdk/api > 创作元素
AuthoringElement interface
签名:
export interface AuthoringElement
Properties
Property | Type | Description |
---|---|---|
allowMultipleValues | boolean |