mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(Data Table Node): Add Data Table Node (no-changelog) (#18556)
This commit is contained in:
60
packages/nodes-base/nodes/DataTable/DataTable.node.ts
Normal file
60
packages/nodes-base/nodes/DataTable/DataTable.node.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { IExecuteFunctions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
|
||||
import { router } from './actions/router';
|
||||
import * as row from './actions/row/Row.resource';
|
||||
import { getDataTableColumns, getDataTables, tableSearch } from './common/methods';
|
||||
|
||||
export class DataTable implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Data Table',
|
||||
name: 'dataTable',
|
||||
icon: 'fa:table',
|
||||
iconColor: 'orange',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["action"]}}',
|
||||
description: 'Save data across workflow executions in a table',
|
||||
defaults: {
|
||||
name: 'Data Table',
|
||||
},
|
||||
usableAsTool: true,
|
||||
// We have custom logic in the frontend to ignore `hidden` for this
|
||||
// particular node type if the data table module is enabled
|
||||
hidden: true,
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Row',
|
||||
value: 'row',
|
||||
},
|
||||
],
|
||||
default: 'row',
|
||||
},
|
||||
...row.description,
|
||||
],
|
||||
};
|
||||
|
||||
methods = {
|
||||
listSearch: {
|
||||
tableSearch,
|
||||
},
|
||||
loadOptions: {
|
||||
getDataTableColumns,
|
||||
},
|
||||
resourceMapping: {
|
||||
getDataTables,
|
||||
},
|
||||
};
|
||||
|
||||
async execute(this: IExecuteFunctions) {
|
||||
return await router.call(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user