index.ts 1.29 KB
import { ActionCategoryComponentEnum } from '../../../enum/category';
import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
import type { NodeItemConfigType } from '../../../types/node';
import { RuleNodeTypeEnum } from '../../index.type';

const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_ATTRIBUTES);

export interface SaveAttributesDataType {
  someConfiguration?: Recordable;
}

export const SaveAttributesConfig: NodeItemConfigType = {
  ...keys,
  clazz: 'org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode',
  categoryType: RuleNodeTypeEnum.ACTION,
  name: 'save attributes',
  configurationDescriptor: {
    nodeDefinition: {
      details:
        "Saves entity attributes based on configurable scope parameter. Expects messages with 'POST_ATTRIBUTES_REQUEST' message type",
      description: 'Saves attributes data',
      inEnabled: true,
      outEnabled: true,
      relationTypes: ['Success', 'Failure'],
      customRelations: false,
      ruleChainNode: false,
      defaultConfiguration: {
        scope: 'SERVER_SCOPE',
        notifyDevice: false,
      },
      uiResources: ['static/rulenode/rulenode-core-config.js'],
      configDirective: 'tbActionNodeAttributesConfig',
      icon: 'material-symbols:file-upload',
      iconUrl: '',
      docUrl: '',
    },
  },
};