* Add ExecutionsUsage component * set $sidebar-expanded-width back to 200px * add days using interpolation * Rename PlanData type to CloudPlanData * Rename Metadata type to PlanMetadata * Make prop block in the update button * Use variable in line-height * Remove progressBarSection class * fix trial expiration calculation * mock expirationDate and fix issue with days left * Remove unnecesary property from class .container * inject component data via props * Check for plan data during app mounting and keep data in the store * Remove mounted hook * redirect when upgrade plan is clicked * Remove computed properties * Remove instance property as it's not needed anymore * Flatten plan object * remove console.log * Add all cloud types within its own namespace * keep redirection inside component * get computed properties back * Improve polling logic * Move cloudData to its own store * Remove commented interfaces * remove cloudPlan from user store * fix imports * update logic for userIsTrialing method * centralize userIsTrialing method * redirect to production change plan page always * Call staging or production cloud api depending on base URL * remove setting store form ExecutionUsage.vue * fix linting issue * Add trial group to PlanMetadata group * Move helpers into the store * make staging url check more specific * make cloud state nullable * fix linting issue * swap mockup date for endpoint * Make getCurrentPlan async * asas * Improvements * small improvements * chore: resolve conflicts * make sure there is data before calculating trial expiration * Fix issue with component not loading on first page load * type safety improvements * apply component ui feedback * fix linting issue * chore: clean up unnecessary change from merge conflict * feat: Block api feature using licenses, show notice page for trial cloud users (#6187) * rename planSpec to plan * Remove instance property as it's not needed anymore * Flatten plan object * remove console.log * feat: disable api using license * feat: add api page * chore: resolve conflicts * chore: resolve conflicts * feat: update and refactor a bit * fix: update endpoints * fix: update endpoints * fix: use host * feat: update copy * fix linting issues --------- Co-authored-by: ricardo <ricardoespinoza105@gmail.com> * add pluralization to days left text --------- Co-authored-by: Mutasem <mutdmour@gmail.com> Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
90 lines
3.6 KiB
TypeScript
90 lines
3.6 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
/* 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';
|
|
|
|
const { NODE_ENV, E2E_TESTS } = process.env;
|
|
export const inProduction = NODE_ENV === 'production';
|
|
export const inDevelopment = !NODE_ENV || NODE_ENV === 'development';
|
|
export const inTest = NODE_ENV === 'test';
|
|
export const inE2ETests = E2E_TESTS === 'true';
|
|
|
|
export const CUSTOM_API_CALL_NAME = 'Custom API Call';
|
|
export const CUSTOM_API_CALL_KEY = '__CUSTOM_API_CALL__';
|
|
|
|
export const CLI_DIR = resolve(__dirname, '..');
|
|
export const TEMPLATES_DIR = join(CLI_DIR, 'templates');
|
|
export const NODES_BASE_DIR = dirname(require.resolve('n8n-nodes-base'));
|
|
export const GENERATED_STATIC_DIR = join(UserSettings.getUserHome(), '.cache/n8n/public');
|
|
export const EDITOR_UI_DIST_DIR = join(dirname(require.resolve('n8n-editor-ui')), 'dist');
|
|
|
|
export function getN8nPackageJson() {
|
|
return jsonParse<n8n.PackageJson>(readFileSync(join(CLI_DIR, 'package.json'), 'utf8'));
|
|
}
|
|
|
|
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-';
|
|
|
|
export const STARTER_TEMPLATE_NAME = `${NODE_PACKAGE_PREFIX}starter`;
|
|
|
|
export const RESPONSE_ERROR_MESSAGES = {
|
|
NO_CREDENTIAL: 'Credential not found',
|
|
NO_NODE: 'Node not found',
|
|
NO_ENCRYPTION_KEY: CORE_RESPONSE_ERROR_MESSAGES.NO_ENCRYPTION_KEY,
|
|
PACKAGE_NAME_NOT_PROVIDED: 'Package name is required',
|
|
PACKAGE_NAME_NOT_VALID: `Package name is not valid - it must start with "${NODE_PACKAGE_PREFIX}"`,
|
|
PACKAGE_NOT_INSTALLED: 'This package is not installed - you must install it first',
|
|
PACKAGE_FAILED_TO_INSTALL: 'Package could not be installed - check logs for details',
|
|
PACKAGE_NOT_FOUND: 'Package not found in npm',
|
|
PACKAGE_VERSION_NOT_FOUND: 'The specified package version was not found',
|
|
PACKAGE_DOES_NOT_CONTAIN_NODES: 'The specified package does not contain any nodes',
|
|
PACKAGE_LOADING_FAILED: 'The specified package could not be loaded',
|
|
DISK_IS_FULL: 'There appears to be insufficient disk space',
|
|
};
|
|
|
|
export const AUTH_COOKIE_NAME = 'n8n-auth';
|
|
|
|
export const NPM_COMMAND_TOKENS = {
|
|
NPM_PACKAGE_NOT_FOUND_ERROR: '404 Not Found',
|
|
NPM_PACKAGE_VERSION_NOT_FOUND_ERROR: 'No matching version found for',
|
|
NPM_NO_VERSION_AVAILABLE: 'No valid versions available',
|
|
NPM_DISK_NO_SPACE: 'ENOSPC',
|
|
NPM_DISK_INSUFFICIENT_SPACE: 'insufficient space',
|
|
};
|
|
|
|
export const NPM_PACKAGE_STATUS_GOOD = 'OK';
|
|
|
|
export const UNKNOWN_FAILURE_REASON = 'Unknown failure reason';
|
|
|
|
export const WORKFLOW_REACTIVATE_INITIAL_TIMEOUT = 1000; // 1 second
|
|
export const WORKFLOW_REACTIVATE_MAX_TIMEOUT = 24 * 60 * 60 * 1000; // 1 day
|
|
|
|
export const SETTINGS_LICENSE_CERT_KEY = 'license.cert';
|
|
|
|
export const enum LICENSE_FEATURES {
|
|
SHARING = 'feat:sharing',
|
|
LDAP = 'feat:ldap',
|
|
SAML = 'feat:saml',
|
|
LOG_STREAMING = 'feat:logStreaming',
|
|
ADVANCED_EXECUTION_FILTERS = 'feat:advancedExecutionFilters',
|
|
VARIABLES = 'feat:variables',
|
|
VERSION_CONTROL = 'feat:versionControl',
|
|
API_DISABLED = 'feat:apiDisabled',
|
|
}
|
|
|
|
export const enum LICENSE_QUOTAS {
|
|
TRIGGER_LIMIT = 'quota:activeWorkflows',
|
|
VARIABLES_LIMIT = 'quota:maxVariables',
|
|
}
|
|
|
|
export const CREDENTIAL_BLANKING_VALUE = '__n8n_BLANK_VALUE_e5362baf-c777-4d57-a609-6eaf1f9e87f6';
|