Skip to main content

@buildel/buildel

Core package for connecting to socket and interacting with Buildel

BuildelSocket

const buildel = new BuildelSocket(organizationId, options);

Properties

organizationId: number (required)

options: object (optional)

nametype
socketUrlstring
authUrlstring
headersRecord<string, string>

Methods

connect(): Promise<BuildelSocket>

Initializes connection


disconnect(): Promise<BuildelSocket>

Terminates connection


status()

Returns status


run(pipelineId: number, handlers?: object): BuildelRun

handlers

Properties

propertydetails
onBlockOutput (optional)(blockId: string, outputName: string, payload: unknown) => void
onBlockError (optional)(blockId: string, errors: string[]) => void
onBlockStatusChange (optional)(blockId: string, isWorking: boolean) => void
onStatusChange (optional)(status: "idle" | "starting" | "running") => void

BuildelRun

const run = buildel.run(runId);

Methods

start(initial_inputs?: InitialInput[], alias?: string): Promise<BuildelRun | undefined>

Properties

propertydetails
InitialInput (optional){ name: string, value: string }

stop(): Promise<BuildelRun | undefined>


push(topic: string, payload: any)

Properties

propertydetailstype
topicThis is a combination of blockName and fieldName separated by a colon.string
payloadAny structure you needstring | boolean | object | array

status(): "idle" | "starting" | "running"