Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flowfuse/nr-assistant

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowfuse/nr-assistant - npm Package Compare versions

Comparing version 0.1.1-cc561a2-202407081555.0 to 0.1.2-72f7066-202407151302.0

9

index.js

@@ -30,5 +30,5 @@ module.exports = (RED) => {

RED.httpAdmin.post('/nr-assistant/:method', RED.auth.needsPermission('write'), function (req, res) {
const method = req.params.method || 'fn'
const method = req.params.method
// limit method to prevent path traversal
if (/[^a-zA-Z0-9-_]/.test(method)) {
if (!method || typeof method !== 'string' || /[^a-z0-9-_]/.test(method)) {
res.status(400)

@@ -39,4 +39,3 @@ res.json({ status: 'error', message: 'Invalid method' })

const input = req.body
const prompt = input.prompt
if (!input.prompt) {
if (!input || !input.prompt || typeof input.prompt !== 'string') {
res.status(400)

@@ -47,3 +46,3 @@ res.json({ status: 'error', message: 'prompt is required' })

const body = {
prompt, // this is the prompt to the AI
prompt: input.prompt, // this is the prompt to the AI
promptHint: input.promptHint, // this is used to let the AI know what we are generating (`function node? Node JavaScript? flow?)

@@ -50,0 +49,0 @@ context: input.context, // this is used to provide additional context to the AI (e.g. the selected text of the function node)

{
"name": "@flowfuse/nr-assistant",
"version": "0.1.1-cc561a2-202407081555.0",
"version": "0.1.2-72f7066-202407151302.0",
"description": "FlowFuse Node-RED assistant plugin",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc