diff --git a/packages/cli/commands/import/workflow.ts b/packages/cli/commands/import/workflow.ts index e27ac2dd16..6ca37d0000 100644 --- a/packages/cli/commands/import/workflow.ts +++ b/packages/cli/commands/import/workflow.ts @@ -6,7 +6,6 @@ import { INode, INodeCredentialsDetails, LoggerProxy } from 'n8n-workflow'; import * as fs from 'fs'; import * as glob from 'fast-glob'; -import * as path from 'path'; import { UserSettings } from 'n8n-core'; import { getLogger } from '../../src/Logger'; import { Db, ICredentialsDb } from '../../src'; @@ -86,9 +85,12 @@ export class ImportWorkflowsCommand extends Command { const credentialsEntities = (await Db.collections.Credentials?.find()) ?? []; let i; if (flags.separate) { - const files = await glob( - `${flags.input.endsWith(path.sep) ? flags.input : flags.input + path.sep}*.json`, - ); + let inputPath = flags.input; + if (process.platform === 'win32') { + inputPath = inputPath.replace(/\\/g, '/'); + } + inputPath = inputPath.replace(/\/$/g, ''); + const files = await glob(`${inputPath}/*.json`); for (i = 0; i < files.length; i++) { const workflow = JSON.parse(fs.readFileSync(files[i], { encoding: 'utf8' })); if (credentialsEntities.length > 0) { diff --git a/packages/cli/package.json b/packages/cli/package.json index 8dc2ef1da8..ff8d68d177 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.149.0", + "version": "0.150.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -70,6 +70,7 @@ "@types/open": "^6.1.0", "@types/parseurl": "^1.3.1", "@types/request-promise-native": "~1.0.15", + "@types/validator": "^13.7.0", "concurrently": "^5.1.0", "jest": "^26.4.2", "nodemon": "^2.0.2", @@ -110,10 +111,10 @@ "localtunnel": "^2.0.0", "lodash.get": "^4.4.2", "mysql2": "~2.3.0", - "n8n-core": "~0.93.0", - "n8n-editor-ui": "~0.116.0", - "n8n-nodes-base": "~0.146.0", - "n8n-workflow": "~0.76.0", + "n8n-core": "~0.94.0", + "n8n-editor-ui": "~0.117.0", + "n8n-nodes-base": "~0.147.0", + "n8n-workflow": "~0.77.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", "pg": "^8.3.0", diff --git a/packages/core/package.json b/packages/core/package.json index dfc9c18a51..c32b699888 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "0.93.0", + "version": "0.94.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -50,7 +50,7 @@ "form-data": "^4.0.0", "lodash.get": "^4.4.2", "mime-types": "^2.1.27", - "n8n-workflow": "~0.76.0", + "n8n-workflow": "~0.77.0", "oauth-1.0a": "^2.2.6", "p-cancelable": "^2.0.0", "qs": "^6.10.1", diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 7a1b8c79ad..d42b67bd26 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -1,6 +1,6 @@ { "name": "n8n-design-system", - "version": "0.6.0", + "version": "0.7.0", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", "author": { diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index a25b55f8b8..6bee0efaa8 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "0.116.0", + "version": "0.117.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -26,7 +26,7 @@ }, "dependencies": { "@fontsource/open-sans": "^4.5.0", - "n8n-design-system": "~0.6.0", + "n8n-design-system": "~0.7.0", "timeago.js": "^4.0.2", "v-click-outside": "^3.1.2", "vue-fragment": "^1.5.2", @@ -74,7 +74,7 @@ "lodash.debounce": "^4.0.8", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", - "n8n-workflow": "~0.76.0", + "n8n-workflow": "~0.77.0", "normalize-wheel": "^1.0.1", "prismjs": "^1.17.1", "quill": "^2.0.0-dev.3", diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 3c2de68f43..5fe6c772e5 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -1,6 +1,6 @@ { "name": "n8n-node-dev", - "version": "0.33.0", + "version": "0.34.0", "description": "CLI to simplify n8n credentials/node development", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -60,8 +60,8 @@ "change-case": "^4.1.1", "copyfiles": "^2.1.1", "inquirer": "^7.0.1", - "n8n-core": "~0.93.0", - "n8n-workflow": "~0.76.0", + "n8n-core": "~0.94.0", + "n8n-workflow": "~0.77.0", "oauth-1.0a": "^2.2.6", "replace-in-file": "^6.0.0", "request": "^2.88.2", diff --git a/packages/nodes-base/nodes/Jira/IssueDescription.ts b/packages/nodes-base/nodes/Jira/IssueDescription.ts index d8acd74384..9965921a8a 100644 --- a/packages/nodes-base/nodes/Jira/IssueDescription.ts +++ b/packages/nodes-base/nodes/Jira/IssueDescription.ts @@ -164,6 +164,18 @@ export const issueFields = [ default: '', description: 'Description', }, + { + displayName: 'Components', + name: 'componentIds', + type: 'multiOptions', + typeOptions: { + loadOptionsMethod: 'getProjectComponents', + loadOptionsDependsOn: [ + 'project', + ], + }, + default: [], + }, { displayName: 'Custom Fields', name: 'customFieldsUi', diff --git a/packages/nodes-base/nodes/Jira/IssueInterface.ts b/packages/nodes-base/nodes/Jira/IssueInterface.ts index bef90057a9..1e7b21b0ba 100644 --- a/packages/nodes-base/nodes/Jira/IssueInterface.ts +++ b/packages/nodes-base/nodes/Jira/IssueInterface.ts @@ -12,6 +12,7 @@ export interface IFields { project?: IDataObject; summary?: string; reporter?: IDataObject; + components?: IDataObject[]; } export interface IIssue { diff --git a/packages/nodes-base/nodes/Jira/Jira.node.ts b/packages/nodes-base/nodes/Jira/Jira.node.ts index 579840d3a9..e4520453b8 100644 --- a/packages/nodes-base/nodes/Jira/Jira.node.ts +++ b/packages/nodes-base/nodes/Jira/Jira.node.ts @@ -427,6 +427,30 @@ export class Jira implements INodeType { } return returnData; }, + + // Get all the components to display them to user so that he can + // select them easily + async getProjectComponents(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + + const project = this.getCurrentNodeParameter('project'); + const { values: components } = await jiraSoftwareCloudApiRequest.call(this, `/api/2/project/${project}/component`, 'GET'); + + for (const component of components) { + returnData.push({ + name: component.name, + value: component.id, + }); + } + + returnData.sort((a, b) => { + if (a.name < b.name) { return -1; } + if (a.name > b.name) { return 1; } + return 0; + }); + + return returnData; + }, }, }; @@ -492,6 +516,9 @@ export class Jira implements INodeType { if (additionalFields.updateHistory) { qs.updateHistory = additionalFields.updateHistory as boolean; } + if (additionalFields.componentIds) { + fields.components = (additionalFields.componentIds as string[]).map(id => ({ id })); + } if (additionalFields.customFieldsUi) { const customFields = (additionalFields.customFieldsUi as IDataObject).customFieldsValues as IDataObject[]; if (customFields) { diff --git a/packages/nodes-base/nodes/ServiceNow/IncidentDescription.ts b/packages/nodes-base/nodes/ServiceNow/IncidentDescription.ts index 021a6e4983..5d5ce44656 100644 --- a/packages/nodes-base/nodes/ServiceNow/IncidentDescription.ts +++ b/packages/nodes-base/nodes/ServiceNow/IncidentDescription.ts @@ -186,7 +186,7 @@ export const incidentFields = [ options: [ { name: 'Low', - value: 1, + value: 3, }, { name: 'Medium', @@ -194,7 +194,7 @@ export const incidentFields = [ }, { name: 'High', - value: 3, + value: 1, }, ], default: '', @@ -240,7 +240,7 @@ export const incidentFields = [ options: [ { name: 'Low', - value: 1, + value: 3, }, { name: 'Medium', @@ -248,7 +248,7 @@ export const incidentFields = [ }, { name: 'High', - value: 3, + value: 1, }, ], default: '', @@ -590,7 +590,7 @@ export const incidentFields = [ options: [ { name: 'Low', - value: 1, + value: 3, }, { name: 'Medium', @@ -598,7 +598,7 @@ export const incidentFields = [ }, { name: 'High', - value: 3, + value: 1, }, ], default: '', @@ -654,7 +654,7 @@ export const incidentFields = [ options: [ { name: 'Low', - value: 1, + value: 3, }, { name: 'Medium', @@ -662,7 +662,7 @@ export const incidentFields = [ }, { name: 'High', - value: 3, + value: 1, }, ], default: '', diff --git a/packages/nodes-base/nodes/Xero/GenericFunctions.ts b/packages/nodes-base/nodes/Xero/GenericFunctions.ts index 1ee4b040b9..79a20f32ad 100644 --- a/packages/nodes-base/nodes/Xero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Xero/GenericFunctions.ts @@ -26,7 +26,6 @@ export async function xeroApiRequest(this: IExecuteFunctions | IExecuteSingleFun try { if (body.organizationId) { options.headers = { ...options.headers, 'Xero-tenant-id': body.organizationId }; - delete body.organizationId; } if (Object.keys(headers).length !== 0) { options.headers = Object.assign({}, options.headers, headers); diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 39fe635f6d..4671dffff6 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.146.0", + "version": "0.147.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -673,7 +673,7 @@ "@types/xml2js": "^0.4.3", "gulp": "^4.0.0", "jest": "^26.4.2", - "n8n-workflow": "~0.76.0", + "n8n-workflow": "~0.77.0", "nodelinter": "^0.1.9", "ts-jest": "^26.3.0", "tslint": "^6.1.2", @@ -713,7 +713,7 @@ "mqtt": "4.2.6", "mssql": "^6.2.0", "mysql2": "~2.3.0", - "n8n-core": "~0.93.0", + "n8n-core": "~0.94.0", "node-ssh": "^12.0.0", "nodemailer": "^6.5.0", "pdf-parse": "^1.1.1", diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 2e35eff0d3..b52d14f925 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "n8n-workflow", - "version": "0.76.0", + "version": "0.77.0", "description": "Workflow base code of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/workflow/src/Expression.ts b/packages/workflow/src/Expression.ts index b7fd4d0138..0ecc6e0a93 100644 --- a/packages/workflow/src/Expression.ts +++ b/packages/workflow/src/Expression.ts @@ -117,6 +117,8 @@ export class Expression { // Execute the expression try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call + tmpl.tmpl('{{global=this;}}', data); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call const returnValue = tmpl.tmpl(parameterValue, data); if (typeof returnValue === 'function') {