n8n/packages/nodes-base/nodes/Code/Sandbox.ts

167 lines
5.4 KiB
TypeScript
Raw Normal View History

feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
import { ValidationError } from './ValidationError';
import { isObject } from './utils';
import type { IExecuteFunctions, INodeExecutionData, IWorkflowDataProxyData } from 'n8n-workflow';
interface SandboxTextKeys {
object: {
singular: string;
plural: string;
};
}
export interface SandboxContext extends IWorkflowDataProxyData {
$getNodeParameter: IExecuteFunctions['getNodeParameter'];
$getWorkflowStaticData: IExecuteFunctions['getWorkflowStaticData'];
helpers: IExecuteFunctions['helpers'];
}
export const REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem']);
export function getSandboxContext(this: IExecuteFunctions, index: number): SandboxContext {
return {
// from NodeExecuteFunctions
$getNodeParameter: this.getNodeParameter,
$getWorkflowStaticData: this.getWorkflowStaticData,
helpers: this.helpers,
// to bring in all $-prefixed vars and methods from WorkflowDataProxy
// $node, $items(), $parameter, $json, $env, etc.
...this.getWorkflowDataProxy(index),
};
}
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
export abstract class Sandbox {
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
constructor(
private textKeys: SandboxTextKeys,
protected itemIndex: number | undefined,
private helpers: IExecuteFunctions['helpers'],
) {}
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
abstract runCodeAllItems(): Promise<INodeExecutionData[]>;
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
abstract runCodeEachItem(): Promise<INodeExecutionData | undefined>;
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
validateRunCodeEachItem(executionResult: INodeExecutionData | undefined): INodeExecutionData {
if (typeof executionResult !== 'object') {
throw new ValidationError({
message: `Code doesn't return ${this.getTextKey('object', { includeArticle: true })}`,
description: `Please return ${this.getTextKey('object', {
includeArticle: true,
})} representing the output item. ('${executionResult}' was returned instead.)`,
itemIndex: this.itemIndex,
});
}
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
if (Array.isArray(executionResult)) {
const firstSentence =
executionResult.length > 0
? `An array of ${typeof executionResult[0]}s was returned.`
: 'An empty array was returned.';
throw new ValidationError({
message: `Code doesn't return a single ${this.getTextKey('object')}`,
description: `${firstSentence} If you need to output multiple items, please use the 'Run Once for All Items' mode instead.`,
itemIndex: this.itemIndex,
});
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
}
const [returnData] = this.helpers.normalizeItems([executionResult]);
this.validateItem(returnData);
// If at least one top-level key is a supported item key (`json`, `binary`, etc.),
// and another top-level key is unrecognized, then the user mis-added a property
// directly on the item, when they intended to add it on the `json` property
this.validateTopLevelKeys(returnData);
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
return returnData;
}
validateRunCodeAllItems(
executionResult: INodeExecutionData | INodeExecutionData[] | undefined,
itemIndex?: number,
): INodeExecutionData[] {
if (typeof executionResult !== 'object') {
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
throw new ValidationError({
message: "Code doesn't return items properly",
description: `Please return an array of ${this.getTextKey('object', {
plural: true,
})}, one for each item you would like to output.`,
itemIndex,
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
});
}
if (Array.isArray(executionResult)) {
/**
* If at least one top-level key is an n8n item key (`json`, `binary`, etc.),
* then require all item keys to be an n8n item key.
*
* If no top-level key is an n8n key, then skip this check, allowing non-n8n
* item keys to be wrapped in `json` when normalizing items below.
*/
const mustHaveTopLevelN8nKey = executionResult.some((item) =>
Object.keys(item).find((key) => REQUIRED_N8N_ITEM_KEYS.has(key)),
);
if (mustHaveTopLevelN8nKey) {
for (const item of executionResult) {
this.validateTopLevelKeys(item);
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
}
}
}
const returnData = this.helpers.normalizeItems(executionResult);
returnData.forEach((item) => this.validateItem(item));
return returnData;
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
}
private getTextKey(
key: keyof SandboxTextKeys,
options?: { includeArticle?: boolean; plural?: boolean },
) {
const response = this.textKeys[key][options?.plural ? 'plural' : 'singular'];
if (!options?.includeArticle) {
return response;
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
}
if (['a', 'e', 'i', 'o', 'u'].some((value) => response.startsWith(value))) {
return `an ${response}`;
}
return `a ${response}`;
}
private validateItem({ json, binary }: INodeExecutionData) {
if (json === undefined || !isObject(json)) {
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
throw new ValidationError({
message: `A 'json' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
description: `In the returned data, every key named 'json' must point to ${this.getTextKey(
'object',
{ includeArticle: true },
)}.`,
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
itemIndex: this.itemIndex,
});
}
if (binary !== undefined && !isObject(binary)) {
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
throw new ValidationError({
message: `A 'binary' property isn't ${this.getTextKey('object', { includeArticle: true })}`,
description: `In the returned data, every key named 'binary must point to ${this.getTextKey(
'object',
{ includeArticle: true },
)}.`,
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
itemIndex: this.itemIndex,
});
}
}
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
private validateTopLevelKeys(item: INodeExecutionData) {
Object.keys(item).forEach((key) => {
if (REQUIRED_N8N_ITEM_KEYS.has(key)) return;
feat(Code Node): create Code node (#3965) * Introduce node deprecation (#3930) :sparkles: Introduce node deprecation * :construction: Scaffold out Code node * :shirt: Fix lint * :blue_book: Create types file * :truck: Rename theme * :fire: Remove unneeded prop * :zap: Override keybindings * :zap: Expand lintings * :zap: Create editor content getter * :truck: Ensure all helpers use `$` * :sparkles: Add autocompletion * :zap: Filter out welcome note node * :zap: Convey error line number * :zap: Highlight error line * :zap: Restore logging from node * :sparkles: More autocompletions * :zap: Streamline completions * :pencil2: Update placeholders * :zap: Update linter to new methods * :fire: Remove `$nodeItem` completions * :zap: Re-update placeholders * :art: Fix formatting * :package: Update `package-lock.json` * :zap: Refresh with multi-line empty string * :zap: Account for syntax errors * :fire: Remove unneeded variant * :zap: Minor improvements * :zap: Add more autocompletions * :truck: Rename extension * :fire: Remove outdated comments * :truck: Rename field * :sparkles: More autocompletions * :zap: Fix up error display when empty text * :fire: Remove logging * :sparkles: More error validation * :bug: Fix `pairedItem` to `pairedItem()` * :zap: Add item to validation info * :package: Update `package-lock.json` * :zap: Leftover fixes * :zap: Set `insertNewlineAndIndent` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :shirt: Add lint exception * :blue_book: Add type to mixin type * Clean up comment * :zap: Refactor completion per new requirements * :zap: Adjust placeholders * :zap: Add `json` autocompletions for `$input` * :art: Set border * :zap: Restore local completion source * :zap: Implement autocompletion for imports * :zap: Add `.*` to follow user typing on autocompletion * :blue_book: Fix typings in autocompletions * :shirt: Add linting for use of `item()` * :package: Update `package-lock.json` * :bug: Fix for `$items(nodeName)[0]` * :zap: Filter down built-in modules list * :zap: Refactor error handling * :zap: Linter and validation improvements * :zap: Apply review feedback * :recycle: More general refactorings * :zap: Add dot notation utility * Customize input handler * :zap: Support `.json.` completions * :zap: Adjust placeholder * :zap: Sort imports * :fire: Remove blank rows addition * :zap: Add more error validation * :package: Update `package-lock.json` * :zap: Make date logging consistent * :wrench: Adjust linting highlight range * :zap: Add line numbers to each item mode errors * :zap: Allow for links in error descriptions * :zap: More input validation * :zap: Expand linting to loops * :zap: Deprecate Function and Function Item nodes * :bug: Fix placeholder syntax * :blue_book: Narrow down type * :truck: Rename using kebab-case * :fire: Remove `mapGetters` * :pencil2: Fix casing * :zap: Adjust import for type * :pencil2: Fix quotes * :bug: Fix `activeNode` reference * :zap: Use constant * :fire: Remove logging * :pencil2: Fix typo * :zap: Add missing `notice` * :pencil2: Add tags * :pencil2: Fix alias * :pencil2: Update copy * :fire: Remove wrong linting * :pencil2: Update copy * :zap: Add validation for `null` * :zap: Add validation for non-object and non-array * :zap: Add validation for non-array with json * :pencil2: Intentionally use wrong spelling * :zap: More validation * :pencil2: More copy updates * :pencil2: Placeholder updates * :rewind: Restore spelling * :zap: Fix var name * :pencil2: More copy updates * :zap: Add luxon autocompletions * :zap: Make scrollable * :zap: Fix comma from merge conflict resolution * :package: Update `package-lock.json` * :shirt: Fix lint detail * :art: Set font family * :zap: Bring in expressions fix * :recycle: Address feedback * :zap: Exclude codemirror packages from render chunks * :bug: Fix placeholder not showing on first load * feat(editor-ui): Replace `lezer` with `esprima` in client linter (#4192) * :fire: Remove addition from misresolved conflict * :zap: Replace `lezer` with `esprima` in client linter * :zap: Add missing key * :package: Update `package-lock.json` * :zap: Match dependencies * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :zap: Match whitespace * :bug: Fix selection * :zap: Expand validation * :fire: Remove validation * :pencil2: Update copy * :truck: Move to constants * :zap: More `null` validation * :zap: Support `all()` with index to access item * :zap: Gloss over n8n syntax error * :art: Re-style diagnostic button * :fire: Remove `item` as `itemAlias` * :zap: Add linting for `item.json` in single item mode * :zap: Refactor to add label info descriptions * :zap: More autocompletions * :shirt: Fix lint * :zap: Simplify typings * feat(nodes-base): Multiline autocompletion for `code-node-editor` (#4220) * :zap: Simplify typings * :zap: Consolidate helpers in utils * :zap: Multiline autocompletion for standalone vars * :fire: Remove unneeded mixins * :pencil2: Update copy * :pencil2: Prep TODOs * :zap: Multiline completion for `$input.method` + `$input.item` * :fire: Remove unused method * :fire: Remove another unused method * :truck: Move luxon strings to helpers * :zap: Multiline autocompletion for methods output * :zap: Refactor to use optional chaining * :shirt: Fix lint * :pencil2: Update TODOs * :zap: Multiline autocompletion for `json` fields * :blue_book: Add typings * :zap: De-duplicate callback to forEach * :bug: Fix autocompletions not working with leading whitespace * :globe_with_meridians: Apply i18n * :shirt: Fix lint * :constructor: Second-period var usage completions * :shirt: Fix lint * :shirt: Add exception * :zap: Add completion telemetry * :blue_book: Add typing * :zap: Major refactoring to organize * :bug: Fix multiline `.all()[index]` * :bug: Do not autoclose square brackets prior to `.json` * :bug: Fix accessor for multiline `jsonField` completions * :zap: Add completions for half-assignments * :bug: Fix `jsonField` completions for `x.json` * :pencil2: Improve comments * :bug: Fix `.json[field]` for multiline matches * :zap: Cleanup * :package: Update `package-lock.json` * :shirt: Fix lint * :bug: Rely on original value for custom matcher * :zap: Create `customMatcherJsonFieldCompletions` to simplify setup * :bug: Include selector in `customMatcherJsonField` completions * :pencil2: Make naming consistent * :pencil2: Add docline * :zap: Finish self-review cleanup * :fire: Remove outdated comment * :pushpin: Pin luxon to major-minor * :pencil2: Fix typo * :package: Update `package-lock.json` * :package: Update `package-lock.json` * :package: Re-update `package-lock.json` * :heavy_plus_sign: Add `luxon` for Gmail node * :package: Update `package-lock.json` * :zap: Replace Function with Code in suggested nodes * :bug: Fix `$prevNode` completions * :pencil2: Update `$execution.mode` copy * :zap: Separate luxon getters from methods * :zap: Adjusting linter to tolerate `.binary` * :zap: Adjust top-level item keys check * :zap: Anticipate user expecting `item` to pre-exist * :zap: Add linting for legacy item access * :zap: Add hint for attempted `items` access * :zap: Add keybinding for toggling comments * :pencil2: Update copy of `all`, `first`, `last` and `itemMatching` * :bug: Make `input.all()` etc act on copies * :package: Update `package-lock.json` * :bug: Fix guard in `$input.last()` * :recycle: Address Jan's feedback * :arrow_up: Upgrade `eslint-plugin-n8n-nodes-base` * :package: Update `package-lock.json` * :fire: Remove unneeded exceptions * :zap: Restore placeholder logic * :zap: Add placeholders to client * :zap: Account for shadow item * :pencil2: More completion info labels * :shirt: Fix lint * :pencil2: Update copy * :pencil2: Update copy * :pencil2: More copy updates * :package: Update `package-lock.json` * :zap: Add more validation * :zap: Add placheolder on first load * Replace `Cmd` with `Mod` * :package: Update `package-lock.json`
2022-10-13 05:28:02 -07:00
throw new ValidationError({
message: `Unknown top-level item key: ${key}`,
description: 'Access the properties of an item under `.json`, e.g. `item.json`',
itemIndex: this.itemIndex,
});
});
}
}