UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

103 lines (101 loc) 5.31 kB
/** * DevExtreme (cjs/__internal/core/license/license_warnings.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TEMPLATES = void 0; exports.logLicenseWarning = logLicenseWarning; const TEMPLATES = exports.TEMPLATES = Object.freeze({ warningPrefix: code => { let warningDescription = ""; switch (code) { case "W0019": warningDescription = "DevExtreme: You are using a trial (evaluation) version of DevExtreme."; break; case "W0020": warningDescription = "DevExtreme: License Key Has Expired."; break; case "W0021": warningDescription = "DevExtreme: License Key Verification Has Failed."; break; default: warningDescription = "DevExtreme: For evaluation purposes only. Redistribution prohibited." } return `${code} - ${warningDescription}` }, keyNotFound: "A devextreme-license generated key has not been specified in the GlobalConfig.", keyWasFound: (type, path) => { switch (type) { case "envVariable": return "The DevExpress license key was retrieved from the 'DevExpress_License' environment variable."; case "envPath": return "The DevExpress license key was retrieved from the 'DevExpress_LicensePath' environment variable."; case "file": return `The DevExpress license key was retrieved from file: "${path}".`; default: return "The DevExpress license key was retrieved." } }, keyVerificationFailed: (type, keyVersion, requiredVersion) => { switch (type) { case "incompatibleVersion": return `Incompatible DevExpress license key version (v${keyVersion}). Download and register an updated DevExpress license key (v${requiredVersion}+). Clear npm/IDE/NuGet cache and rebuild your project (https://devexpress.com/DX1002).`; case "trialExpired": return "Your DevExpress trial period has expired. Purchase a license to continue using DevExpress product libraries."; default: return "License key verification has failed." } }, purchaseLicense: "Please register an existing license (https://devexpress.com/DX1000) or purchase a new license (https://devexpress.com/Buy/) to continue use of the following DevExpress product libraries: DevExtreme - Included in Subscriptions: Universal, DXperience, ASP.NET and Blazor, DevExtreme Complete.", installationInstructions: "If you own a licensed/registered version or if you are using a 30-day trial version of DevExpress product libraries on a development machine, download your personal license key and verify it with the devextreme-license tool (https://devexpress.com/DX1001).", lcxUsedInsteadOfLcp: "A DevExpress license key has been specified instead of a key generated using devextreme-license.", oldDevExtremeKey: "A DevExtreme key (v25.2 or earlier) has been detected in the GlobalConfig. Generate a key with devextreme-license instead.", licenseId: id => `License ID: ${id}` }); function logLicenseWarning(warningType, version, versionInfo) { const T = TEMPLATES; const purchaseLine = `${T.warningPrefix("W0019")} ${T.purchaseLicense}`; const installLine = `${T.warningPrefix("W0021")} ${T.installationInstructions}`; const warnings = [ [purchaseLine] ]; switch (warningType) { case "no-key": warnings[warnings.length - 1].push(T.keyNotFound); warnings.push([installLine]); break; case "invalid-key": warnings[warnings.length - 1].push(T.keyVerificationFailed()); warnings.push([installLine]); break; case "lcx-used": warnings[warnings.length - 1].push(T.keyVerificationFailed(), T.lcxUsedInsteadOfLcp); warnings.push([installLine]); break; case "old-devextreme-key": warnings[warnings.length - 1].push(T.keyVerificationFailed(), T.oldDevExtremeKey); warnings.push([installLine]); break; case "version-mismatch": { const incompatibleLine = `${T.warningPrefix("W0020")} ${T.keyVerificationFailed("incompatibleVersion",null===versionInfo||void 0===versionInfo?void 0:versionInfo.keyVersion,null===versionInfo||void 0===versionInfo?void 0:versionInfo.requiredVersion)}`; warnings[warnings.length - 1].push(T.keyVerificationFailed()); warnings.push([incompatibleLine]); break } case "trial-expired": { const expiredLine = `${T.warningPrefix("W0020")} ${T.keyVerificationFailed("trialExpired")}`; warnings.push([expiredLine]); break } } warnings.forEach(group => { console.warn(group.join("\n")) }) }