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

    Class DynamicContent

    Amplience Dynamic Content API client.

    Your application should avoid where possible creating a new client for each request. Authentication tokens are cached by the client and only re-requested when they expire, allowing performance to be improved by reusing the client across requests.

    If multiple sets of credentials are required your application should create one client per credential set.

    Example:

    const client = new DynamicContent({
    client_id: process.env.CLIENT_ID,
    client_secret: process.env.CLIENT_SECRET
    });

    const repository = await client.contentRepositories.get('<REPO-ID>');

    const contentItem = new ContentItem();
    contentItem.label = 'Homepage Article';
    contentItem.body = {
    _meta: {
    schema: "https://github.com/techiedarren/dc-examples/blob/master/content-types/blocks/text-block.json"
    },
    paragraphs: [
    "Example article text..."
    ]
    };

    await repository.related.contentItems.create(contentItem);
    Index

    Constructors

    • Creates a Dynamic Content API client instance. You must provide credentials that will be used to authenticate with the API.

      Parameters

      • authCredentials: Partial<AuthorizationConfig>
      • OptionaldcConfig: DynamicContentConfig

        Optional configuration settings for Dynamic Content

      • OptionalhttpClient: AxiosRequestConfig<any> | HttpClient

        Optional request settings, can be used to provide proxy settings, add interceptors etc

      Returns DynamicContent

    Properties

    contentItems: { get: (id: string) => Promise<ContentItem> } = ...

    Content Item Resources

    Type declaration

    • get: (id: string) => Promise<ContentItem>

      Retrieve a content item resource by id

    contentRepositories: { get: (id: string) => Promise<ContentRepository> } = ...

    Content Repository Resources

    Type declaration

    • get: (id: string) => Promise<ContentRepository>

      Retrieve a content repository resource by id

    contentTypes: { get: (id: string) => Promise<ContentType> } = ...

    Content Type Resources

    Type declaration

    • get: (id: string) => Promise<ContentType>

      Retrieve a content type resource by id

    contentTypeSchemas: {
        get: (id: string) => Promise<ContentTypeSchema>;
        getByVersion: (id: string, version: number) => Promise<ContentTypeSchema>;
    } = ...

    Type declaration

    • get: (id: string) => Promise<ContentTypeSchema>

      Gets a content type schemas

    • getByVersion: (id: string, version: number) => Promise<ContentTypeSchema>

      Gets a content type schemas

    editions: { get: (id: string) => Promise<Edition> } = ...

    Edition Resources

    Type declaration

    • get: (id: string) => Promise<Edition>

      Retrieve an edition resource by id

    events: { get: (id: string) => Promise<Event> } = ...

    Event Resources

    Type declaration

    • get: (id: string) => Promise<Event>

      Retrieve an event resource by id

    extensions: { get: (id: string) => Promise<Extension> } = ...

    Extension Resources

    Type declaration

    • get: (id: string) => Promise<Extension>

      Retrieve an extension resource by id

    folders: { get: (id: string) => Promise<Folder> } = ...

    Type declaration

    • get: (id: string) => Promise<Folder>

      Retrieve a folder resource by id

    hierarchies: {
        children: { get: (id: string) => Promise<HierarchyChildren> };
        parents: { get: (id: string) => Promise<HierarchyParents> };
    } = ...

    Hierarchy Resources

    hubs: {
        get: (id: string) => Promise<Hub>;
        list: (options?: Pageable) => Promise<Page<Hub>>;
    } = ...

    Hub Resources

    Type declaration

    • get: (id: string) => Promise<Hub>

      Retrieve a hub resource by id

    • list: (options?: Pageable) => Promise<Page<Hub>>

      Retrieve a list of hub resources shared with your client credentials.

    snapshots: { get: (id: string) => Promise<Snapshot> } = ...

    Snapshot Resources

    Type declaration

    • get: (id: string) => Promise<Snapshot>

      Retrieve a snapshot resource by id

    workflowStates: { get: (id: string) => Promise<WorkflowState> } = ...

    Workflow States

    Type declaration

    • get: (id: string) => Promise<WorkflowState>

      Retrieve a Workflow State by id

    Methods

    • Parameters

      • dcConfig: DynamicContentConfig
      • tokenProvider: AuthHeaderProvider
      • httpClient: HttpClient

      Returns HalClient

    • Parameters

      • dcConfig: DynamicContentConfig
      • authCredentials: AuthorizationConfig
      • httpClient: HttpClient

      Returns AuthHeaderProvider