mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Start modularizing the community packages feature (#17757)
This commit is contained in:
@@ -20,6 +20,7 @@ export const LOG_SCOPES = [
|
||||
'workflow-activation',
|
||||
'ssh-client',
|
||||
'cron',
|
||||
'community-nodes',
|
||||
] as const;
|
||||
|
||||
export type LogScope = (typeof LOG_SCOPES)[number];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config, Env, Nested } from '../decorators';
|
||||
import { Config, Env } from '../decorators';
|
||||
|
||||
function isStringArray(input: unknown): input is string[] {
|
||||
return Array.isArray(input) && input.every((item) => typeof item === 'string');
|
||||
@@ -20,33 +20,6 @@ class JsonStringArray extends Array<string> {
|
||||
}
|
||||
}
|
||||
|
||||
@Config
|
||||
class CommunityPackagesConfig {
|
||||
/** Whether to enable community packages */
|
||||
@Env('N8N_COMMUNITY_PACKAGES_ENABLED')
|
||||
enabled: boolean = true;
|
||||
|
||||
/** NPM registry URL to pull community packages from */
|
||||
@Env('N8N_COMMUNITY_PACKAGES_REGISTRY')
|
||||
registry: string = 'https://registry.npmjs.org';
|
||||
|
||||
/** Whether to reinstall any missing community packages */
|
||||
@Env('N8N_REINSTALL_MISSING_PACKAGES')
|
||||
reinstallMissing: boolean = false;
|
||||
|
||||
/** Whether to block installation of not verified packages */
|
||||
@Env('N8N_UNVERIFIED_PACKAGES_ENABLED')
|
||||
unverifiedEnabled: boolean = true;
|
||||
|
||||
/** Whether to enable and show search suggestion of packages verified by n8n */
|
||||
@Env('N8N_VERIFIED_PACKAGES_ENABLED')
|
||||
verifiedEnabled: boolean = true;
|
||||
|
||||
/** Whether to load community packages */
|
||||
@Env('N8N_COMMUNITY_PACKAGES_PREVENT_LOADING')
|
||||
preventLoading: boolean = false;
|
||||
}
|
||||
|
||||
@Config
|
||||
export class NodesConfig {
|
||||
/** Node types to load. Includes all if unspecified. @example '["n8n-nodes-base.hackerNews"]' */
|
||||
@@ -64,7 +37,4 @@ export class NodesConfig {
|
||||
/** Whether to enable Python execution on the Code node. */
|
||||
@Env('N8N_PYTHON_ENABLED')
|
||||
pythonEnabled: boolean = true;
|
||||
|
||||
@Nested
|
||||
communityPackages: CommunityPackagesConfig;
|
||||
}
|
||||
|
||||
@@ -138,14 +138,6 @@ describe('GlobalConfig', () => {
|
||||
files: [],
|
||||
},
|
||||
nodes: {
|
||||
communityPackages: {
|
||||
enabled: true,
|
||||
registry: 'https://registry.npmjs.org',
|
||||
reinstallMissing: false,
|
||||
unverifiedEnabled: true,
|
||||
verifiedEnabled: true,
|
||||
preventLoading: false,
|
||||
},
|
||||
errorTriggerType: 'n8n-nodes-base.errorTrigger',
|
||||
include: [],
|
||||
exclude: [],
|
||||
|
||||
Reference in New Issue
Block a user