import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const versions = await client.workers.flows.versions.list('flowId', { workerId: 'workerId' });
console.log(versions.data);{
"data": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"flowId": "<string>",
"versionNumber": 123,
"code": "<string>",
"variables": {},
"commitMessage": "<string>",
"authorType": "USER",
"authorUserId": "<string>",
"authorApiKeyId": "<string>"
}
],
"total": 123,
"hasMore": true
}Returns paginated list of versions for a flow, ordered by version number descending
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const versions = await client.workers.flows.versions.list('flowId', { workerId: 'workerId' });
console.log(versions.data);{
"data": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"flowId": "<string>",
"versionNumber": 123,
"code": "<string>",
"variables": {},
"commitMessage": "<string>",
"authorType": "USER",
"authorUserId": "<string>",
"authorApiKeyId": "<string>"
}
],
"total": 123,
"hasMore": true
}API key authentication
1 <= x <= 100x >= 0