Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Extension

Hierarchy

Index

Properties

extension

extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }

Type declaration

  • fieldTypes: FieldType[]

    Field types where an extension can be used

  • name: string

    Extension name

  • Optional parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }

    Parameter definitions

  • Optional sidebar?: undefined | false | true

    Controls the location of the extension. If true it will be rendered on the sidebar instead of replacing the field's editing control

  • Optional src?: undefined | string

    URL where the root HTML document of the extension can be found

  • Optional srcdoc?: undefined | string

    String representation of the extension (e.g. inline HTML code)

Optional parameters

parameters: DefinedParameters

Values for installation parameters

sys

Methods

delete

  • delete(): Promise<void>
  • Deletes this object on the server.

    example
    const contentful = require('contentful-management')
    
    const client = contentful.createClient({
      accessToken: '<content_management_api_key>'
    })
    
    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((extension) => extension.delete())
    .then(() => console.log(`UI Extension deleted.`))
    .catch(console.error)
    

    Returns Promise<void>

    Promise for the deletion. It contains no data, but the Promise error case should be handled.

toPlainObject

update

  • Sends an update to the server with any changes made to the object's properties

    example
    const contentful = require('contentful-management')
    
    const client = contentful.createClient({
      accessToken: '<content_management_api_key>'
    })
    
    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((extension) => {
      extension.extension.name = 'New UI Extension name'
      return extension.update()
    })
    .then((extension) => console.log(`UI Extension ${extension.sys.id} updated.`))
    .catch(console.error)
    

    Returns Promise<Extension>

    Object returned from the server with updated changes.