Skip to content

Commit

Permalink
Merge branch 'master' into ado-6-ndv-simplify-credentials
Browse files Browse the repository at this point in the history
* master: (38 commits)
  📚 Add warning about latest version
  fix: Upgrade `jsonwebtoken` to address CVE-2022-23540 (#5116)
  refactor: Upgrade typeorm to 0.3.x (#5151)
  refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)
  📚 Update CHANGELOG.md and main package.json to 0.211.0
  🔖 Release n8n@0.211.0
  ⬆️ Set n8n-core@0.151.0, n8n-editor-ui@0.177.0, n8n-nodes-base@0.209.0 and n8n-workflow@0.133.0 on n8n
  🔖 Release n8n-editor-ui@0.177.0
  ⬆️ Set n8n-design-system@0.51.0 and n8n-workflow@0.133.0 on n8n-editor-ui
  🔖 Release n8n-design-system@0.51.0
  🔖 Release n8n-nodes-base@0.209.0
  ⬆️ Set n8n-core@0.151.0 and n8n-workflow@0.133.0 on n8n-nodes-base
  🔖 Release n8n-node-dev@0.90.0
  ⬆️ Set n8n-core@0.151.0 and n8n-workflow@0.133.0 on n8n-node-dev
  🔖 Release n8n-core@0.151.0
  ⬆️ Set n8n-workflow@0.133.0 on n8n-core
  🔖 Release n8n-workflow@0.133.0
  fix(PayPal  Trigger Node): Omit verification on sandbox env (#5150)
  fix(core): Throw error in UI on expression referencing missing node but do not fail execution (#5158)
  fix(Zoom Node): Add notice about deprecation of Zoom JWT app support (#5156)
  ...

# Conflicts:
#	packages/editor-ui/src/constants.ts
  • Loading branch information
MiloradFilipovic committed Jan 16, 2023
2 parents f4057c3 + 38aa99b commit 24d3cac
Show file tree
Hide file tree
Showing 398 changed files with 4,538 additions and 4,432 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]

steps:
- name: Call Start URL - optionally
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# [0.211.0](https://github.com/n8n-io/n8n/compare/n8n@0.210.2...n8n@0.211.0) (2023-01-13)

> **Do not update**
> We are recommend not to update past version 0.210.2 as there seem to be some issues with expressions in version 0.211.0
### Bug Fixes

* **core:** Fixes event msg confirmations if no subscribers present ([#5118](https://github.com/n8n-io/n8n/issues/5118)) ([62d06b1](https://github.com/n8n-io/n8n/commit/62d06b1e6edb8a8a6dfb4c57de6ef3e095e6301c))
* **core:** Remove threads pkg, rewrite log writer worker ([#5134](https://github.com/n8n-io/n8n/issues/5134)) ([e845eb3](https://github.com/n8n-io/n8n/commit/e845eb33f9d0881ae5c8a26d4eab4f2109373ff5))
* **core:** Throw error in UI on expression referencing missing node but do not fail execution ([#5158](https://github.com/n8n-io/n8n/issues/5158)) ([c9e158e](https://github.com/n8n-io/n8n/commit/c9e158e45848ee94b04f49694a552f9f272a97dd))
* DB revert command shouldn't run full migrations before each revert ([#5131](https://github.com/n8n-io/n8n/issues/5131)) ([a9fb393](https://github.com/n8n-io/n8n/commit/a9fb393e1a260a2dc26ef0f759f541fcde1c722f))
* **editor:** Disable data pinning on multiple output node types ([#5111](https://github.com/n8n-io/n8n/issues/5111)) ([56951e8](https://github.com/n8n-io/n8n/commit/56951e83c0fb03a24ddb4cd0b1705e22165b8692))
* **editor:** Do not overwrite window.onerror in production ([#5135](https://github.com/n8n-io/n8n/issues/5135)) ([0dbba6d](https://github.com/n8n-io/n8n/commit/0dbba6d57f34b67935867bd81359fb833654fce1))
* **editor:** Execution page bug fixes ([#5122](https://github.com/n8n-io/n8n/issues/5122)) ([665eaef](https://github.com/n8n-io/n8n/commit/665eaef925d2e311377ecb09859f69f5fddc54b5))
* **editor:** Fixes event bus test ([#5119](https://github.com/n8n-io/n8n/issues/5119)) ([871a1d7](https://github.com/n8n-io/n8n/commit/871a1d7dad839b080df3a27fb68ea90033562f3f))
* **editor:** Hide data pinning discoverability tooltip in execution view ([#5145](https://github.com/n8n-io/n8n/issues/5145)) ([d10ca53](https://github.com/n8n-io/n8n/commit/d10ca530cff1580c20670dd68dfd7937e1a78d74))
* **editor:** Mapping tooltip dismiss ([#5128](https://github.com/n8n-io/n8n/issues/5128)) ([6deb551](https://github.com/n8n-io/n8n/commit/6deb55126e9f493de4717018a3587088f1d5ab41))
* **editor:** Recover from unsaved finished execution ([#5121](https://github.com/n8n-io/n8n/issues/5121)) ([af55ecd](https://github.com/n8n-io/n8n/commit/af55ecd64b1d4948fc08d7d32900fa9d57ef299b))
* **editor:** Setting NDV session ID ([#5144](https://github.com/n8n-io/n8n/issues/5144)) ([c724de6](https://github.com/n8n-io/n8n/commit/c724de6be2e33fe824c42c0ab8242caa9f1133f3))
* First/last being extended on proxy objects ([#5140](https://github.com/n8n-io/n8n/issues/5140)) ([9dca984](https://github.com/n8n-io/n8n/commit/9dca984c0ce68dd9c1ab14a6454c356dddf8287f))
* Handle memory issues gracefully ([#5147](https://github.com/n8n-io/n8n/issues/5147)) ([1445424](https://github.com/n8n-io/n8n/commit/14454243e7e0b40fc766cdb05c6b34756fb59109))
* **PayPal Trigger Node:** Omit verification on sandbox env ([#5150](https://github.com/n8n-io/n8n/issues/5150)) ([e140ecb](https://github.com/n8n-io/n8n/commit/e140ecbc2c6a07b96df3d048eb138dd34b25d2ce))
* Report app startup and DB migration errors to Sentry ([#5127](https://github.com/n8n-io/n8n/issues/5127)) ([a573db2](https://github.com/n8n-io/n8n/commit/a573db2ef78024a4254ff0f468dc47b12148aa28))
* Run every DB migration inside a transaction ([#5129](https://github.com/n8n-io/n8n/issues/5129)) ([62cce2e](https://github.com/n8n-io/n8n/commit/62cce2e518451f6057e316208828539f26868c18))
* Upgrade `class-validator` to address CVE-2019-18413 ([#5139](https://github.com/n8n-io/n8n/issues/5139)) ([14a61f6](https://github.com/n8n-io/n8n/commit/14a61f6ab1f0289e1b96480e3d557d14dd8178d8))
* **Zoom Node:** Add notice about deprecation of Zoom JWT app support ([#5156](https://github.com/n8n-io/n8n/issues/5156)) ([146bc3b](https://github.com/n8n-io/n8n/commit/146bc3bff503be70abaad94418535f23ff8fc511))


### Features

* Add demo experiment to help users activate ([#5141](https://github.com/n8n-io/n8n/issues/5141)) ([c2eb519](https://github.com/n8n-io/n8n/commit/c2eb519398067e799e73b6c3059f57f3deca172a))
* **editor:** Executions page ([#4997](https://github.com/n8n-io/n8n/issues/4997)) ([819c4ad](https://github.com/n8n-io/n8n/commit/819c4adb3cd79c1743debd97c21fc60a2a703534))
* **editor:** Remove prevent-ndv-auto-open feature flag ([#5114](https://github.com/n8n-io/n8n/issues/5114)) ([ab4785a](https://github.com/n8n-io/n8n/commit/ab4785ab31da061df13a6b37fe8790ddc30e3ed0))
* **editor:** Update callout component design ([#5126](https://github.com/n8n-io/n8n/issues/5126)) ([d2d481f](https://github.com/n8n-io/n8n/commit/d2d481f12e1777a60ee5411c8cdac50b1dfc3ee3))
* Expression extension framework ([#4372](https://github.com/n8n-io/n8n/issues/4372)) ([3d05acf](https://github.com/n8n-io/n8n/commit/3d05acf3130cce2c5b5155d91faa22b707ce2373)), closes [#4045](https://github.com/n8n-io/n8n/issues/4045) [#4044](https://github.com/n8n-io/n8n/issues/4044) [#4046](https://github.com/n8n-io/n8n/issues/4046)



## [0.210.2](https://github.com/n8n-io/n8n/compare/n8n@0.210.1...n8n@0.210.2) (2023-01-09)


Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.210.2",
"version": "0.211.0",
"private": true,
"homepage": "https://n8n.io",
"engines": {
Expand Down Expand Up @@ -67,6 +67,7 @@
"browserslist": "^4.21.4",
"ejs": "^3.1.8",
"fork-ts-checker-webpack-plugin": "^6.0.4",
"jsonwebtoken": "9.0.0",
"cpy@8>globby": "^11.1.0",
"qqjs>globby": "^11.1.0"
}
Expand Down
25 changes: 12 additions & 13 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.210.2",
"version": "0.211.0",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -72,7 +72,7 @@
"@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.6",
"@types/json-diff": "^0.5.1",
"@types/jsonwebtoken": "^8.5.2",
"@types/jsonwebtoken": "^9.0.0",
"@types/localtunnel": "^1.9.0",
"@types/lodash.get": "^4.4.6",
"@types/lodash.intersection": "^4.4.7",
Expand Down Expand Up @@ -124,7 +124,7 @@
"bull": "^4.10.2",
"callsites": "^3.1.0",
"change-case": "^4.1.1",
"class-validator": "^0.13.1",
"class-validator": "^0.14.0",
"client-oauth2": "^4.2.5",
"compression": "^1.7.4",
"connect-history-api-fallback": "^1.6.0",
Expand All @@ -144,7 +144,7 @@
"ioredis": "^5.2.4",
"json-diff": "^0.5.4",
"jsonschema": "^1.4.1",
"jsonwebtoken": "^8.5.1",
"jsonwebtoken": "^9.0.0",
"jwks-rsa": "~1.12.1",
"localtunnel": "^2.0.0",
"lodash.get": "^4.4.2",
Expand All @@ -161,11 +161,11 @@
"lodash.uniqby": "^4.7.0",
"lodash.unset": "^4.5.2",
"luxon": "^3.1.0",
"mysql2": "~2.3.0",
"n8n-core": "~0.150.1",
"n8n-editor-ui": "~0.176.2",
"n8n-nodes-base": "~0.208.2",
"n8n-workflow": "~0.132.1",
"mysql2": "~2.3.3",
"n8n-core": "~0.151.0",
"n8n-editor-ui": "~0.177.0",
"n8n-nodes-base": "~0.209.0",
"n8n-workflow": "~0.133.0",
"nodemailer": "^6.7.1",
"oauth-1.0a": "^2.2.6",
"open": "^7.0.0",
Expand All @@ -175,7 +175,7 @@
"passport": "^0.6.0",
"passport-cookie": "^1.0.9",
"passport-jwt": "^4.0.0",
"pg": "^8.3.0",
"pg": "^8.8.0",
"picocolors": "^1.0.0",
"posthog-node": "^2.2.2",
"prom-client": "^13.1.0",
Expand All @@ -184,13 +184,12 @@
"semver": "^7.3.8",
"shelljs": "^0.8.5",
"source-map-support": "^0.5.21",
"sqlite3": "^5.1.2",
"sqlite3": "^5.1.4",
"sse-channel": "^4.0.0",
"swagger-ui-express": "^4.3.0",
"syslog-client": "^1.1.1",
"threads": "^1.7.0",
"tslib": "1.14.1",
"typeorm": "0.2.45",
"typeorm": "0.3.11",
"uuid": "^8.3.2",
"validator": "13.7.0",
"winston": "^3.3.3",
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/src/AbstractServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import bodyParser from 'body-parser';
import bodyParserXml from 'body-parser-xml';
import compression from 'compression';
import parseUrl from 'parseurl';
import { getConnectionManager } from 'typeorm';
import type { RedisOptions } from 'ioredis';

import {
Expand Down Expand Up @@ -162,10 +161,10 @@ export abstract class AbstractServer {
this.app.get('/healthz', async (req, res) => {
Logger.debug('Health check started!');

const connection = getConnectionManager().get();
const connection = Db.getConnection();

try {
if (!connection.isConnected) {
if (!connection.isInitialized) {
// Connection is not active
throw new ServiceUnavailableError('No active database connection!');
}
Expand Down
41 changes: 24 additions & 17 deletions packages/cli/src/ActiveWorkflowRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,18 @@ export class ActiveWorkflowRunner {
path = path.slice(0, -1);
}

let webhook = await Db.collections.Webhook.findOne({
let webhook = await Db.collections.Webhook.findOneBy({
webhookPath: path,
method: httpMethod,
});
let webhookId: string | undefined;

// check if path is dynamic
if (webhook === undefined) {
if (webhook === null) {
// check if a dynamic webhook path exists
const pathElements = path.split('/');
webhookId = pathElements.shift();
const dynamicWebhooks = await Db.collections.Webhook.find({
const dynamicWebhooks = await Db.collections.Webhook.findBy({
webhookId,
method: httpMethod,
pathLength: pathElements.length,
Expand Down Expand Up @@ -243,7 +243,7 @@ export class ActiveWorkflowRunner {
webhook = dynamicWebhook;
}
});
if (webhook === undefined) {
if (webhook === null) {
throw new ResponseHelper.NotFoundError(
`The requested webhook "${httpMethod} ${path}" is not registered.`,
WEBHOOK_PROD_UNREGISTERED_HINT,
Expand All @@ -263,10 +263,11 @@ export class ActiveWorkflowRunner {
});
}

const workflowData = await Db.collections.Workflow.findOne(webhook.workflowId, {
const workflowData = await Db.collections.Workflow.findOne({
where: { id: webhook.workflowId },
relations: ['shared', 'shared.user', 'shared.user.globalRole'],
});
if (workflowData === undefined) {
if (workflowData === null) {
throw new ResponseHelper.NotFoundError(
`Could not find workflow with id "${webhook.workflowId}"`,
);
Expand Down Expand Up @@ -331,20 +332,19 @@ export class ActiveWorkflowRunner {

/**
* Gets all request methods associated with a single webhook
*
* @param {string} path webhook path
*/
async getWebhookMethods(path: string): Promise<string[]> {
const webhooks = await Db.collections.Webhook.find({ webhookPath: path });
const webhooks = await Db.collections.Webhook.find({
select: ['method'],
where: { webhookPath: path },
});

// Gather all request methods in string array
const webhookMethods: string[] = webhooks.map((webhook) => webhook.method);
return webhookMethods;
return webhooks.map((webhook) => webhook.method);
}

/**
* Returns the ids of the currently active workflows
*
*/
async getActiveWorkflows(user?: User): Promise<IWorkflowDb[]> {
let activeWorkflows: WorkflowEntity[] = [];
Expand Down Expand Up @@ -378,7 +378,10 @@ export class ActiveWorkflowRunner {
* @param {string} id The id of the workflow to check
*/
async isActive(id: string): Promise<boolean> {
const workflow = await Db.collections.Workflow.findOne(id);
const workflow = await Db.collections.Workflow.findOne({
select: ['active'],
where: { id },
});
return !!workflow?.active;
}

Expand Down Expand Up @@ -434,6 +437,7 @@ export class ActiveWorkflowRunner {

try {
// eslint-disable-next-line no-await-in-loop
// TODO: this should happen in a transaction, that way we don't need to manually remove this in `catch`
await Db.collections.Webhook.insert(webhook);
const webhookExists = await workflow.runWebhookMethod(
'checkExists',
Expand Down Expand Up @@ -503,10 +507,11 @@ export class ActiveWorkflowRunner {
*
*/
async removeWorkflowWebhooks(workflowId: string): Promise<void> {
const workflowData = await Db.collections.Workflow.findOne(workflowId, {
const workflowData = await Db.collections.Workflow.findOne({
where: { id: workflowId },
relations: ['shared', 'shared.user', 'shared.user.globalRole'],
});
if (workflowData === undefined) {
if (workflowData === null) {
throw new Error(`Could not find workflow with id "${workflowId}"`);
}

Expand Down Expand Up @@ -772,7 +777,8 @@ export class ActiveWorkflowRunner {
let workflowInstance: Workflow;
try {
if (workflowData === undefined) {
workflowData = (await Db.collections.Workflow.findOne(workflowId, {
workflowData = (await Db.collections.Workflow.findOne({
where: { id: workflowId },
relations: ['shared', 'shared.user', 'shared.user.globalRole'],
})) as IWorkflowDb;
}
Expand Down Expand Up @@ -883,7 +889,7 @@ export class ActiveWorkflowRunner {
/**
* Add a workflow to the activation queue.
* Meaning it will keep on trying to activate it in regular
* amounts indefinetly.
* amounts indefinitely.
*/
addQueuedWorkflowActivation(
activationMode: WorkflowActivateMode,
Expand Down Expand Up @@ -962,6 +968,7 @@ export class ActiveWorkflowRunner {
*
* @param {string} workflowId The id of the workflow to deactivate
*/
// TODO: this should happen in a transaction
async remove(workflowId: string): Promise<void> {
if (this.activeWorkflows !== null) {
// Remove all the webhooks of the workflow
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/CommunityNodes/packageModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import * as Db from '@/Db';
import { InstalledNodes } from '@db/entities/InstalledNodes';
import { InstalledPackages } from '@db/entities/InstalledPackages';

export async function findInstalledPackage(
packageName: string,
): Promise<InstalledPackages | undefined> {
return Db.collections.InstalledPackages.findOne(packageName, { relations: ['installedNodes'] });
export async function findInstalledPackage(packageName: string): Promise<InstalledPackages | null> {
return Db.collections.InstalledPackages.findOne({
where: { packageName },
relations: ['installedNodes'],
});
}

export async function isPackageInstalled(packageName: string): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/CredentialsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class CredentialsHelper extends ICredentialsHelper {
relations: ['credentials'],
where: { credentials: { id: nodeCredential.id, type }, userId },
}).then((shared) => shared.credentials)
: await Db.collections.Credentials.findOneOrFail({ id: nodeCredential.id, type });
: await Db.collections.Credentials.findOneByOrFail({ id: nodeCredential.id, type });

if (!credential) {
throw new Error(
Expand Down Expand Up @@ -765,8 +765,8 @@ export async function getCredentialForUser(
*/
export async function getCredentialWithoutUser(
credentialId: string,
): Promise<ICredentialsDb | undefined> {
return Db.collections.Credentials.findOne(credentialId);
): Promise<ICredentialsDb | null> {
return Db.collections.Credentials.findOneBy({ id: credentialId });
}

export function createCredentialsFromCredentialsEntity(
Expand Down
Loading

0 comments on commit 24d3cac

Please sign in to comment.