first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import { baseConfig } from '@n8n/eslint-config/base';
|
||||
|
||||
export default defineConfig(baseConfig, {
|
||||
rules: {
|
||||
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@n8n/constants",
|
||||
"version": "0.19.0",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist .turbo",
|
||||
"dev": "pnpm watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"format": "biome format --write .",
|
||||
"format:check": "biome ci .",
|
||||
"lint": "eslint . --quiet",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"watch": "tsc -p tsconfig.build.json --watch"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "src/index.ts",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist/**/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@n8n/typescript-config": "workspace:*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const N8N_IO_BASE_URL = 'https://api.n8n.io/api/';
|
||||
@@ -0,0 +1 @@
|
||||
export const BROWSER_ID_STORAGE_KEY = 'n8n-browserId';
|
||||
@@ -0,0 +1 @@
|
||||
export const NPM_COMMUNITY_NODE_SEARCH_API_URL = 'https://api.npms.io/v2/';
|
||||
@@ -0,0 +1 @@
|
||||
export const TOOL_EXECUTOR_NODE_NAME = 'PartialExecutionToolExecutor';
|
||||
@@ -0,0 +1,130 @@
|
||||
export * from './api';
|
||||
export * from './browser';
|
||||
export * from './community-nodes';
|
||||
export * from './instance';
|
||||
export * from './execution';
|
||||
export * from './logstreaming';
|
||||
|
||||
export const LICENSE_FEATURES = {
|
||||
SHARING: 'feat:sharing',
|
||||
LDAP: 'feat:ldap',
|
||||
SAML: 'feat:saml',
|
||||
OIDC: 'feat:oidc',
|
||||
MFA_ENFORCEMENT: 'feat:mfaEnforcement',
|
||||
LOG_STREAMING: 'feat:logStreaming',
|
||||
ADVANCED_EXECUTION_FILTERS: 'feat:advancedExecutionFilters',
|
||||
VARIABLES: 'feat:variables',
|
||||
SOURCE_CONTROL: 'feat:sourceControl',
|
||||
API_DISABLED: 'feat:apiDisabled',
|
||||
EXTERNAL_SECRETS: 'feat:externalSecrets',
|
||||
SHOW_NON_PROD_BANNER: 'feat:showNonProdBanner',
|
||||
DEBUG_IN_EDITOR: 'feat:debugInEditor',
|
||||
BINARY_DATA_S3: 'feat:binaryDataS3',
|
||||
MULTIPLE_MAIN_INSTANCES: 'feat:multipleMainInstances',
|
||||
WORKER_VIEW: 'feat:workerView',
|
||||
ADVANCED_PERMISSIONS: 'feat:advancedPermissions',
|
||||
PROJECT_ROLE_ADMIN: 'feat:projectRole:admin',
|
||||
PROJECT_ROLE_EDITOR: 'feat:projectRole:editor',
|
||||
PROJECT_ROLE_VIEWER: 'feat:projectRole:viewer',
|
||||
AI_ASSISTANT: 'feat:aiAssistant',
|
||||
ASK_AI: 'feat:askAi',
|
||||
COMMUNITY_NODES_CUSTOM_REGISTRY: 'feat:communityNodes:customRegistry',
|
||||
AI_CREDITS: 'feat:aiCredits',
|
||||
FOLDERS: 'feat:folders',
|
||||
INSIGHTS_VIEW_SUMMARY: 'feat:insights:viewSummary',
|
||||
INSIGHTS_VIEW_DASHBOARD: 'feat:insights:viewDashboard',
|
||||
INSIGHTS_VIEW_HOURLY_DATA: 'feat:insights:viewHourlyData',
|
||||
API_KEY_SCOPES: 'feat:apiKeyScopes',
|
||||
WORKFLOW_DIFFS: 'feat:workflowDiffs',
|
||||
NAMED_VERSIONS: 'feat:namedVersions',
|
||||
CUSTOM_ROLES: 'feat:customRoles',
|
||||
AI_BUILDER: 'feat:aiBuilder',
|
||||
DYNAMIC_CREDENTIALS: 'feat:dynamicCredentials',
|
||||
PERSONAL_SPACE_POLICY: 'feat:personalSpacePolicy',
|
||||
} as const;
|
||||
|
||||
export const LICENSE_QUOTAS = {
|
||||
TRIGGER_LIMIT: 'quota:activeWorkflows',
|
||||
VARIABLES_LIMIT: 'quota:maxVariables',
|
||||
USERS_LIMIT: 'quota:users',
|
||||
WORKFLOW_HISTORY_PRUNE_LIMIT: 'quota:workflowHistoryPrune',
|
||||
TEAM_PROJECT_LIMIT: 'quota:maxTeamProjects',
|
||||
AI_CREDITS: 'quota:aiCredits',
|
||||
INSIGHTS_MAX_HISTORY_DAYS: 'quota:insights:maxHistoryDays',
|
||||
INSIGHTS_RETENTION_MAX_AGE_DAYS: 'quota:insights:retention:maxAgeDays',
|
||||
INSIGHTS_RETENTION_PRUNE_INTERVAL_DAYS: 'quota:insights:retention:pruneIntervalDays',
|
||||
WORKFLOWS_WITH_EVALUATION_LIMIT: 'quota:evaluations:maxWorkflows',
|
||||
} as const;
|
||||
|
||||
export const UNLIMITED_LICENSE_QUOTA = -1;
|
||||
export const DEFAULT_WORKFLOW_HISTORY_PRUNE_LIMIT = 24;
|
||||
|
||||
export type BooleanLicenseFeature = (typeof LICENSE_FEATURES)[keyof typeof LICENSE_FEATURES];
|
||||
export type NumericLicenseFeature = (typeof LICENSE_QUOTAS)[keyof typeof LICENSE_QUOTAS];
|
||||
|
||||
export const LDAP_FEATURE_NAME = 'features.ldap';
|
||||
|
||||
export type ConnectionSecurity = 'none' | 'tls' | 'startTls';
|
||||
|
||||
export interface LdapConfig {
|
||||
loginEnabled: boolean;
|
||||
loginLabel: string;
|
||||
connectionUrl: string;
|
||||
allowUnauthorizedCerts: boolean;
|
||||
connectionSecurity: ConnectionSecurity;
|
||||
connectionPort: number;
|
||||
baseDn: string;
|
||||
bindingAdminDn: string;
|
||||
bindingAdminPassword: string;
|
||||
firstNameAttribute: string;
|
||||
lastNameAttribute: string;
|
||||
emailAttribute: string;
|
||||
loginIdAttribute: string;
|
||||
ldapIdAttribute: string;
|
||||
userFilter: string;
|
||||
synchronizationEnabled: boolean;
|
||||
synchronizationInterval: number; // minutes
|
||||
searchPageSize: number;
|
||||
searchTimeout: number;
|
||||
/**
|
||||
* Enforce email uniqueness in LDAP directory.
|
||||
* When enabled, blocks login if multiple LDAP accounts share the same email.
|
||||
* Prevents privilege escalation via email-based account linking.
|
||||
*/
|
||||
enforceEmailUniqueness: boolean;
|
||||
}
|
||||
|
||||
export const LDAP_DEFAULT_CONFIGURATION: LdapConfig = {
|
||||
loginEnabled: false,
|
||||
loginLabel: '',
|
||||
connectionUrl: '',
|
||||
allowUnauthorizedCerts: false,
|
||||
connectionSecurity: 'none',
|
||||
connectionPort: 389,
|
||||
baseDn: '',
|
||||
bindingAdminDn: '',
|
||||
bindingAdminPassword: '',
|
||||
firstNameAttribute: '',
|
||||
lastNameAttribute: '',
|
||||
emailAttribute: '',
|
||||
loginIdAttribute: '',
|
||||
ldapIdAttribute: '',
|
||||
userFilter: '',
|
||||
synchronizationEnabled: false,
|
||||
synchronizationInterval: 60,
|
||||
searchPageSize: 0,
|
||||
searchTimeout: 60,
|
||||
enforceEmailUniqueness: true,
|
||||
};
|
||||
|
||||
export { Time } from './time';
|
||||
|
||||
export const MIN_PASSWORD_CHAR_LENGTH = 8;
|
||||
|
||||
export const MAX_PASSWORD_CHAR_LENGTH = 64;
|
||||
|
||||
/**
|
||||
* Character set used for generating nanoid IDs across n8n.
|
||||
* Includes digits (0-9), uppercase letters (A-Z), and lowercase letters (a-z).
|
||||
*/
|
||||
export const NANOID_ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
@@ -0,0 +1,8 @@
|
||||
export const INSTANCE_ID_HEADER = 'n8n-instance-id';
|
||||
export const INSTANCE_VERSION_HEADER = 'n8n-version';
|
||||
|
||||
export const INSTANCE_TYPES = ['main', 'webhook', 'worker'] as const;
|
||||
export type InstanceType = (typeof INSTANCE_TYPES)[number];
|
||||
|
||||
export const INSTANCE_ROLES = ['unset', 'leader', 'follower'] as const;
|
||||
export type InstanceRole = (typeof INSTANCE_ROLES)[number];
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Time } from './time';
|
||||
|
||||
export const LOGSTREAMING_DEFAULT_MAX_FREE_SOCKETS = 5;
|
||||
export const LOGSTREAMING_DEFAULT_MAX_SOCKETS = 50;
|
||||
export const LOGSTREAMING_DEFAULT_MAX_TOTAL_SOCKETS = 100;
|
||||
export const LOGSTREAMING_DEFAULT_SOCKET_TIMEOUT_MS = 5 * Time.seconds.toMilliseconds;
|
||||
|
||||
export const LOGSTREAMING_CB_DEFAULT_MAX_DURATION_MS = 3 * Time.minutes.toMilliseconds;
|
||||
export const LOGSTREAMING_CB_DEFAULT_MAX_FAILURES = 5;
|
||||
export const LOGSTREAMING_CB_DEFAULT_HALF_OPEN_REQUESTS = 2;
|
||||
export const LOGSTREAMING_CB_DEFAULT_FAILURE_WINDOW_MS = 1 * Time.minutes.toMilliseconds;
|
||||
export const LOGSTREAMING_CB_DEFAULT_CONCURRENT_HALF_OPEN_REQUESTS = 1;
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Convert time from any time unit to any other unit
|
||||
*/
|
||||
export const Time = {
|
||||
milliseconds: {
|
||||
toHours: 1 / (60 * 60 * 1000),
|
||||
toMinutes: 1 / (60 * 1000),
|
||||
toSeconds: 1 / 1000,
|
||||
},
|
||||
seconds: {
|
||||
toMilliseconds: 1000,
|
||||
},
|
||||
minutes: {
|
||||
toMilliseconds: 60 * 1000,
|
||||
},
|
||||
hours: {
|
||||
toMilliseconds: 60 * 60 * 1000,
|
||||
toSeconds: 60 * 60,
|
||||
},
|
||||
days: {
|
||||
toSeconds: 24 * 60 * 60,
|
||||
toMilliseconds: 24 * 60 * 60 * 1000,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "dist/build.tsbuildinfo"
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@n8n/typescript-config/tsconfig.common.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"types": ["node", "jest"],
|
||||
"baseUrl": "src",
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user