New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@5minds/node-red-contrib-processcube

Package Overview
Dependencies
Maintainers
0
Versions
370
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@5minds/node-red-contrib-processcube - npm Package Compare versions

Comparing version 1.6.0-process-instance-delete-hotfix-120ac3-m4vdm2ls to 1.6.0-process-instance-delete-hotfix-2fb3d7-m4vgglgi

2

package.json
{
"name": "@5minds/node-red-contrib-processcube",
"version": "1.6.0-process-instance-delete-hotfix-120ac3-m4vdm2ls",
"version": "1.6.0-process-instance-delete-hotfix-2fb3d7-m4vgglgi",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Node-RED nodes for ProcessCube",

@@ -21,10 +21,22 @@ module.exports = function (RED) {

const isHours = msg.payload.time_unit
? msg.payload.time_unit.toLowerCase() === 'hours'
: config.time_unit.toLowerCase() === 'hours';
const multiplier = isHours ? 1 : 24;
// Gültige Werte für time_type
const validTimeTypes = ['days', 'hours'];
const timeType = msg.payload.time_type
? msg.payload.time_type.toLowerCase()
: config.time_type?.toLowerCase();
// time_type validieren
if (!timeType || !validTimeTypes.includes(timeType)) {
node.error(`Invalid time_type provided: ${timeType}. Allowed values are 'days' or 'hours'.`);
return;
}
// Zeitmultiplikator berechnen
const multiplier = timeType === 'hours' ? 1 : 24;
node.log(`Time type: ${timeType}, multiplier: ${multiplier}`);
const deletionDate = new Date(Date.now() - timeToUse * multiplier * 60 * 60 * 1000);
node.log(`Errechnetes Datum: ${deletionDate}`);
const modelId = msg.payload.processModelId?.trim() || config.modelid?.trim();
if (!modelId) {

@@ -39,5 +51,6 @@ node.error('processModelId is not defined or empty.');

const result = await client.processInstances.query(
{ processModelId: modelId,
finishedBefore: deletionDate.toISOString(),
state: ["finished", "error", "terminated"],
{
processModelId: modelId,
finishedBefore: deletionDate.toISOString(),
state: ["finished", "error", "terminated"],
},

@@ -44,0 +57,0 @@ { identity: node.engine.identity }

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