UNPKG

n8n

Version:

n8n Workflow Automation Tool

57 lines 3.17 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnverifiedPackagesRule = void 0; const decorators_1 = require("@n8n/decorators"); const community_packages_config_1 = require("../../../community-packages/community-packages.config"); let UnverifiedPackagesRule = class UnverifiedPackagesRule { constructor(communityPackagesConfig) { this.communityPackagesConfig = communityPackagesConfig; this.id = 'unverified-packages-v3'; } getMetadata() { return { version: 'v3', title: 'Unverified community packages are disabled by default', description: 'The default of N8N_UNVERIFIED_PACKAGES_ENABLED changes to false. Installed community packages that are not verified by n8n will stop loading unless the variable is explicitly set to true.', category: "environment", severity: 'medium', }; } async detect() { const isAffected = this.communityPackagesConfig.enabled && process.env.N8N_UNVERIFIED_PACKAGES_ENABLED === undefined; if (!isAffected) return { isAffected: false, instanceIssues: [], recommendations: [] }; return { isAffected: true, instanceIssues: [ { title: 'Instance relies on the current default for unverified packages', description: 'N8N_UNVERIFIED_PACKAGES_ENABLED is not set, so this instance currently allows unverified community packages. After the update, workflows using nodes from unverified packages will fail to load them.', level: 'warning', }, ], recommendations: [ { action: 'Set N8N_UNVERIFIED_PACKAGES_ENABLED explicitly', description: 'Review your installed community packages. If any are unverified and you want to keep using them, set N8N_UNVERIFIED_PACKAGES_ENABLED=true before updating.', }, ], }; } }; exports.UnverifiedPackagesRule = UnverifiedPackagesRule; exports.UnverifiedPackagesRule = UnverifiedPackagesRule = __decorate([ (0, decorators_1.BreakingChangeRule)({ version: 'v3' }), __metadata("design:paramtypes", [community_packages_config_1.CommunityPackagesConfig]) ], UnverifiedPackagesRule); //# sourceMappingURL=unverified-packages.rule.js.map