index.ts 1.34 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.RPC_CALL_REQUEST);

export interface RpcCallRequestDataType {
  someConfiguration?: Recordable;
}

export const RpcCallRequestConfig: NodeItemConfigType = {
  ...keys,
  clazz: 'org.thingsboard.rule.engine.rpc.TbSendRPCRequestNode',
  categoryType: RuleNodeTypeEnum.ACTION,
  name: 'rpc call request',
  configurationDescriptor: {
    nodeDefinition: {
      details:
        'Expects messages with "method" and "params". Will forward response from device to next nodes.If the RPC call request is originated by REST API call from user, will forward the response to user immediately.',
      description: 'Sends RPC call to device',
      inEnabled: true,
      outEnabled: true,
      relationTypes: ['Success', 'Failure'],
      customRelations: false,
      ruleChainNode: false,
      defaultConfiguration: {
        timeoutInSeconds: 60,
      },
      uiResources: ['static/rulenode/rulenode-core-config.js'],
      configDirective: 'tbActionNodeRpcRequestConfig',
      icon: 'material-symbols:call-made',
      iconUrl: '',
      docUrl: '',
    },
  },
};