feat: Add new expression variables and support for luxon

* 🔨 scaffolding for  and

* 🔨 added autocomplete

* 🔨 N8N-2961-New-expression-variables

* 🔨 added luxon DateTime to expressions and Functions node, replased  with , clean up

* 🔨 added  and , fixed  return values

* 🔨 added tests for new variables

* 🔨 removed unnecessary import

* 🔨 return type fix

* 🔨 working on review, wip

* 🔨 working on review, improved errors, wip

* 🔨 fixed disappearing error message box

* 🔨 excluded variables from function node, added jmespath setup

* :hamer: added $jmsepath to function nodes

* 🔨 replacing proxy with data when using jmespath

* 🔨 renamed function

* 🔨 updated tips to function nodes

* 🔨 fixes for errors messages

* 🔨 review fixes

* 🔨 removed $input and $() from autocomplete

*  removed comments

*  Remove unused code

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Michael Kret
2022-03-13 11:34:44 +02:00
committed by GitHub
parent a957142a70
commit e8500e6937
11 changed files with 468 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
// @ts-ignore
import * as tmpl from 'riot-tmpl';
import { DateTime, Duration, Interval } from 'luxon';
// eslint-disable-next-line import/no-cycle
import {
INode,
@@ -114,6 +116,12 @@ export class Expression {
// @ts-ignore
data.document = {};
// @ts-ignore
data.DateTime = DateTime;
data.Interval = Interval;
data.Duration = Duration;
// @ts-ignore
data.constructor = {};