Commit graph

82 commits

Author SHA1 Message Date
Michael Kret 700cc39cbc
fix(core): Better errors for common status codes fix 2023-05-03 12:45:44 +03:00
Michael Kret 8aedc03dda
fix(core): Assign Unknown Error only if message or description not present in error 2023-05-03 10:15:33 +03:00
Iván Ovejero 06fa6f1fb3
ci: Expand ESLint to tests in BE packages (no-changelog) (#6147)
* 🔧 Adjust base ESLint config

* 🔧 Adjust `lint` and `lintfix` in `nodes-base`

* 🔧 Include `test` and `utils` in `nodes-base`

* 📘 Convert JS tests to TS

* 👕 Apply lintfixes
2023-05-02 10:37:19 +02:00
Iván Ovejero c99f158120
fix(core): Account for nodes with renamable content (#6109)
🐛 Account for nodes with renamable content
2023-05-02 09:37:49 +02:00
कारतोफ्फेलस्क्रिप्ट™ a3aba835a1
fix(core): Avoid using Object.keys on Buffer and other non-plain objects (#6131)
* create a unified way to check if an object is empty

* avoid running `Object.keys` on Buffer objects, to avoid unnecessary memory usage
2023-04-28 13:05:48 +02:00
कारतोफ्फेलस्क्रिप्ट™ 206b6b90b8
fix(core): Fix hasOwnProperty on augmented objects (#6124)
N8N-6333

Fixes 

- https://community.n8n.io/t/bug-faulty-javascript-being-implemented-in-the-code-node-after-update-to-v0-222-3/25346
- https://community.n8n.io/t/checking-for-value-in-webhook-body-with-hasownproperty/25068/11
2023-04-28 11:49:53 +02:00
कारतोफ्फेलस्क्रिप्ट™ a4eb46acc1
fix(core): Serialize dates and regexps when reading from augmented objects (#6086)
https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575
2023-04-26 11:11:13 +02:00
OlegIvaniv 33fb73217d
fix(core): Improve domain and url matching for extractDomain and extractUrl (#6010)
* fix(core): Fix domain and url matching for isDomain/isUrl/extractDomain/extractUrl

* Document regex and include www in the domain

* Lint fix
2023-04-20 09:01:27 +02:00
कारतोफ्फेलस्क्रिप्ट™ 6a1b7c306b
fix(core): augmentObject should use existing property descriptors whenever possible (#5872)
* fix(core): Augmented objects should use existing property descriptors whenever possible

* add a test for non-enumerable keys
2023-04-03 17:19:12 +02:00
कारतोफ्फेलस्क्रिप्ट™ 6c35ffa82c
fix(core): Handle Date and RegExp objects in AugmentObject (#5809) 2023-03-29 21:36:56 +02:00
कारतोफ्फेलस्क्रिप्ट™ 4f91525022
fix(core): Handle Date and RegExp correctly in jsonStringify (#5812) 2023-03-29 21:10:19 +02:00
कारतोफ्फेलस्क्रिप्ट™ 18efaf397a
fix(core): Do not mark duplicates as circular references in jsonStringify (#5789)
* fix(core): jsonStringify should not mark duplicates as circular references

* not mark duplicates as circular references in the code node as well
2023-03-27 16:22:59 +02:00
Michael Auerswald b6d8a0f985
fix(core): Remove circular refs from Code and push msg (#5741)
* remove circular refs from code items (and lint fixes)

* cleanup

---------

* add some tests

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-03-21 15:34:30 +01:00
Jan Oberhauser 0876c38aae
feat(core): Augment data instead of copying it (#5487) 2023-03-16 15:14:34 +01:00
Val 39c871d514
test: Add expression transform tests (#5497) (no-changelog)
test: add expression transform tests
2023-03-14 15:22:52 +00:00
Milorad FIlipović 0cf45bc4c8
fix(core): Fix data transformation function that are reported not to work properly (#5338)
* 🔥 Remove test extensions
* 🚧 Add test description
* 📘 Expand types
*  Export extensions
*  Export collection
*  Mark all proxies
* ✏️ Rename for clarity
*  Export from barrel
*  Create datatype completions
*  Mount datatype completions
* 🧪 Adjust tests
*  Add `path` prop
* 🔥 Remove `()` from completion labels
*  Filter out completions for pseudo-proxies
* 🐛 Fix method error
*  Add metrics
* ✏️ Improve naming
*  Start completion on empty resolvable
*  Implement completion previews
*  Break out completion manager
*  Implement in expression editor modal
* ✏️ Improve naming
*  Filter out irrelevant completions
*  Add preview hint
* ✏️ Improve comments
* 🎨 Style preview hint
*  Expand `hasNoParams`
*  Add spacing for readability
*  Add error codes
* ✏️ Add comment
* 🐛 Fix Esc behavior
*  Parse Unicode
*  Throw on invalid `DateTime`
*  Fix second root completion detection
*  Switch message at completable prefix position
* 🐛 Fix function names for non-dev build
* 🐛 Fix `json` handling
* 🔥 Comment out previews
* ♻️ Apply feedback
* 🔥 Remove extensions
* 🚚 Rename extensions
*  Adjust some implementations
* 🔥 Remove dummy extensions
* 🐛 Fix object regex
* ♻️ Apply feedback
* ✏️ Fix typos
* ✏️ Add `fn is not a function` message
* 🔥 Remove check
*  Add `isNotEmpty` for objects
* 🚚 Rename `global` to `alpha`
* 🔥 Remove `encrypt`
*  Restore `is not a function` error
*  Support `week` on `extract()`
* 🧪 Fix tests
*  Add validation to some string extensions
*  Validate number arrays in some extensions
* 🧪 Fix tests
* ✏️ Improve error message
*  Revert extensions framework changes
* 🧹 Previews cleanup
*  Condense blank completions
*  Refactor dollar completions
*  Refactor non-dollar completions
*  Refactor Luxon completions
*  Refactor datatype completions
*  Use `DATETIMEUNIT_MAP`
* ✏️ Update test description
*  Revert "Use `DATETIMEUNIT_MAP`"
This reverts commit 472a77df5c.
* 🧪 Add tests
* ♻️ Restore generic extensions
* 🔥 Remove logs
* 🧪 Expand tests
*  Add `Math` completions
* ✏️ List breaking change
*  Add doc tooltips
* 🐛 Fix node selector regex
* 🐛 Fix `context` resolution
* 🐛 Allow dollar completions in args
*  Make numeric array methods context-dependent
* 📝 Adjust docs
* 🐛 Fix selector ref
*  Surface error for valid URL
* 🐛 Disallow whitespace in `isEmail` check
* 🧪 Fix test for `isUrl`
*  Add comma validator in `toFloat`
*  Add validation to `$jmespath()`
*  Revert valid URL error
*  Adjust `$jmespath()` validation
* 🧪 Adjust `isUrl` test
*  Remove `{}` and `[]` from compact
* ✏️ Update docs
* 🚚 Rename `stripTags` to `removeTags`
*  Do not inject whitespace inside resolvable
*  Make completions aware of `()`
* ✏️ Add note
*  Update sorting
*  Hide active node name from node selector
* 🔥 Remove `length()` and its aliases
*  Validate non-zero for `chunk`
* ✏️ Reword all error messages
* 🐛 Fix `$now` and `$today`
*  Simplify with `stripExcessParens`
*  Fold luxon into datatype
* 🧪 Clean up tests
* 🔥 Remove tests for removed methods
* 👕 Fix type
* ⬆️ Upgrade lang pack
*  Undo change to `vitest` command
* 🔥 Remove unused method
*  Separate `return` line
* ✏️ Improve description
* 🧪 Expand tests for initial-only completions
* 🧪 Add bracket-aware completions
*  Make check for `all()` stricter
* ✏️ Adjust explanatory comments
* 🔥 Remove unneded copy
* 🔥 Remove outdated comment
*  Make naming consistent
* ✏️ Update comments
*  Improve URL scheme check
* ✏️ Add comment
* 🚚 Move extension
* ✏️ Update `BREAKING-CHANGES.md`
* ✏️ Update upcoming version
* ✏️ Fix grammar
* ✏️ Shorten message
* 🐛 Fix `Esc` behavior
* 🐛 Fix `isNumeric`
*  Using UTC to handle-dates on back-end
*  Added more unit tests for date extensions
*  Not using `JSON.stringify` to render dates
*  Using `deep-equal` library instead of our `deepCompare` function
*  Adding more tests to array extensions
*  Fixing `inBetween` extension function
*  Added tests for `.inBetween()`
*  Updating `isEven` and `isOdd` to throw for floats
*  Updating `Array.merge()` so it works without arguments
* 🔀 Fixing leftover merge confilct
*  Updating `removeFieldsContaining` and `keepFieldsContaining` to throw on empty strings
*  Fixing `pluck()` so it returns only plucked values
* ⬆️ Updating pnpm lockfile
* 👕 Fixing lint errors
*  Using workflow timezone to display dates
* ✔️ Updating tests with workflow timezone
*  Not using system timezone when creating Luxon dates
*  Updating `merge()` and `pluck()` array functions
* 🔀 Sync with `master`: Removing code that was preserved during merge
*  Updating `.pluck()` to return full array if no arguments are passed
*  Updating `keepFieldsContaining` and `merge` object functions
*  Using week as default for `date.extract()`
*  Adding more test cases for DT functions
*  Removing `Object.merge` extension function. Adding missing `deep-equal` dependency
*  Handling `toDate` case when time component is not specified
*  Using workflow's timezone to render dates in output panel, updated unit tests after removing `Object.merge` function
*  Not parsing numbers as dates
* 👕 Fixing lint errors
*  Fixing a typo
*  Making date detection more strict so only stringified dates are getting converted
* 👌 Addressing PR feedback
* 🔥 Removing leftover comment
---------

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2023-02-15 10:50:16 +01:00
Valya 287fa9cd06
test(core): Add basic expression tests (no-changelog) (#5439)
* test(core): add basic expression tests

* test: fix $if test not working properly
2023-02-10 10:05:34 +01:00
Valya c7b58e0ed1
fix(core): Expression extension failing with optional chaining (#5370)
* wip

* fix: working optional chaining polyfill

* fix: polyfill optional chaining on extended functions

* test: add optional chaining tests
2023-02-09 13:57:45 +00:00
Iván Ovejero 6d811f0d9f
feat(editor): Completions for extensions in expression editor (#5130)
* 🔥 Remove test extensions

* 🚧 Add test description

* 📘 Expand types

*  Export extensions

*  Export collection

*  Mark all proxies

* ✏️ Rename for clarity

*  Export from barrel

*  Create datatype completions

*  Mount datatype completions

* 🧪 Adjust tests

*  Add `path` prop

* 🔥 Remove `()` from completion labels

*  Filter out completions for pseudo-proxies

* 🐛 Fix method error

*  Add metrics

* ✏️ Improve naming

*  Start completion on empty resolvable

*  Implement completion previews

*  Break out completion manager

*  Implement in expression editor modal

* ✏️ Improve naming

*  Filter out irrelevant completions

*  Add preview hint

* ✏️ Improve comments

* 🎨 Style preview hint

*  Expand `hasNoParams`

*  Add spacing for readability

*  Add error codes

* ✏️ Add comment

* 🐛 Fix Esc behavior

*  Parse Unicode

*  Throw on invalid `DateTime`

*  Fix second root completion detection

*  Switch message at completable prefix position

* 🐛 Fix function names for non-dev build

* 🐛 Fix `json` handling

* 🔥 Comment out previews

* ♻️ Apply feedback

* 🔥 Remove extensions

* 🚚 Rename extensions

*  Adjust some implementations

* 🔥 Remove dummy extensions

* 🐛 Fix object regex

* ♻️ Apply feedback

* ✏️ Fix typos

* ✏️ Add `fn is not a function` message

* 🔥 Remove check

*  Add `isNotEmpty` for objects

* 🚚 Rename `global` to `alpha`

* 🔥 Remove `encrypt`

*  Restore `is not a function` error

*  Support `week` on `extract()`

* 🧪 Fix tests

*  Add validation to some string extensions

*  Validate number arrays in some extensions

* 🧪 Fix tests

* ✏️ Improve error message

*  Revert extensions framework changes

* 🧹 Previews cleanup

*  Condense blank completions

*  Refactor dollar completions

*  Refactor non-dollar completions

*  Refactor Luxon completions

*  Refactor datatype completions

*  Use `DATETIMEUNIT_MAP`

* ✏️ Update test description

*  Revert "Use `DATETIMEUNIT_MAP`"

This reverts commit 472a77df5c.

* 🧪 Add tests

* ♻️ Restore generic extensions

* 🔥 Remove logs

* 🧪 Expand tests

*  Add `Math` completions

* ✏️ List breaking change

*  Add doc tooltips

* 🐛 Fix node selector regex

* 🐛 Fix `context` resolution

* 🐛 Allow dollar completions in args

*  Make numeric array methods context-dependent

* 📝 Adjust docs

* 🐛 Fix selector ref

*  Surface error for valid URL

* 🐛 Disallow whitespace in `isEmail` check

* 🧪 Fix test for `isUrl`

*  Add comma validator in `toFloat`

*  Add validation to `$jmespath()`

*  Revert valid URL error

*  Adjust `$jmespath()` validation

* 🧪 Adjust `isUrl` test

*  Remove `{}` and `[]` from compact

* ✏️ Update docs

* 🚚 Rename `stripTags` to `removeTags`

*  Do not inject whitespace inside resolvable

*  Make completions aware of `()`

* ✏️ Add note

*  Update sorting

*  Hide active node name from node selector

* 🔥 Remove `length()` and its aliases

*  Validate non-zero for `chunk`

* ✏️ Reword all error messages

* 🐛 Fix `$now` and `$today`

*  Simplify with `stripExcessParens`

*  Fold luxon into datatype

* 🧪 Clean up tests

* 🔥 Remove tests for removed methods

* 👕 Fix type

* ⬆️ Upgrade lang pack

*  Undo change to `vitest` command

* 🔥 Remove unused method

*  Separate `return` line

* ✏️ Improve description

* 🧪 Expand tests for initial-only completions

* 🧪 Add bracket-aware completions

*  Make check for `all()` stricter

* ✏️ Adjust explanatory comments

* 🔥 Remove unneded copy

* 🔥 Remove outdated comment

*  Make naming consistent

* ✏️ Update comments

*  Improve URL scheme check

* ✏️ Add comment

* 🚚 Move extension

* ✏️ Update `BREAKING-CHANGES.md`

* ✏️ Update upcoming version

* ✏️ Fix grammar

* ✏️ Shorten message

* 🐛 Fix `Esc` behavior

* 🐛 Fix `isNumeric`

*  Support native methods

* 🧪 Skip Pinia tests

* ✏️ Shorten description

* 🔥 Remove outdated comment

* 🧪 Unskip Pinia tests

* ✏️ Add comments

* 🧪 Expand tests to natives

* ✏️ Add clarifying comments

*  Use `setTimeout` to make telemetry non-blocking

* 🐛 Account for no active node in cred modal

*  Resolve without workflow

* 🔥 Remove `Esc` handling on NDV

*  Use `isDateTime`

* 🚚 Move `unique` to next phase

This array extension takes optional args.

*  Merge export

* 🧪 Fix tests

*  Restore check

* ✏️ Make breaking change description more accurate

* 🧪 Fix e2e tests
2023-02-02 12:35:38 +01:00
Jan Oberhauser b27a60b665
fix(core): Fix value resolution in declarative node design (#5217) 2023-02-01 08:25:43 -06:00
Valya 09bdd96d29
fix: Extension being too eager and making calls when it shouldn't (#5232)
fix: extension being too eager and making calls when it shouldn't
2023-01-24 12:04:50 +00:00
Valya 683492155e
fix: IsWeekend not checking if DateTime (#5221) (no-changelog) 2023-01-23 14:28:17 +01:00
Valya 94be3b61cb
fix: Test failing for toDate from string extension test (no-changelog) (#5142) 2023-01-12 16:06:34 +01:00
Valya 3d05acf313
feat: Expression extension framework (#4372)
*  Introduce a framework for expression extension

* 💡 Add some inline comments

*  Introduce hash alias for encrypt

*  Introduce a manual granular level approach to shadowing/overrideing extensions

* 🔥 Cleanup comments

*  Introduce a basic method of extension for native functions

*  Add length to StringExtension

*  Add number type to extension return types

*  Temporarily introduce DateTime with extension

*  Cleanup comments

*  Organize imports

* ♻️ Fix up some typings

*  Fix typings

* ♻️ Remove unnecessary resolve of expression

*  Extensions Improvement

* ♻️ Refactor EXPRESSION_EXTENSION_METHODS

* ♻️ Refactor EXPRESSION_EXTENSION_METHODS

* ♻️ Update extraArgs types

* ♻️ Fix tests

* ♻️ Fix bind type issue

* ♻️ Fixing duration type issue

* ♻️ Refactor to allow overrides on native methods

* ♻️ Temporarily remove Date Extensions to pass tests

* feat(dt-functions): introduce date expression extensions (#4045)

* 🎉 Add Date Extensions into the mix

*  Introduce additional date extension methods

*  Add Date Expression Extension tests

* 🔧 Add ability to debug tests

* ♻️ Refactor extension for native types

* 🔥 Move sayHi method to String Extension class

* ♻️ Update scope when binding member methods

*  Add String Extension tests

* feat(dt-functions): introduce array expression extensions (#4044)

*  Introduce Array Extensions

*  Add Array Expression tests

* feat(dt-functions): introduce number expression extensions (#4046)

* 🎉 Introduce Number Extensions

*  Support more shared extensions

*  Improve handling of name collision

*  Update tests

* Fixed up tests

* 🔥 Remove remove markdown

* :recylce: Replace remove-markdown dependencies with implementation

* ♻️ Replace remove-markdown dependencies with implementation

*  Update tests

* ♻️ Fix scoping and cleanup

* ♻️ Update comments and errors

* ♻️ Fix linting errors

*  Remove unused dependencies

* fix: expression extension not working with multiple extensions

* refactor: change extension transform to be more efficient

* test: update most test to work with new extend function

* fix: update and fix type error in config

* refactor: replace babel with recast

* feat: add hashing functions to string extension

* fix: removed export

* test: add extension parser and transform tests

* fix: vite tests breaking

* refactor: remove commented out code

* fix: parse dates passed from $json in extend function

* refactor: review feedback changes for date extensions

* refactor: review feedback changes for number extensions

* fix: date extension beginningOf test

* fix: broken build from merge

* fix: another merge issue

* refactor: address review feedback (remove ignores)

* feat: new extension functions and tests

* feat: non-dot notation functions

* test: most of the other tests

* fix: toSentenceCase for node versions below 16.6

* feat: add $if and $not expression extensions

* Fix test to work on every timezone

* lint: fix remaining lint issues

Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
2023-01-10 14:06:12 +01:00
Iván Ovejero 0bd13c7173
fix(core): Make expression resolution improvements (#4829)
 Make expression resolution improvements
2022-12-07 12:07:32 +01:00
कारतोफ्फेलस्क्रिप्ट™ 0a7a2f3e41
fix: Lazy load nodes for credentials testing (#4760) 2022-11-30 10:28:18 +01:00
कारतोफ्फेलस्क्रिप्ट™ b6c57e19fc
feat(core): Lazy-load nodes and credentials to reduce baseline memory usage (#4577) 2022-11-23 16:20:28 +01:00
कारतोफ्फेलस्क्रिप्ट™ 698d96a617
refactor: Setup typescript project references across workflow, core, and cli (#4519)
* refactor: use consistent folder structure across workflow, core, and cli

* setup typescript project references across workflow, core, and cli
2022-11-09 15:25:00 +01:00
कारतोफ्फेलस्क्रिप्ट™ b282c7e5d9
fix(core): make deepCopy backward compatible (#4505)
* fix(core): make `deepCopy` backward compatible

`JSON.parse(JSON.stringify())`  uses `.toJSON` when available. so should `deepCopy`

* fix(core): prevent double quotes on luxon datetimes (#4508)

* 🐛 Prevent double quotes on luxon datetimes

*  Generalize solution

* update the types in packages/workflow/src/utils.ts

* add `toJSON` check to NodeErrors.isTraversableObject as well

* move the toJSON check before the cyclic dependency check

* fix(core): keep backward compatibility in deepCopy by calling `toJSON` on objects that have it

* fix(core): updating deepCopy typings

* Revert "fix(core): updating deepCopy typings"

This reverts commit 100a0f1f3d.

* fix(core): temporarily removing Date cloning from deepCopy

* fix(core): updating deepCopy types

* fix(core): updating deepCopy

* fix(core): updating deepCopy get prototype of object

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
2022-11-02 17:44:12 +01:00
Iván Ovejero ec5ef0c50d
refactor(core): clear @ts-ignore from workflow and core packages (#4467)
* 📘 Clear all `@ts-ignore` comments from workflow package

* 👕 Default to error with package-level overrides

* refactor(core): clear all `@ts-ignore` comments from core package (#4473)

👕 Clear all `@ts-ignore` comments from core package

* ✏️ Update comment
2022-10-31 12:45:34 +01:00
Csaba Tuncsik ca60b0e203
fix(core): updating deepCopy to avoid max callstack with circular deps (#4468)
* fix(core): updating deepCopy to avoid max callstack in case of circular dep

* fix(core): show warning with path added to circular reference
2022-10-28 15:25:44 +02:00
कारतोफ्फेलस्क्रिप्ट™ 5c9b40117a
refactor: rename NodeVersionedType to VersionedNodeType and move it to the workflow package (#4443) 2022-10-25 21:33:12 +02:00
Iván Ovejero 1732324965
fix(core): amend typing for jsonParse() options (#4423)
* 📘 Amend typing for `jsonParse()` options

* ✏️ Update rule message and description

* 🔀 Cherrypick Adi's work

* 🐛 Account for falsy fallback values

* ♻️ Use `else if`

*  Add explicit error message as type

*  Consolidate utils tests

* ♻️ Use optional chaining

* 🔥 Remove patchy type error

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2022-10-24 12:48:16 +02:00
Iván Ovejero 9089dbe942
perf(tooling): Upgrade to TypeScript 4.8 (#4207)
* ⬆️ Upgrade to TypeScript 4.8

* 🔥 Remove unneeded setting

* 📦 Update `package-lock.json`

*  Restore `skipLibCheck`

* 📦 Re-update `package-lock.json`

* ♻️ Apply feedback

* ♻️ Add check to new WhatsApp node

* 📦 Update `package-lock.json`

* Update package-lock.json

* ran `npm run lintfix`

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2022-10-05 13:36:09 +02:00
Jan Oberhauser 5526057efc
feat(core): Improve paired item and add additional variables (#3765)
*  Remove duplicate and old string

*  Add telemetry

*  Futher improvements

*  Change error message and display only name of last parameter

* 👕 Fix lint issue

*  Remove not needed comments

*  Rename properties, add new ones and improve error messages

*  Add support for $execution, $prevNode and make it possible to use proxies as object

*  Some small improvements

* 🐛 Fix error message

*  Improve some error messages

*  Change resumeUrl variable and display in editor

*  Fix and extend tests

*  Multiple pairedItem improvements

*  Display "More Info" link with error messages if user can fix issue

*  Display different errors in Function Nodes
2022-09-29 23:02:25 +02:00
Mike Arvela 6e8e4f5937
fix(nodes-base): fix and harmonize all primaryDocumentation links (#4191)
* fix(nodes-base): fix and harmonize all primaryDocumentation links

* feat(workflow, cli): expose documentation links to UI via node codex

* fix(editor-ui): link to correct node and credential documentation URLs

* config(nodes-base): update 'format' script to also format node descriptor json

* chore: fix outdated links to node reference documentation
2022-09-29 13:33:16 +03:00
Mutasem Aldmour ad73f8995c
feat: add resource locator parameter (#3932)
*  Added resource locator interfaces to `n8n-workflow` package

*  Updating Trello node to use resource locator property type

*  Added resource locator prop to Delete Board` Trello operation

* ✔️ Fiixing linting errors in Trello node

*  Added list mode to Trello test node

*  Updating resource locator modes interface

*  Updating Trello test node validation messages and placeholders

* N8N-4175 resource locator component (#3812)

*  Implemented initial version of resource locator component

*  Implemented front-end validation for resource locator component. Improved responsiveness. Minor refactoring.

*  Setting resource locator default state to list. Updating hover states and expand icon.

* 🔨 Moving resource locator component to `ParameterInput` from `ParameterInputFull

* 🔨 Moving `ResourceLocator` to a separate Vue component

* 🔨 Implementing expression and drag'n'drop support in ResourceLocator` component

* 🔨 Cleaning up `ResourceLocator` component code

*  Implemented resource locator selected mode persistance

* 💄 Minor refactoring and fixes in `ResourceLocator`

* 🔨 Updating `ResourceLocator` front-end validation logic

*  Saving resource locator mode in node parameters

* 💄 Updating the `ResourceLocator` component based on the design review

* 🐛 Fixing resource locator mode parameters handling when loading node parameter values on front-end

* 💄 Removing leftover unused CSS

*  Updating interfaces to support resource locator value types

*  Updating `ResourceLocator` component to work with object parameter values

* 🔨 Cleaning up `ResourceLocator` and related components code

*  Preventing `DraggableTarget` to be sticky if disabled

* 🐛 Fixing a bug with resource locator value parameter

* 👌 Adding new type alias for all possible node parameter value types

* 👌 Updating `ResourceLocator` and related components based on PR review feedback

*  Adding disabled mode to `ResourceLocator` component, fixing expression handling, minor refactoring.

* 💄 Updating disabled state styling in `ResourceLocator` component

*  Setting correct default value for test node and removing unnecessary logic

* 💄 Added regex URL validation to Trello test node

*  Updating Trello test node with another (list mode only) test case

* ✔️ Fixing linting error in Trello node

* 🔨 Removing hardcoded custom modes and modes order

* Add value extractor to routing node (#3777)

*  add value extractor to routing node

*  add value extractor to property modes

* 🔊 improve error logging for value extractor

* 🔥 remove old extractValue methods from RoutingNode

*  extractValue inside getNodeParameter

* 🔥 remove extract value test from RoutingNode

*  make value extraction optional

* 🥅 move extract value so proper error messages are sent

* 🚨 readd accidentally removed eslint-disable

*  add resource locator support extractValue

* 🚨 remove unused import

* 🐛 fix getting value of resource locator

* 💄 Updating resource locator component styling and handling reset value action

*  create v2 of Trello node for resource locator

* 💄 Updating ResourceLocator droppable & activeDrop classes and removing input padding-right

*  Updating Trello test node with single-mode test case

*  Updating field names in Trello node to avoid name clash

* 💄 Updating test Trello node mode order and board:update parameter name

* 💄 Updating test node parameter names and display options

* List mode search endpoint (#3936)

* 🚧 super basic version of the search endpoint

This version is built using a hacked up version of the Google Drive
node. I need to properly create a v2 for it but it's does work.

* 🚧 fixed up type errors and return urls

*  add v3 of Google Drive node with RLC

*  add RLC to Google Drive Shared Drive operations

* ♻️ address some small changes requested in review

* 🐛 move list search out of /nodes/ and add check for required param

*  google drive folder search

*  google drive search sort by name

*  add searchable flag for RLC

* ✏️ fix google drive wording for v3

* Trello and Airtable search backend (#3974)

*  add search to Trello boards

*  add RLC to Trello cards

* ♻️ use new versioning system for Trello v2

* 🐛 move list search out of /nodes/ and add check for required param

*  re-add trello search methods

* 🥅 throw error if RLC search isn't sent a method name

This will likely be removed when the declarative style of search has
been added.

*  add requires filter field to RLC search

*  add searchable flag to Trello searches

*  add RLC for cardId and boardId on all operations

*  add ID and URL RLC to Airtable

* N8 n 4179 resource locator list mode (#3933)

*  Implemented initial version of list mode dropdown

*  Handling mode switching and expression support in list mode

* 🔨 Removing `sortedModes` references

*  Fixing list mode UI after latest mege

* 💄 Updating padding-right for input fields with suffix slots

*  Minor fixes to validation, mode switching logic and styling

* update error

* 2 or more regex

* update regex to be more strict

* remove expr colors

* update hint

* 🚧 super basic version of the search endpoint

This version is built using a hacked up version of the Google Drive
node. I need to properly create a v2 for it but it's does work.

* 🚧 fixed up type errors and return urls

* begin list impl

*  add v3 of Google Drive node with RLC

* fix ts issue

* introduce dropdown

* add more behavior

* update design

* show search

* add filtering

* push up selected

* add keyboard nav

* add loading

* add caching

* remove console

* fix build issues

* add debounce

* fix click

* keep event on focus

* fix input size bug

* add resource locator type

* update type

* update interface

* update resource locator types

*  add search to Trello boards

*  add RLC to Google Drive Shared Drive operations

* update

* update name

* add package

* use stringify pckg

* handle long vals

* fix bug in url id modes

* remove console log

* add lazy loading

* add lazy loading on filtering

* clean up

* make search clearable

* add error state

*  add RLC to Trello cards

* ♻️ address some small changes requested in review

* ♻️ use new versioning system for Trello v2

* refactor a bit

* fix how loading happens

* clear after blur

* update api

* comment out test code

* update api

* relaod in case of error

* update endpoint

* 🐛 move list search out of /nodes/ and add check for required param

* 🐛 move list search out of /nodes/ and add check for required param

* update req handling

* update endpoint

*  re-add trello search methods

* 🥅 throw error if RLC search isn't sent a method name

This will likely be removed when the declarative style of search has
been added.

* get api to work

* update scroll handling

*  google drive folder search

*  add requires filter field to RLC search

*  google drive search sort by name

* remove console

*  add searchable flag for RLC

*  add searchable flag to Trello searches

* update searchable

*  add RLC for cardId and boardId on all operations

*  add ID and URL RLC to Airtable

* fix up search

* remove extra padding

* add link button

* update popper pos

* format

* fix formating

* update mode change

* add name urls

* update regex and errors

* upate error

* update errors

* update airtable regex

* update trello regex rules

* udpate param name

* update

* update param

* update param

* update drive node

* update params

* add keyboard nav

* fix bug

* update airtable default mode

* fix default value issue

* hide long selected value

* update duplicate reqs

* update node

* clean up impl

* dedupe resources

* fix up nv

* resort params

* update icon

* set placeholders

* default to id mode

* add telemetry

* add refresh opt

* clean up tmp val

* revert test change

* make placeholder optional

* update validation

* remove description as param hint

* support more general values

* fix links on long names

* update resource item styles

* update pos

* update icon color

* update link alt

* check if required

* move validation to workflow

* update naming

* only show warning at param level

* show right border on focus

* fix hover on all item

* fix long  names bug

* fix expr bug

* add expr

* update legacy mode

* fix up impl

* clean up node types

* clean up types

* remove unnessary type

* clean up types

* clean up types

* clean up types

* clea n up localizaiton

* remove unused key

* clean up helpers

* clean up paraminput

* clean up paraminputfull

* refactor into one loop

* update component

* update class names

* update prop types

* update name cases

* update casing

* clean up classes

* clean up resource locator

* update drop handling

* update mode

* add url for link mode

* clear value by default

* add placeholder

* remove legacy hint

* handle expr in legacy

* fix typos

* revert padding change

* fix up spacing

* update to link component

* support urls for id

* fix replacement

* build

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
Co-authored-by: Valya Bullions <valya@n8n.io>

* refactor: Resource locator review changes (#4109)

*  Implemented initial version of list mode dropdown

*  Handling mode switching and expression support in list mode

* 🔨 Removing `sortedModes` references

*  Fixing list mode UI after latest mege

* 💄 Updating padding-right for input fields with suffix slots

*  Minor fixes to validation, mode switching logic and styling

* update error

* 2 or more regex

* update regex to be more strict

* remove expr colors

* update hint

* 🚧 super basic version of the search endpoint

This version is built using a hacked up version of the Google Drive
node. I need to properly create a v2 for it but it's does work.

* 🚧 fixed up type errors and return urls

* begin list impl

*  add v3 of Google Drive node with RLC

* fix ts issue

* introduce dropdown

* add more behavior

* update design

* show search

* add filtering

* push up selected

* add keyboard nav

* add loading

* add caching

* remove console

* fix build issues

* add debounce

* fix click

* keep event on focus

* fix input size bug

* add resource locator type

* update type

* update interface

* update resource locator types

*  add search to Trello boards

*  add RLC to Google Drive Shared Drive operations

* update

* update name

* add package

* use stringify pckg

* handle long vals

* fix bug in url id modes

* remove console log

* add lazy loading

* add lazy loading on filtering

* clean up

* make search clearable

* add error state

*  add RLC to Trello cards

* ♻️ address some small changes requested in review

* ♻️ use new versioning system for Trello v2

* refactor a bit

* fix how loading happens

* clear after blur

* update api

* comment out test code

* update api

* relaod in case of error

* update endpoint

* 🐛 move list search out of /nodes/ and add check for required param

* 🐛 move list search out of /nodes/ and add check for required param

* update req handling

* update endpoint

*  re-add trello search methods

* 🥅 throw error if RLC search isn't sent a method name

This will likely be removed when the declarative style of search has
been added.

* get api to work

* update scroll handling

*  google drive folder search

*  add requires filter field to RLC search

*  google drive search sort by name

* remove console

*  add searchable flag for RLC

*  add searchable flag to Trello searches

* update searchable

*  add RLC for cardId and boardId on all operations

*  add ID and URL RLC to Airtable

* fix up search

* remove extra padding

* add link button

* update popper pos

* format

* fix formating

* update mode change

* add name urls

* update regex and errors

* upate error

* update errors

* update airtable regex

* update trello regex rules

* udpate param name

* update

* update param

* update param

* update drive node

* update params

* add keyboard nav

* fix bug

* update airtable default mode

* fix default value issue

* hide long selected value

* update duplicate reqs

* update node

* clean up impl

* dedupe resources

* fix up nv

* resort params

* update icon

* set placeholders

* default to id mode

* add telemetry

* add refresh opt

* clean up tmp val

* revert test change

* make placeholder optional

* update validation

* remove description as param hint

* support more general values

* fix links on long names

* update resource item styles

* update pos

* update icon color

* update link alt

* check if required

* move validation to workflow

* update naming

* only show warning at param level

* show right border on focus

* fix hover on all item

* fix long  names bug

* ♻️ refactor extractValue to allow multiple props with same name

* ♻️ use correct import for displayParameterPath

* fix expr bug

* add expr

* update legacy mode

* fix up impl

* clean up node types

* clean up types

* ♻️ remove new version of google drive node

* ♻️ removed versioned Trello node for RLC

* remove unnessary type

* ♻️ remove versioned Airtable not for RLC

* clean up types

* clean up types

* clean up types

* clea n up localizaiton

* remove unused key

* clean up helpers

* clean up paraminput

* clean up paraminputfull

* refactor into one loop

* update component

* update class names

* update prop types

* update name cases

* update casing

* clean up classes

* 💬 updated RLC URL regex error wording

* clean up resource locator

* update drop handling

* update mode

* 💬 reword value extractor errors

* 🚨 remove unneeded eslint ignores for RLC modes

* 💬 update Trello 400 error message

* 🚨 re-add removed types in editor-ui

Also ts-ignore something that was clean up in another commit. I've added
a comment to fix after someone else can look at it.

* 💬 remove hints from Google Drive RLCs

* 🥅 rethrow correct errors in Trello node

*  add url for id mode on Google Drive

* 🔥 remove unused Google Drive file

* 🔊 change console.error to use logger instead

* 🔀 fix bad merges

* ♻️ small changes from review

* ♻️ remove ts-ignore

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
Co-authored-by: Mutasem <mutdmour@gmail.com>

* fix build

* update tests

* fix bug with credential card

* update popover component

* fix expressions url

* fix type issue

* format

* update alt

* fix lint issues

* fix eslint issues

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
Co-authored-by: Milorad FIlipović <miloradfilipovic19@gmail.com>
Co-authored-by: Valya <68596159+valya@users.noreply.github.com>
Co-authored-by: Valya Bullions <valya@n8n.io>
2022-09-21 15:44:45 +02:00
Michael Kret 381c09fa47
fix(core): Fix node renaming in expressions 2022-09-13 18:09:16 +03:00
कारतोफ्फेलस्क्रिप्ट™ a73ac1d94f
fix(workflow): remove a few ts-ignore and eslint-disable (#3958)
fix(workflow): remove a few `ts-ignore` and `eslint-disable`. improve typing
2022-09-09 16:34:50 +02:00
Aaron Delasy 49c85a1df8
fix: correct all the spelling typos (#3960)
* Improve code health
Fix TS typos in local variables
Fix CSS typos in local styles
Fix typos in comments
Fix typos in strings

* Fix order of n8n setup sections in CONTRIBUTING.md
2022-09-02 16:13:17 +02:00
कारतोफ्फेलस्क्रिप्ट™ dc8f8b7874
[N8N-4339] Unify all Cron-specific code. Improve typing, and add tests. (#3887) 2022-08-19 12:45:04 +02:00
Omar Ajoue f782bcd52d
fix(core): Fix issue with not displayed child workflow executions (#3867) 2022-08-12 14:31:11 +02:00
Mutasem Aldmour 679a443a0c
refactor: Add node IDs (#3788)
* update type

* add id to new nodes

* update paste/import behavior

* update duplicate/copy

* update duplicate workflow

* update import functions + templates

* add instance id on copy

* on download add instance id

* simplify for testing

* update telemetry events

* add ids to nodegraph

* not if same instance

* update spacing

* fix tests

* update tests

* add uuid

* fix tests

update tests

add uuid

fix ts issue

* fix telemetry event

* update workflow import

* update public api

* add sqlit migration

* on workflow update

* add psql migration

* add mysql migration

* revert to title

* fix telemetry bug

* remove console log

* remove migration logs

* fix copy/paste bug

* replace node index with node id

* remove console log

* address PR feedback

* address comment

* fix type issue

* fix select

* update schema

* fix ts issue

* update tel helpers

* fix eslint issues
2022-08-03 13:06:53 +02:00
agobrech a02b206170
feat(ERPNext Node): Add credential test and add support for unauthorized certs (#3732)
*  Add cred injection, cred testing, allow unauthorized certs

* Add support for skipping SSL for cred testing

* 📘 Add partial override for request options types (#3739)

* Change field names and fix error handling

* Fix typo

Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 13:50:16 +02:00
Ricardo Espinoza 994c89a6c6
feat: Add support for preAuthentication and add Metabase credentials (#3399)
*  Add preAuthentication method to credentials

* Improvements

*  Improvements

*  Add feedback

* 🔥 Remove comments

*  Add generic type to autheticate method

*  Fix typo

*  Remove console.log and fix indentation

*  Minor improvements

*  Expire credentials in every credential test run

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-07-19 10:09:06 +02:00
Omar Ajoue 088daf952e
feat(Google Ads Node): Add new node (#3526)
* Add basic layout with icon for Google Ads

* Add node versioning(V1)

* Add node and credential to package

* Add basic layout with icon for Google Ads

* Add node versioning(V1)

* Add node and credential to package

* Add api call to getall

* Fix formdata in the body for the request

* N8N-2928 Added custom queries to campaign

* Fix header bug and add developer-token field

* Add operation and fields to campaign new format

* Add more configurations and queries

* Add Invoice ressources and operations

* Remov old version from the node

* Fixed bud with typo

* Correctly prepends the baseURL

* add query to invocie request

* Fixes header not parsing the expression

* Invoice param changes

* Fixes bug related to headers not being parsed, and bug with auth

* Remove useless imports

* Added analytics to google ad node and removed useless header

* Removed url for testing

* Fixed inconsistent behaviour with the access token not being refreshed

* Added placeholders to help user

* Removed useless comments

* Resolved name confusion

* Added support for body in a GET method

* Removed hyphens, parse body's expression

* Renamed operation for clarity

* Remove unused code

* Removed invoice resource and fixed bug with body and headers

The invoice operation was removed since it does not reflect
what a user would expect from it. Google ADS invoices are
only used for big advertisers where invoicing is performed
after the end of the month and for big sums. This would
be misleading for the majority of the users expecting
an expenses report.

Also fixed a bug with header and body being sent since it
was broken for multiple input rows. The first execution
would override all others.

Lastly, made some improvements to the node itself by
transforming data, adding filters and operations.

* Improve campagin operation and remove analytics; fix tests

* Improve tooltips and descriptions

* Fix lint issues

* Improve tooltip to explain amounts in micros

* Change wording for micros

* Change the fix to a more elegant solution

Co-authored-by: Cyril Gobrecht <cyril.gobrecht@gmail.com>
Co-authored-by: Aël Gobrecht <ael.gobrecht@gmail.com>
2022-07-04 22:47:50 +02:00
brianinoa 1e4fd9e4df
feat(core): Expose item index being processed (#3590)
* 🧑‍💻 Expose item index being processed

*  Fix tests for getCurrentItemIndex

*  Fix tests for getCurrentItemIndex

*  Rename method

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-06-26 15:52:37 -07:00
Alex Grozav d18a29d588
fix(core): Updated expressions allowlist and denylist. (#3424)
* feat: Updated expressions allowlist and denylist.

* test: Added unit tests for expression allow and deny list.

* feat: Updated riot-tmpl to be installed from n8n fork.

* fix: Added check for non-standard browser built-in.

* chore: Removed package-lock.json from branch.

* chore: Removed package-lock.json from branch.

* chore: Added jest-environment-jsdom@27
2022-06-17 22:09:37 -07:00
Jan Oberhauser 04f0bf5b65 fix(core): Fix issue that parameters got lost in some edge cases 2022-06-11 18:12:04 +02:00
Jan Oberhauser 1999f4b066 fix(core): Properly resolve expressions in declarative node design 2022-06-08 18:16:55 +02:00