feat(core): Remove conditional defaults in V1 release (#6363)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-06-02 11:10:19 +00:00 committed by कारतोफ्फेलस्क्रिप्ट™
parent e152cfe27c
commit f6366160a4
6 changed files with 7 additions and 30 deletions

View file

@ -697,20 +697,11 @@ export async function executeWebhook(
/**
* Returns the base URL of the webhooks
*
*/
export function getWebhookBaseUrl() {
let urlBaseWebhook = GenericHelpers.getBaseUrl();
// We renamed WEBHOOK_TUNNEL_URL to WEBHOOK_URL. This is here to maintain
// backward compatibility. Will be deprecated and removed in the future.
if (process.env.WEBHOOK_TUNNEL_URL !== undefined || process.env.WEBHOOK_URL !== undefined) {
// @ts-ignore
urlBaseWebhook = process.env.WEBHOOK_TUNNEL_URL || process.env.WEBHOOK_URL;
}
let urlBaseWebhook = process.env.WEBHOOK_URL ?? GenericHelpers.getBaseUrl();
if (!urlBaseWebhook.endsWith('/')) {
urlBaseWebhook += '/';
}
return urlBaseWebhook;
}

View file

@ -65,11 +65,6 @@ export abstract class BaseCommand extends Command {
this.exitWithCrash('There was an error running database migrations', error),
);
if (process.env.WEBHOOK_TUNNEL_URL) {
LoggerProxy.warn(
'You are still using the WEBHOOK_TUNNEL_URL environment variable. It has been deprecated and will be removed in a future version of n8n. Please switch to using WEBHOOK_URL instead.',
);
}
const dbType = config.getEnv('database.type');
if (['mysqldb', 'mariadb'].includes(dbType)) {

View file

@ -4,7 +4,6 @@ import path from 'path';
import convict from 'convict';
import { UserSettings } from 'n8n-core';
import { jsonParse } from 'n8n-workflow';
import { IS_V1_RELEASE } from '@/constants';
convict.addFormat({
name: 'nodes-list',
@ -225,13 +224,12 @@ export const schema = {
},
executions: {
// By default workflows get always executed in their own process.
// If this option gets set to "main" it will run them in the
// main-process instead.
// By default workflows get always executed in the main process.
// TODO: remove this and all usage of `executions.process` when `own` mode is deleted
process: {
doc: 'In what process workflows should be executed. Note: Own mode has been deprecated and will be removed in a future version as well as this setting.',
doc: 'In what process workflows should be executed.',
format: ['main', 'own'] as const,
default: IS_V1_RELEASE ? 'main' : 'own',
default: 'main',
env: 'EXECUTIONS_PROCESS',
},
@ -944,7 +942,7 @@ export const schema = {
push: {
backend: {
format: ['sse', 'websocket'] as const,
default: IS_V1_RELEASE ? 'websocket' : 'sse',
default: 'websocket',
env: 'N8N_PUSH_BACKEND',
doc: 'Backend to use for push notifications',
},

View file

@ -3,7 +3,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { readFileSync } from 'fs';
import { resolve, join, dirname } from 'path';
import { major } from 'semver';
import type { n8n } from 'n8n-core';
import { RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES, UserSettings } from 'n8n-core';
import { jsonParse } from 'n8n-workflow';
@ -30,7 +29,6 @@ export function getN8nPackageJson() {
export const START_NODES = ['n8n-nodes-base.start', 'n8n-nodes-base.manualTrigger'];
export const N8N_VERSION = getN8nPackageJson().version;
export const IS_V1_RELEASE = major(N8N_VERSION) > 0;
export const NODE_PACKAGE_PREFIX = 'n8n-nodes-';

View file

@ -12,7 +12,6 @@ import { JavaScriptSandbox } from './JavaScriptSandbox';
import { PythonSandbox } from './PythonSandbox';
import { getSandboxContext } from './Sandbox';
import { standardizeOutput } from './utils';
import { IS_V1_RELEASE } from '../../utils/constants';
export class Code implements INodeType {
description: INodeTypeDescription = {
@ -21,7 +20,7 @@ export class Code implements INodeType {
icon: 'fa:code',
group: ['transform'],
version: [1, 2],
defaultVersion: IS_V1_RELEASE ? 2 : 1,
defaultVersion: 2,
description: 'Run custom JavaScript code',
defaults: {
name: 'Code',

View file

@ -1,4 +0,0 @@
import { major } from 'semver';
import { version } from '../package.json';
export const IS_V1_RELEASE = major(version) > 0;