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
Name | Type | Required | Description |
---|---|---|---|
metadata | any | No | Additional 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
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | The 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
Name | Type | Required | Description |
---|---|---|---|
collectionId | string | No | Filter stacks by collection ID |
lastId | string | No | ID of the last item for pagination |
limit | number | No | Maximum 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
Name | Type | Required | Description |
---|---|---|---|
stackId | string | Yes | ID of the stack |
operationId | string | Yes | ID of the operation to add |
Returns
Promise<Stack>
- The updated stack object
Example
const stack = await client.stacks.operations.add({ stackId: '123', operationId: '456' });