This controller is still experimental and might change in future releases.

The ComponentConnectorController is responsible for all communication regarding Component connectors. Methods inside this controller can be called by window.SDK.componentConnector.{method-name}

The way GraFx Studio handles different sources of Component is called 'ComponentConnector'. A ComponentConnector is an implementation of a set of capabilities we need to interact with a certain Component Asset Management system. In essence, a connector is the combination of a JavaScript snippet and some metadata. The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs). This allows us to execute the Component connector both on web using webassembly and on the server side during output generation. This controller is an interface to the running connector instance inside the studio engine.

Methods

  • Experimental

    This method is still experimental and might change in future releases. All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This method allows you to discover which mappings are available for a given connector. If you want to use any of these mappings, they will be available in the context parameter of any connector method.

    Parameters

    • connectorId: string

      unique id of the component connector

    Returns Promise<EditorResponse<ConnectorConfigOptions>>

    connector mappings

  • Experimental

    This method is still experimental and might change in future releases. The combination of a connectorId and componentId is typically enough for a Component connector to perform the preview of this asset. The preview endpoint is capable of relaying this information to the Component connector instance running in the editor engine.

    Parameters

    • connectorId: string

      unique id of the Component connector

    • componentId: string

      unique id of the Component to download

    • previewType: ComponentPreviewType

      hint to the Component connector about desired format of the Component preview

    • context: Dictionary = {}

      dynamic map of additional options potentially used by the connector

    Returns Promise<Uint8Array<ArrayBufferLike>>