  import {
    INodeType,
    INodeTypeDescription,
    IExecuteFunctions,
    INodeExecutionData,
    NodeConnectionType,
  } from 'n8n-workflow';

  export class _BaseNodeTransform implements INodeType {
    description: INodeTypeDescription = {
      displayName: 'BaseNodeTransform',
      name: 'baseNodeTransform',
      group: ['transform'],
      version: 1,
      description: 'Базовый узел transform, который выводит только метаданные',
      defaults: {
        name: 'BaseNodeTransform',
      },
      inputs: [NodeConnectionType.Main],
      outputs: [NodeConnectionType.Main],
      properties: [],
    };

    async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
      const items = this.getInputData();

      const workflowName = this.getWorkflow().name;
      const nodeInfo = this.getNode();
      const fromNodeFull = nodeInfo.type;
      const fromNode = fromNodeFull.includes('.') ? fromNodeFull.split('.').pop()! : fromNodeFull;
      const idField = nodeInfo.name;

      return [
        items.map(() => ({
          json: {
            DATA: {},
            METADATA: {
              chain: workflowName,
              from: fromNode,
              id: idField,
              time: Date.now(),
            },
          },
        })),
      ];
    }
  }
