Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AppDefinition

Hierarchy

Index

Properties

Optional locations

locations: AppLocation[]

Locations where the app can be installed

name

name: string

App name

Optional parameters

parameters: undefined | { instance?: ParameterDefinition[] }

Instance parameter definitions

Optional src

src: undefined | string

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

sys

sys: BasicMetaSysProps & { organization: SysLink }

System metadata

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.getOrganization('<org_id>')
    .then((org) => org.getAppDefinition('<app_def_id>'))
    .then((appDefinition) => appDefinition.delete())
    .then(() => console.log(`App Definition 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.getOrganization('<org_id>')
    .then((org) => org.getAppDefinition('<app_def_id>'))
    .then((appDefinition) => {
      appDefinition.name = 'New App Definition name'
      return appDefinition.update()
    })
    .then((appDefinition) => console.log(`App Definition ${appDefinition.sys.id} updated.`))
    .catch(console.error)

    Returns Promise<AppDefinition>

    Object returned from the server with updated changes.