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

@clausehq/flows-analysis

Package Overview
Dependencies
Maintainers
8
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clausehq/flows-analysis - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

18

__tests__/validation.js

@@ -14,11 +14,2 @@ const { validation } = require('../index');

});
test('scheduled trigger flow, to be ran once, in a 10 years (human interval)', () => {
expect(validation.triggerType(
{
$class: 'io.clause.flows.trigger.Schedule',
type: 'once',
interval: '10 years'
}
)).toBe(true);
});
test('scheduled trigger flow, to be ran once, in a 0 minutes (human interval)', () => {

@@ -158,2 +149,11 @@ expect(validation.triggerType(

});
test('scheduled trigger flow, to be ran periodically, with an interval that is valid in human interval, but invalid for our subset', () => {
expect(() => validation.triggerType(
{
$class: 'io.clause.flows.trigger.Schedule',
type: 'periodic',
interval: '5 months'
}
)).toThrow();
});
test('scheduled trigger flow, to be ran periodically, every 5 minutes (CRON)', () => {

@@ -160,0 +160,0 @@ expect(() => validation.triggerType(

@@ -22,5 +22,3 @@ const humanInterval = require('human-interval');

);
const isHumanIntervalValid = humanIntervalString => !Number.isNaN(
humanInterval(humanIntervalString)
);
const isHumanIntervalValid = humanIntervalString => /^-?[0-9]+([.,][0-9]*)?\s(second(s)?|minute(s)|hour(s)|day(s))$/.test(humanIntervalString);
const isIso8601Valid = iso8601String => dayjs(iso8601String).isValid();

@@ -63,3 +61,3 @@ const isCronExpressionValid = cronExpressionString => {

throw buildValidationError(
`Invalid scheduled flow once-off interval: ${interval}. Please use either the Human Interval format or an ISO 8601 string.`
`Invalid scheduled flow once-off interval: ${interval}. Please use either the \`<amount> <seconds, minutes, hours or days>\` format or an ISO 8601 string.`
);

@@ -88,3 +86,3 @@ };

throw buildValidationError(
`Invalid scheduled flow periodic interval: ${interval}. Please use either the Human Interval format or a CRON expression.`
`Invalid scheduled flow periodic interval: ${interval}. Please use either the \`<amount> <seconds, minutes, hours or days>\` format or a CRON expression.`
);

@@ -91,0 +89,0 @@ };

{
"name": "@clausehq/flows-analysis",
"version": "0.1.5",
"version": "0.1.6",
"description": "A utility for doing static analysis on flows",

@@ -5,0 +5,0 @@ "license": "UNLICENSED",

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