import type { IDisplayOptions, IExecuteFunctions, INodeExecutionData, INodeProperties, } from 'n8n-workflow'; import { getAddRow, makeAddRow } from '../../common/addRow'; import { getDataTableProxyExecute } from '../../common/utils'; export const FIELD: string = 'insert'; const displayOptions: IDisplayOptions = { show: { resource: ['row'], operation: [FIELD], }, }; export const description: INodeProperties[] = [makeAddRow(FIELD, displayOptions)]; export async function execute( this: IExecuteFunctions, index: number, ): Promise { const dataStoreProxy = await getDataTableProxyExecute(this, index); const row = getAddRow(this, index); const insertedRows = await dataStoreProxy.insertRows([row]); return insertedRows.map((json) => ({ json })); }