Skip to main content

@uniformdev/canvas

This package enables you to interact with the components and compositions defined in Uniform Canvas.

Classes

CanvasClient

Represents the client that can be used to interact with Uniform Canvas.
- Constructor
CanvasClient(options)
Creates a new object using the specified options.
Parameters:
  • optionsClientOptions
    + show child attributes
- Members
getComponentDefinitions(options)
Gets all component definitions.
Parameters:
  • optionsobject (optional)
    + show child attributes
Returns: Promise<ComponentDefinitionCollection>
+ show child attributes
getCompositionById(options)
Gets the composition with the specified ID.
Parameters:
  • optionsobject
    + show child attributes
Returns: Promise<CompositionDefinition>
Errors:
  • 404 response code- No component with the specified ID was found.
getCompositionBySlug(options)
Gets the composition with the specified slug.
Parameters:
  • optionsobject
    + show child attributes
Returns: Promise<CompositionDefinition>
Errors:
  • 404 response code- No component with the specified slug was found.
getCompositionList(options)
Gets all composition definitions.
Parameters:
  • optionsobject (optional)
    + show child attributes
Returns:
  • Promise<CompositionDefinition>- The specified options ensure that only a single composition may be returned (i.e. either compositionId or slug is specified).
  • Promise<CompositionDefinitionCollection>- The specified options may result in multiple compositions being returned (i.e. neither compositionId nor slug is specified).
    + show child attributes
Errors:
  • 404 response code- Either the compositionId or slug option is specified and no component is found.
For more information, see example in our developer guide.
removeComponentDefinition
removeComposition
updateComponentDefinition
updateComposition

EnhancerBuilder

info

Coming soon.

Functions

createLimitPolicy

info

Coming soon.

enhance

info

Coming soon.

Types

ComponentDefinition

Represents a component definition from a Uniform project.
- Members
canBeCompositionboolean (optional)
If true, the component is a composition component. If false, the component is not a composition component.
createdstring (optional)
Timestamp for when the component was first created.
defaults (optional)
iconstring (optional)
Name of the one of the standard Uniform icons, or the URL for an image that is used to represent the component in Uniform.
idstring
Identifier for the component.
namestring
Name for the component.
parameters (optional)
permissions (optional)
slots (optional)
slugSettings (optional)
titleParameterstring (optional)
Name of the component parameter that is used to describe the component in Uniform.
updatedstring (optional)
Timestamp for when the component was last updated.
useTeamPermissionsboolean (optional)
variants (optional)

CompositionDefinition

Represents a composition definition from a Uniform project.
- Members
compositionCompositionInstance
+ show child attributes
projectIdstring
statenumber
createdstring
Timestamp for when the component was first created.
modifiedstring
Timestamp for when the component was last updated.
patternboolean
resourcesobject