AppDefinition

AppDefinition

Source:
App Definition instances

Type Definitions

AppDefinition

Source:
Properties:
Name Type Description
sys Meta.Sys System metadata
appDefinition object App Definition config
app.name string App name
app.locations array Locations where the app can be installed
app.src array URL where the root HTML document of the app can be found
toPlainObject() function Returns this App Definition as a plain JS object

Methods

(static) delete() → {Promise}

Source:
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.getAppDefinition('<ui_extension_id>'))
.then((appDefinition) => appDefinition.delete())
.then(() => console.log(`App Definition deleted.`))
.catch(console.error)
Returns:
Promise for the deletion. It contains no data, but the Promise error case should be handled.
Type
Promise

(static) update() → {Promise.<AppDefinition>}

Source:
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.getAppDefinition('<ui_extension_id>'))
.then((appDefinition) => {
  appDefinition.extension.name = 'New App Definition name'
  return appDefinition.update()
})
.then((appDefinition) => console.log(`App Definition ${appDefinition.sys.id} updated.`))
.catch(console.error)
Returns:
Object returned from the server with updated changes.
Type
Promise.<AppDefinition>