Skip to main content

Stacks

Description

Stacks are collections of operations that can be managed as a group. They allow you to organize and track related operations together.

Methods

create

Creates a new stack.

Props

NameTypeRequiredDescription
metadataanyNoAdditional metadata for stack

Returns

Promise<Stack> - The created stack object

Example

const stack = await client.stacks.create({ metadata: { name: 'My Stack' } });

get

Retrieves a stack by its ID.

Props

NameTypeRequiredDescription
idstringYesThe stack's ID

Returns

Promise<Stack | undefined> - The stack object if found

Example

const stack = await client.stacks.get({ id: '123' });

list

Lists stacks with optional filtering and pagination.

Props

NameTypeRequiredDescription
collectionIdstringNoFilter stacks by collection ID
lastIdstringNoID of the last item for pagination
limitnumberNoMaximum number of items to return

Returns

Promise<Stack[]> - Array of stack objects

Example

const stacks = await client.stacks.list({ collectionId: '123' });

operations.add

Adds a single operation to a stack.

Props

NameTypeRequiredDescription
stackIdstringYesID of the stack
operationIdstringYesID of the operation to add

Returns

Promise<Stack> - The updated stack object

Example

const stack = await client.stacks.operations.add({ stackId: '123', operationId: '456' });

operations.addMany

Adds multiple operations to a stack.

Props

NameTypeRequiredDescription
stackIdstringYesID of the stack
operationIdsstring[]YesArray of operation IDs to add

Returns

Promise<Stack> - The updated stack object

Example

const stack = await client.stacks.operations.addMany({ stackId: '123', operationIds: ['456', '789'] });

operations.remove

Removes an operation from a stack.

Props

NameTypeRequiredDescription
stackIdstringYesID of the stack
operationIdstringYesID of the operation to remove

Returns

Promise<Stack> - The updated stack object

Example

const stack = await client.stacks.operations.remove({ stackId: '123', operationId: '456' });

update

Updates a stack's metadata.

Props

NameTypeRequiredDescription
idstringYesThe stack's ID
metadataanyNoUpdated metadata for stack

Returns

Promise<Stack> - The updated stack object

Example

const stack = await client.stacks.update({ id: '123', metadata: { name: 'My Updated Stack' } });

Types

Stack

Represents a stack object that groups related operations together.

PropertyTypeDescription
idstringUnique identifier for the stack
operationsOperation<any, any>[]Array of operations contained in the stack
metadataanyCustom metadata associated with the stack
createdAtDateTimestamp when the stack was created
updatedAtDateTimestamp when the stack was last updated