Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/pieces/community/baserow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-baserow",
"version": "0.10.0",
"version": "0.11.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
Expand Down
66 changes: 65 additions & 1 deletion packages/pieces/community/baserow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ import { batchUpdateRowsAction } from './lib/actions/batch-update-rows';
import { batchDeleteRowsAction } from './lib/actions/batch-delete-rows';
import { upsertRowAction } from './lib/actions/upsert-row';
import { uploadFileAction } from './lib/actions/upload-file';
import { createRowAiAction } from './lib/actions/create-row-ai';
import { getRowAiAction } from './lib/actions/get-row-ai';
import { listRowsAiAction } from './lib/actions/list-rows-ai';
import { findRowAiAction } from './lib/actions/find-row-ai';
import { updateRowAiAction } from './lib/actions/update-row-ai';
import { upsertRowAiAction } from './lib/actions/upsert-row-ai';
import { deleteRowAiAction } from './lib/actions/delete-row-ai';
import { batchCreateRowsAiAction } from './lib/actions/batch-create-rows-ai';
import { batchUpdateRowsAiAction } from './lib/actions/batch-update-rows-ai';
import { batchDeleteRowsAiAction } from './lib/actions/batch-delete-rows-ai';
import { aggregateFieldAiAction } from './lib/actions/aggregate-field-ai';
import { listWorkspacesAction } from './lib/actions/list-workspaces';
import { listDatabasesAction } from './lib/actions/list-databases';
import { listTablesAction } from './lib/actions/list-tables';
import { getTableAction } from './lib/actions/get-table';
import { getTableFieldsAction } from './lib/actions/get-table-fields';
import { listViewsAction } from './lib/actions/list-views';
import { listRowNamesAction } from './lib/actions/list-row-names';
import { getFieldUniqueValuesAction } from './lib/actions/get-field-unique-values';
import { listWorkspaceUsersAction } from './lib/actions/list-workspace-users';
import { searchWorkspaceAction } from './lib/actions/search-workspace';
import { createDatabaseAction } from './lib/actions/create-database';
import { createTableAction } from './lib/actions/create-table';
import { updateTableAction } from './lib/actions/update-table';
import { deleteTableAction } from './lib/actions/delete-table';
import { createFieldAction } from './lib/actions/create-field';
import { updateFieldAction } from './lib/actions/update-field';
import { deleteFieldAction } from './lib/actions/delete-field';
import { createViewAction } from './lib/actions/create-view';
import { getRowHistoryAction } from './lib/actions/get-row-history';
import { exportTableAction } from './lib/actions/export-table';
import { getExportJobAction } from './lib/actions/get-export-job';
import { rowCreatedTrigger } from './lib/triggers/row-created';
import { rowUpdatedTrigger } from './lib/triggers/row-updated';
import { rowDeletedTrigger } from './lib/triggers/row-deleted';
Expand Down Expand Up @@ -45,7 +77,7 @@ export const baserow = createPiece({
displayName: 'Baserow',
description: 'Open-source online database tool, alternative to Airtable',
auth: baserowAuth,
minimumSupportedRelease: '0.30.0',
minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/baserow.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ["kishanprmr", "MoShizzle", "abuaboud", 'bst1n', 'sanket-a11y', 'onyedikachi-david'],
Expand All @@ -63,6 +95,38 @@ export const baserow = createPiece({
batchDeleteRowsAction,
aggregateFieldAction,
uploadFileAction,
createRowAiAction,
getRowAiAction,
listRowsAiAction,
findRowAiAction,
updateRowAiAction,
upsertRowAiAction,
deleteRowAiAction,
batchCreateRowsAiAction,
batchUpdateRowsAiAction,
batchDeleteRowsAiAction,
aggregateFieldAiAction,
listWorkspacesAction,
listDatabasesAction,
listTablesAction,
getTableAction,
getTableFieldsAction,
listViewsAction,
listRowNamesAction,
getFieldUniqueValuesAction,
listWorkspaceUsersAction,
searchWorkspaceAction,
createDatabaseAction,
createTableAction,
updateTableAction,
deleteTableAction,
createFieldAction,
updateFieldAction,
deleteFieldAction,
createViewAction,
getRowHistoryAction,
exportTableAction,
getExportJobAction,
createCustomApiCallAction({
baseUrl: (auth) => {
if (!auth) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { makeClient } from '../common';
import { baserowAiProps } from '../common/ai-props';
import { baserowAiHelpers } from '../common/ai-helpers';
import { aggregateFieldAiOutputSchema } from '../output-schemas';

export const aggregateFieldAiAction = createAction({
name: 'baserow_aggregate_field_ai',
classification: 'READ',
outputSchema: aggregateFieldAiOutputSchema,
displayName: 'Aggregate Field',
description: 'Computes an aggregate over one field in a grid view.',
audience: 'ai',
aiMetadata: {
description:
'Computes one aggregate (sum, average, min, max, median, std dev, variance, decile, distribution, or empty/non-empty/unique counts) over a field across all rows visible in a Baserow grid view. Use for totals and metrics instead of paging through rows. Numeric aggregations need a number field. Requires an Email & Password connection. Read-only and idempotent.',
idempotent: true,
},
auth: baserowAuth,
props: {
view_id: Property.Number({
displayName: 'Grid View ID',
description: 'ID of a grid view on the table. Resolve with List Views.',
required: true,
}),
field_id: baserowAiProps.fieldIdProp(),
aggregation_type: Property.StaticDropdown({
displayName: 'Aggregation Type',
description: 'The calculation to run.',
required: true,
options: {
disabled: false,
options: [
{ label: 'Sum', value: 'sum' },
{ label: 'Average', value: 'average' },
{ label: 'Min', value: 'min' },
{ label: 'Max', value: 'max' },
{ label: 'Median', value: 'median' },
{ label: 'Standard deviation', value: 'std_dev' },
{ label: 'Variance', value: 'variance' },
{ label: 'Decile', value: 'decile' },
{ label: 'Distribution', value: 'distribution' },
{ label: 'Count', value: 'count' },
{ label: 'Count (empty)', value: 'empty_count' },
{ label: 'Count (non-empty)', value: 'not_empty_count' },
{ label: 'Count (unique values)', value: 'unique_count' },
],
},
}),
},
async run(context) {
const { view_id, field_id, aggregation_type } = context.propsValue;
baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Aggregate Field' });
const client = await makeClient(context.auth);
const response = await baserowAiHelpers.execute(() =>
client.aggregateField(view_id, field_id, aggregation_type)
);
return { aggregation_type, value: response.value };
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import {
} from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { aggregateFieldOutputSchema } from '../output-schemas';

export const aggregateFieldAction = createAction({
name: 'baserow_aggregate_field',
classification: 'READ',
outputSchema: aggregateFieldOutputSchema,
displayName: 'Aggregate Field',
description:
'Calculates an aggregation (sum, average, min, max, count, etc.) over all values of a field in a grid view.',
audience: 'both',
audience: 'human',
aiMetadata: {
description:
'Computes a single aggregate value (sum, average, min, max, median, std dev, variance, or empty/non-empty/unique counts) over one field across all rows of a Baserow grid view. Use for roll-up metrics over a whole view rather than fetching rows yourself; numeric aggregations require a number field. Requires a grid view ID and a field ID. Read-only and idempotent.',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { makeClient } from '../common';
import { baserowAiProps } from '../common/ai-props';
import { baserowAiHelpers } from '../common/ai-helpers';
import { batchRowsOutputSchema } from '../output-schemas';

export const batchCreateRowsAiAction = createAction({
name: 'baserow_batch_create_rows_ai',
classification: 'WRITE',
outputSchema: batchRowsOutputSchema,
displayName: 'Batch Create Rows',
description: 'Creates up to 200 rows in one request.',
audience: 'ai',
aiMetadata: {
description:
'Creates up to 200 new rows in a Baserow table in a single request from a JSON array of field-name-to-value objects. Use for bulk inserts instead of repeated Create Row calls; split larger sets into chunks of 200. Not idempotent — re-running appends the rows again.',
idempotent: false,
},
auth: baserowAuth,
props: {
table_id: baserowAiProps.tableIdProp(),
rows: Property.Json({
displayName: 'Rows',
description:
'JSON array of row objects keyed by field name, e.g. [{"Name": "A"}, {"Name": "B"}]. Maximum 200. Value formats match Create Row.',
required: true,
}),
},
async run(context) {
const { table_id, rows } = context.propsValue;
const items = baserowAiHelpers.toRecordArray({
value: rows,
propName: 'Rows',
max: baserowAiHelpers.BATCH_LIMIT,
});
const client = await makeClient(context.auth);
const response = await baserowAiHelpers.execute(() => client.batchCreateRows(table_id, items));
return { count: response.items.length, rows: response.items };
},
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { batchRowsOutputSchema } from '../output-schemas';

export const batchCreateRowsAction = createAction({
name: 'baserow_batch_create_rows',
classification: 'WRITE',
outputSchema: batchRowsOutputSchema,
displayName: 'Batch Create Rows',
description:
'Creates multiple rows in a single request. Accepts up to 200 rows.',
audience: 'both',
audience: 'human',
aiMetadata: {
description:
'Creates many new rows in a Baserow table in one request from a JSON array of row objects (field names as keys), up to 200 rows per call. Use for bulk inserts instead of repeated Create Row calls. Not idempotent — each call appends another set of rows, so it can produce duplicates if re-run.',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { makeClient } from '../common';
import { baserowAiProps } from '../common/ai-props';
import { baserowAiHelpers } from '../common/ai-helpers';
import { batchDeleteRowsAiOutputSchema } from '../output-schemas';

export const batchDeleteRowsAiAction = createAction({
name: 'baserow_batch_delete_rows_ai',
classification: 'DESTRUCTIVE',
outputSchema: batchDeleteRowsAiOutputSchema,
displayName: 'Batch Delete Rows',
description: 'Deletes up to 200 rows in one request.',
audience: 'ai',
aiMetadata: {
description:
'Deletes up to 200 rows from a Baserow table by row ID in one request; the rows move to the Baserow trash and can be restored there. Use instead of repeated Delete Row calls. Does not fire row-deleted webhooks. Not idempotent — a repeat call fails for IDs that are already gone.',
idempotent: false,
},
auth: baserowAuth,
props: {
table_id: baserowAiProps.tableIdProp(),
row_ids: Property.Array({
displayName: 'Row IDs',
description: 'Numeric IDs of the rows to delete. Maximum 200.',
required: true,
}),
},
async run(context) {
const { table_id, row_ids } = context.propsValue;
const ids = baserowAiHelpers.toIdArray({
value: row_ids,
propName: 'Row IDs',
max: baserowAiHelpers.BATCH_LIMIT,
});
const client = await makeClient(context.auth);
await baserowAiHelpers.execute(() => client.batchDeleteRows(table_id, ids));
return { deleted: true, count: ids.length, row_ids: ids };
},
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { batchDeleteRowsOutputSchema } from '../output-schemas';

export const batchDeleteRowsAction = createAction({
name: 'baserow_batch_delete_rows',
classification: 'DESTRUCTIVE',
outputSchema: batchDeleteRowsOutputSchema,
displayName: 'Batch Delete Rows',
description:
'Deletes multiple rows in a single request. Accepts up to 200 row IDs.',
audience: 'both',
audience: 'human',
aiMetadata: {
description:
'Permanently deletes many Baserow rows in one request from a list of numeric row IDs, up to 200 per call. Use for bulk removal of known rows; for a single row use Delete Row. Destructive — verify the IDs first (List Rows or Find Row can supply them). Not idempotent against changing data once the rows are removed.',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { makeClient } from '../common';
import { baserowAiProps } from '../common/ai-props';
import { baserowAiHelpers } from '../common/ai-helpers';
import { batchRowsOutputSchema } from '../output-schemas';

export const batchUpdateRowsAiAction = createAction({
name: 'baserow_batch_update_rows_ai',
classification: 'WRITE',
outputSchema: batchRowsOutputSchema,
displayName: 'Batch Update Rows',
description: 'Updates up to 200 rows in one request.',
audience: 'ai',
aiMetadata: {
description:
'Updates up to 200 existing Baserow rows in one request; each object needs the row "id" plus only the fields to change, and omitted fields are left as they are. Use for bulk edits instead of repeated Update Row calls. Idempotent — repeating the same values converges on the same state.',
idempotent: true,
},
auth: baserowAuth,
props: {
table_id: baserowAiProps.tableIdProp(),
rows: Property.Json({
displayName: 'Rows',
description:
'JSON array of objects, each with the numeric row "id" and the field names to change, e.g. [{"id": 1, "Status": "Done"}]. Maximum 200.',
required: true,
}),
},
async run(context) {
const { table_id, rows } = context.propsValue;
const items = baserowAiHelpers.toRecordArray({
value: rows,
propName: 'Rows',
max: baserowAiHelpers.BATCH_LIMIT,
});
const missingId = items.findIndex((item) => !Number.isInteger(Number(item['id'])));
if (missingId !== -1) {
throw new Error(`Rows[${missingId}] is missing a numeric "id".`);
}
const client = await makeClient(context.auth);
const response = await baserowAiHelpers.execute(() => client.batchUpdateRows(table_id, items));
return { count: response.items.length, rows: response.items };
},
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { batchRowsOutputSchema } from '../output-schemas';

export const batchUpdateRowsAction = createAction({
name: 'baserow_batch_update_rows',
classification: 'WRITE',
outputSchema: batchRowsOutputSchema,
displayName: 'Batch Update Rows',
description:
'Updates multiple rows in a single request. Each row must include an "id" field. Accepts up to 200 rows.',
audience: 'both',
audience: 'human',
aiMetadata: {
description:
'Updates many existing Baserow rows in one request from a JSON array, up to 200 rows per call. Every object must carry an "id" identifying the row plus the fields to change. Use for bulk edits to known rows instead of repeated Update Row calls. Idempotent: re-sending the same id/field values converges those rows to the same state.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, formatFieldValues, makeClient } from '../common';
import { rowOutputSchema } from '../output-schemas';

export const cleanRowAction = createAction({
name: 'baserow_clean_row',
classification: 'DESTRUCTIVE',
outputSchema: rowOutputSchema,
displayName: 'Clean Row',
description:
'Sets all fields in a row to empty/null. To update only specific fields, use Update Row instead.',
audience: 'both',
audience: 'human',
aiMetadata: {
description:
'Clears the supplied fields on one existing Baserow row (identified by row ID) to empty/null, including blank values that Update Row would skip. Use specifically to wipe field contents rather than set new values; to change only some fields to new values use Update Row. Idempotent: re-clearing the same row leaves it in the same empty state.',
Expand Down
Loading
Loading