index.ts 2.21 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.PUSH_TO_EDGE);

export interface PushToEdgeDataType {
  someConfiguration?: Recordable;
}

export const PushToEdgeConfig: NodeItemConfigType = {
  ...keys,
  clazz: 'org.thingsboard.rule.engine.edge.TbMsgPushToEdgeNode',
  categoryType: RuleNodeTypeEnum.ACTION,
  name: 'push to edge',
  configurationDescriptor: {
    nodeDefinition: {
      details:
        "Push messages from cloud to edge. Message originator must be assigned to particular edge or message originator is <b>EDGE</b> entity itself. This node used only on cloud instances to push messages from cloud to edge. Once message arrived into this node it’s going to be converted into edge event and saved to the database. Node doesn't push messages directly to edge, but stores event(s) in the edge queue. <br>Supports next originator types:<br><code>DEVICE</code><br><code>ASSET</code><br><code>ENTITY_VIEW</code><br><code>DASHBOARD</code><br><code>TENANT</code><br><code>CUSTOMER</code><br><code>EDGE</code><br><br>As well node supports next message types:<br><code>POST_TELEMETRY_REQUEST</code><br><code>POST_ATTRIBUTES_REQUEST</code><br><code>ATTRIBUTES_UPDATED</code><br><code>ATTRIBUTES_DELETED</code><br><code>ALARM</code><br><br>Message will be routed via <b>Failure</b> route if node was not able to save edge event to database or unsupported originator type/message type arrived. In case successful storage edge event to database message will be routed via <b>Success</b> route.",
      description: 'Push messages from cloud to edge',
      inEnabled: true,
      outEnabled: true,
      relationTypes: ['Success', 'Failure'],
      customRelations: false,
      ruleChainNode: false,
      defaultConfiguration: {
        scope: 'SERVER_SCOPE',
      },
      uiResources: ['static/rulenode/rulenode-core-config.js'],
      configDirective: 'tbActionNodePushToEdgeConfig',
      icon: 'material-symbols:cloud-download',
      iconUrl: '',
      docUrl: '',
    },
  },
};