Scaffolding API

When a custom integration performs scaffolding, it can use the Scaffolding API to interact with FL0.

This page describes the methods and types available via the Scaffolding API.

Methods

run

A method that an integration can use for scaffolding. It runs after the user installs the integration.

Signature

function run(
  config: object,
  project: Workspace,
  context: ScaffoldingContext
): string | void;

Usage

function run(config, project, context) {
  // code goes here
}

Parameters

NameTypeRequiredDescription
configobjectYesThe user-provided configuration for the integration.
projectWorkspaceYesRepresents a project in FL0 and contains methods for interacting with a project programmatically.
contextScaffoldingContextYes

Returns

string | void

Types

Workspace

Represents a project in FL0 and contains methods for interacting with a project programmatically.

Signature

type Workspace = {
  id: string;
  dataTableManager: DataTableManager;
  flowManager: FlowManager;
};

Properties

NameTypeRequiredDescription
idstringYesThe GUID of the project.
dataTableManagerDataTableManagerYesAn object that contains methods for creating and retrieving database tables from a project.
flowManagerFlowManagerYesAn object that contains methods for creating and retrieving workflows from a project.

ScaffoldingContext

An object that contains additional properties relevant to scaffolding.

Signature

type ScaffoldingContext = {
  logger: ScaffoldingLogger;
};

Properties

NameTypeRequiredDescription
loggerScaffoldingLoggerYesAn object that contains methods for logging messages.

ScaffoldingLogger

An object that contains methods for logging messages.

Signature

interface ScaffoldingLogger {
  info(message: string): void;
  warn(message: string): void;
  error(message: string): void;
}

Properties

NameTypeRequiredDescription
info(message: string) => voidYesA method for logging a message with a severity level of info.
warn(message: string) => voidYesA method for logging a message with a severity level of warn.
error(message: string) => voidYesA method for logging a message with a severity level of error.