index.ts 1.55 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.DEVICE_PROFILE);

export interface DeviceProfileDataType {
  someConfiguration?: Recordable;
}

export const DeviceProfileConfig: NodeItemConfigType = {
  ...keys,
  clazz: 'org.thingsboard.rule.engine.profile.TbDeviceProfileNode',
  categoryType: RuleNodeTypeEnum.ACTION,
  name: 'device profile',
  configurationDescriptor: {
    nodeDefinition: {
      details:
        "Create and clear alarms based on alarm rules defined in device profile. The output relation type is either 'Alarm Created', 'Alarm Updated', 'Alarm Severity Updated' and 'Alarm Cleared' or simply 'Success' if no alarms were affected.",
      description: 'Process device messages based on device profile settings',
      inEnabled: true,
      outEnabled: true,
      relationTypes: [
        'Alarm Created',
        'Alarm Updated',
        'Alarm Severity Updated',
        'Alarm Cleared',
        'Success',
        'Failure',
      ],
      customRelations: true,
      ruleChainNode: false,
      defaultConfiguration: {
        persistAlarmRulesState: false,
        fetchAlarmRulesStateOnStart: false,
      },
      uiResources: ['static/rulenode/rulenode-core-config.js'],
      configDirective: 'tbDeviceProfileConfig',
      icon: '',
      iconUrl: '',
      docUrl: '',
    },
  },
};