Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mui/x-license-pro

Package Overview
Dependencies
Maintainers
6
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/x-license-pro - npm Package Compare versions

Comparing version 5.6.1 to 5.7.0

bin/license-decode-script.js

1

cli/license-cli.d.ts

@@ -0,1 +1,2 @@

export declare function licenseDecodeCli(): void;
export declare function licenseGenCli(): void;
/* eslint-disable no-console */
import * as yargs from 'yargs';
import { generateLicence } from '../generateLicense/generateLicense';
import { base64Decode } from '../encoding/base64';
const oneDayInMs = 1000 * 60 * 60 * 24;
export function licenseDecodeCli() {
yargs.command({
command: '$0',
describe: 'Decode a license key',
builder: command => {
return command.option('key', {
default: '',
alias: 'k',
describe: 'License key.',
type: 'string'
});
},
handler: argv => {
if (!argv.key) {
throw new Error('MUI: You forgot to pass a license key. $ > licensegen -k xxx');
}
console.log(`Decoding license key "${argv.key}"`);
const license = base64Decode(argv.key.substr(32));
console.log(`Decoded license: \n${license}`);
}
}).help().strict(true).version(false).parse();
}
export function licenseGenCli() {
yargs.command({
command: '$0',
describe: 'Generates Component.propTypes from TypeScript declarations',
describe: 'Generates a license key',
builder: command => {

@@ -10,0 +34,0 @@ return command.option('order', {

@@ -5,1 +5,2 @@ export * from './generateLicense';

export * from './useLicenseVerifier';
export * from './Watermark';

5

index.js

@@ -1,2 +0,2 @@

/** @license MUI v5.6.1
/** @license MUI v5.7.0
*

@@ -9,2 +9,3 @@ * This source code is licensed under the MIT license found in the

export * from './verifyLicense';
export * from './useLicenseVerifier';
export * from './useLicenseVerifier';
export * from './Watermark';
/* eslint-disable no-console */
import * as yargs from 'yargs';
import { generateLicence } from '../generateLicense/generateLicense';
import { base64Decode } from '../encoding/base64';
var oneDayInMs = 1000 * 60 * 60 * 24;
export function licenseDecodeCli() {
yargs.command({
command: '$0',
describe: 'Decode a license key',
builder: function builder(command) {
return command.option('key', {
default: '',
alias: 'k',
describe: 'License key.',
type: 'string'
});
},
handler: function handler(argv) {
if (!argv.key) {
throw new Error('MUI: You forgot to pass a license key. $ > licensegen -k xxx');
}
console.log("Decoding license key \"".concat(argv.key, "\""));
var license = base64Decode(argv.key.substr(32));
console.log("Decoded license: \n".concat(license));
}
}).help().strict(true).version(false).parse();
}
export function licenseGenCli() {
yargs.command({
command: '$0',
describe: 'Generates Component.propTypes from TypeScript declarations',
describe: 'Generates a license key',
builder: function builder(command) {

@@ -10,0 +34,0 @@ return command.option('order', {

@@ -1,2 +0,2 @@

/** @license MUI v5.6.1
/** @license MUI v5.7.0
*

@@ -9,2 +9,3 @@ * This source code is licensed under the MIT license found in the

export * from './verifyLicense';
export * from './useLicenseVerifier';
export * from './useLicenseVerifier';
export * from './Watermark';

@@ -6,16 +6,29 @@ import * as React from 'react';

import { LicenseStatus } from '../utils/licenseStatus';
export function useLicenseVerifier() {
var sharedLicenseStatuses = {};
export function useLicenseVerifier(packageName, releaseInfo) {
return React.useMemo(function () {
var newLicenseStatus = verifyLicense(LicenseInfo.getReleaseInfo(), LicenseInfo.getKey());
var _sharedLicenseStatuse;
if (newLicenseStatus === LicenseStatus.Invalid) {
var licenseKey = LicenseInfo.getLicenseKey();
if (licenseKey && ((_sharedLicenseStatuse = sharedLicenseStatuses[packageName]) == null ? void 0 : _sharedLicenseStatuse.key) === licenseKey) {
return sharedLicenseStatuses[packageName].status;
}
var licenseStatus = verifyLicense(releaseInfo, licenseKey);
sharedLicenseStatuses[packageName] = {
key: licenseStatus,
status: licenseStatus
};
if (licenseStatus === LicenseStatus.Invalid) {
showInvalidLicenseError();
} else if (newLicenseStatus === LicenseStatus.NotFound) {
} else if (licenseStatus === LicenseStatus.NotFound) {
showNotFoundLicenseError();
} else if (newLicenseStatus === LicenseStatus.Expired) {
} else if (licenseStatus === LicenseStatus.Expired) {
showExpiredLicenseError();
}
return newLicenseStatus;
}, []);
return licenseStatus;
}, [packageName, releaseInfo]);
}
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
/* eslint-disable no-underscore-dangle */
import { ponyfillGlobal } from '@mui/utils'; // Store the license information in a global so it can be shared
import { ponyfillGlobal } from '@mui/utils';
// Store the license information in a global, so it can be shared
// when module duplication occurs. The duplication of the modules can happen
// if using multiple version of MUI X at the same time of the bundler
// decide to duplicate to improve the size of the chunks.
// eslint-disable-next-line no-underscore-dangle
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
key: undefined,
releaseInfo: undefined
key: undefined
};

@@ -20,10 +18,11 @@ export var LicenseInfo = /*#__PURE__*/function () {

_createClass(LicenseInfo, null, [{
key: "getKey",
value: function getKey() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.key;
key: "getLicenseInfo",
value: function getLicenseInfo() {
// eslint-disable-next-line no-underscore-dangle
return ponyfillGlobal.__MUI_LICENSE_INFO__;
}
}, {
key: "getReleaseInfo",
value: function getReleaseInfo() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo;
key: "getLicenseKey",
value: function getLicenseKey() {
return LicenseInfo.getLicenseInfo().key;
}

@@ -33,9 +32,5 @@ }, {

value: function setLicenseKey(key) {
ponyfillGlobal.__MUI_LICENSE_INFO__.key = key;
var licenseInfo = LicenseInfo.getLicenseInfo();
licenseInfo.key = key;
}
}, {
key: "setReleaseInfo",
value: function setReleaseInfo(encodedReleaseInfo) {
ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo = encodedReleaseInfo;
}
}]);

@@ -42,0 +37,0 @@

/* eslint-disable no-console */
import * as yargs from 'yargs';
import { generateLicence } from '../generateLicense/generateLicense';
import { base64Decode } from '../encoding/base64';
const oneDayInMs = 1000 * 60 * 60 * 24;
export function licenseDecodeCli() {
yargs.command({
command: '$0',
describe: 'Decode a license key',
builder: command => {
return command.option('key', {
default: '',
alias: 'k',
describe: 'License key.',
type: 'string'
});
},
handler: argv => {
if (!argv.key) {
throw new Error('MUI: You forgot to pass a license key. $ > licensegen -k xxx');
}
console.log(`Decoding license key "${argv.key}"`);
const license = base64Decode(argv.key.substr(32));
console.log(`Decoded license: \n${license}`);
}
}).help().strict(true).version(false).parse();
}
export function licenseGenCli() {
yargs.command({
command: '$0',
describe: 'Generates Component.propTypes from TypeScript declarations',
describe: 'Generates a license key',
builder: command => {

@@ -10,0 +34,0 @@ return command.option('order', {

@@ -1,2 +0,2 @@

/** @license MUI v5.6.1
/** @license MUI v5.7.0
*

@@ -9,2 +9,3 @@ * This source code is licensed under the MIT license found in the

export * from './verifyLicense';
export * from './useLicenseVerifier';
export * from './useLicenseVerifier';
export * from './Watermark';

@@ -6,16 +6,27 @@ import * as React from 'react';

import { LicenseStatus } from '../utils/licenseStatus';
export function useLicenseVerifier() {
const sharedLicenseStatuses = {};
export function useLicenseVerifier(packageName, releaseInfo) {
return React.useMemo(() => {
const newLicenseStatus = verifyLicense(LicenseInfo.getReleaseInfo(), LicenseInfo.getKey());
const licenseKey = LicenseInfo.getLicenseKey();
if (newLicenseStatus === LicenseStatus.Invalid) {
if (licenseKey && sharedLicenseStatuses[packageName]?.key === licenseKey) {
return sharedLicenseStatuses[packageName].status;
}
const licenseStatus = verifyLicense(releaseInfo, licenseKey);
sharedLicenseStatuses[packageName] = {
key: licenseStatus,
status: licenseStatus
};
if (licenseStatus === LicenseStatus.Invalid) {
showInvalidLicenseError();
} else if (newLicenseStatus === LicenseStatus.NotFound) {
} else if (licenseStatus === LicenseStatus.NotFound) {
showNotFoundLicenseError();
} else if (newLicenseStatus === LicenseStatus.Expired) {
} else if (licenseStatus === LicenseStatus.Expired) {
showExpiredLicenseError();
}
return newLicenseStatus;
}, []);
return licenseStatus;
}, [packageName, releaseInfo]);
}

@@ -1,28 +0,25 @@

/* eslint-disable no-underscore-dangle */
import { ponyfillGlobal } from '@mui/utils'; // Store the license information in a global so it can be shared
import { ponyfillGlobal } from '@mui/utils';
// Store the license information in a global, so it can be shared
// when module duplication occurs. The duplication of the modules can happen
// if using multiple version of MUI X at the same time of the bundler
// decide to duplicate to improve the size of the chunks.
// eslint-disable-next-line no-underscore-dangle
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
key: undefined,
releaseInfo: undefined
key: undefined
};
export class LicenseInfo {
static getKey() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.key;
static getLicenseInfo() {
// eslint-disable-next-line no-underscore-dangle
return ponyfillGlobal.__MUI_LICENSE_INFO__;
}
static getReleaseInfo() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo;
static getLicenseKey() {
return LicenseInfo.getLicenseInfo().key;
}
static setLicenseKey(key) {
ponyfillGlobal.__MUI_LICENSE_INFO__.key = key;
const licenseInfo = LicenseInfo.getLicenseInfo();
licenseInfo.key = key;
}
static setReleaseInfo(encodedReleaseInfo) {
ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo = encodedReleaseInfo;
}
}

@@ -6,2 +6,3 @@ "use strict";

});
exports.licenseDecodeCli = licenseDecodeCli;
exports.licenseGenCli = licenseGenCli;

@@ -13,2 +14,4 @@

var _base = require("../encoding/base64");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -21,6 +24,30 @@

function licenseDecodeCli() {
yargs.command({
command: '$0',
describe: 'Decode a license key',
builder: command => {
return command.option('key', {
default: '',
alias: 'k',
describe: 'License key.',
type: 'string'
});
},
handler: argv => {
if (!argv.key) {
throw new Error('MUI: You forgot to pass a license key. $ > licensegen -k xxx');
}
console.log(`Decoding license key "${argv.key}"`);
const license = (0, _base.base64Decode)(argv.key.substr(32));
console.log(`Decoded license: \n${license}`);
}
}).help().strict(true).version(false).parse();
}
function licenseGenCli() {
yargs.command({
command: '$0',
describe: 'Generates Component.propTypes from TypeScript declarations',
describe: 'Generates a license key',
builder: command => {

@@ -27,0 +54,0 @@ return command.option('order', {

@@ -1,2 +0,2 @@

/** @license MUI v5.6.1
/** @license MUI v5.7.0
*

@@ -62,2 +62,15 @@ * This source code is licensed under the MIT license found in the

});
});
var _Watermark = require("./Watermark");
Object.keys(_Watermark).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _Watermark[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Watermark[key];
}
});
});

@@ -22,16 +22,30 @@ "use strict";

function useLicenseVerifier() {
const sharedLicenseStatuses = {};
function useLicenseVerifier(packageName, releaseInfo) {
return React.useMemo(() => {
const newLicenseStatus = (0, _verifyLicense.verifyLicense)(_licenseInfo.LicenseInfo.getReleaseInfo(), _licenseInfo.LicenseInfo.getKey());
var _sharedLicenseStatuse;
if (newLicenseStatus === _licenseStatus.LicenseStatus.Invalid) {
const licenseKey = _licenseInfo.LicenseInfo.getLicenseKey();
if (licenseKey && ((_sharedLicenseStatuse = sharedLicenseStatuses[packageName]) == null ? void 0 : _sharedLicenseStatuse.key) === licenseKey) {
return sharedLicenseStatuses[packageName].status;
}
const licenseStatus = (0, _verifyLicense.verifyLicense)(releaseInfo, licenseKey);
sharedLicenseStatuses[packageName] = {
key: licenseStatus,
status: licenseStatus
};
if (licenseStatus === _licenseStatus.LicenseStatus.Invalid) {
(0, _licenseErrorMessageUtils.showInvalidLicenseError)();
} else if (newLicenseStatus === _licenseStatus.LicenseStatus.NotFound) {
} else if (licenseStatus === _licenseStatus.LicenseStatus.NotFound) {
(0, _licenseErrorMessageUtils.showNotFoundLicenseError)();
} else if (newLicenseStatus === _licenseStatus.LicenseStatus.Expired) {
} else if (licenseStatus === _licenseStatus.LicenseStatus.Expired) {
(0, _licenseErrorMessageUtils.showExpiredLicenseError)();
}
return newLicenseStatus;
}, []);
return licenseStatus;
}, [packageName, releaseInfo]);
}

@@ -10,31 +10,28 @@ "use strict";

/* eslint-disable no-underscore-dangle */
// Store the license information in a global so it can be shared
// Store the license information in a global, so it can be shared
// when module duplication occurs. The duplication of the modules can happen
// if using multiple version of MUI X at the same time of the bundler
// decide to duplicate to improve the size of the chunks.
// eslint-disable-next-line no-underscore-dangle
_utils.ponyfillGlobal.__MUI_LICENSE_INFO__ = _utils.ponyfillGlobal.__MUI_LICENSE_INFO__ || {
key: undefined,
releaseInfo: undefined
key: undefined
};
class LicenseInfo {
static getKey() {
return _utils.ponyfillGlobal.__MUI_LICENSE_INFO__.key;
static getLicenseInfo() {
// eslint-disable-next-line no-underscore-dangle
return _utils.ponyfillGlobal.__MUI_LICENSE_INFO__;
}
static getReleaseInfo() {
return _utils.ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo;
static getLicenseKey() {
return LicenseInfo.getLicenseInfo().key;
}
static setLicenseKey(key) {
_utils.ponyfillGlobal.__MUI_LICENSE_INFO__.key = key;
const licenseInfo = LicenseInfo.getLicenseInfo();
licenseInfo.key = key;
}
static setReleaseInfo(encodedReleaseInfo) {
_utils.ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo = encodedReleaseInfo;
}
}
exports.LicenseInfo = LicenseInfo;
{
"name": "@mui/x-license-pro",
"version": "5.6.1",
"version": "5.7.0",
"description": "MUI X License verification",

@@ -17,3 +17,4 @@ "author": "MUI Team",

"bin": {
"licensegen": "./bin/license-gen-script.js"
"licensegen": "./bin/license-gen-script.js",
"licensedecode": "./bin/license-decode-script.js"
},

@@ -28,3 +29,3 @@ "repository": {

"esm": "^3.2.25",
"yargs": "^17.3.1"
"yargs": "^17.4.0"
},

@@ -31,0 +32,0 @@ "peerDependencies": {

import { LicenseStatus } from '../utils/licenseStatus';
export declare function useLicenseVerifier(): LicenseStatus;
export declare type MuiCommercialPackageName = 'x-data-grid-pro' | 'x-data-grid-premium' | 'x-date-pickers-pro';
export declare function useLicenseVerifier(packageName: MuiCommercialPackageName, releaseInfo: string): LicenseStatus;

@@ -6,16 +6,29 @@ import * as React from 'react';

import { LicenseStatus } from '../utils/licenseStatus';
export function useLicenseVerifier() {
const sharedLicenseStatuses = {};
export function useLicenseVerifier(packageName, releaseInfo) {
return React.useMemo(() => {
const newLicenseStatus = verifyLicense(LicenseInfo.getReleaseInfo(), LicenseInfo.getKey());
var _sharedLicenseStatuse;
if (newLicenseStatus === LicenseStatus.Invalid) {
const licenseKey = LicenseInfo.getLicenseKey();
if (licenseKey && ((_sharedLicenseStatuse = sharedLicenseStatuses[packageName]) == null ? void 0 : _sharedLicenseStatuse.key) === licenseKey) {
return sharedLicenseStatuses[packageName].status;
}
const licenseStatus = verifyLicense(releaseInfo, licenseKey);
sharedLicenseStatuses[packageName] = {
key: licenseStatus,
status: licenseStatus
};
if (licenseStatus === LicenseStatus.Invalid) {
showInvalidLicenseError();
} else if (newLicenseStatus === LicenseStatus.NotFound) {
} else if (licenseStatus === LicenseStatus.NotFound) {
showNotFoundLicenseError();
} else if (newLicenseStatus === LicenseStatus.Expired) {
} else if (licenseStatus === LicenseStatus.Expired) {
showExpiredLicenseError();
}
return newLicenseStatus;
}, []);
return licenseStatus;
}, [packageName, releaseInfo]);
}

@@ -0,6 +1,9 @@

interface MuiLicenseInfo {
key: string | undefined;
}
export declare class LicenseInfo {
static getKey(): string;
static getReleaseInfo(): string;
private static getLicenseInfo;
static getLicenseKey(): MuiLicenseInfo['key'];
static setLicenseKey(key: string): void;
static setReleaseInfo(encodedReleaseInfo: string): void;
}
export {};

@@ -1,28 +0,25 @@

/* eslint-disable no-underscore-dangle */
import { ponyfillGlobal } from '@mui/utils'; // Store the license information in a global so it can be shared
import { ponyfillGlobal } from '@mui/utils';
// Store the license information in a global, so it can be shared
// when module duplication occurs. The duplication of the modules can happen
// if using multiple version of MUI X at the same time of the bundler
// decide to duplicate to improve the size of the chunks.
// eslint-disable-next-line no-underscore-dangle
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
key: undefined,
releaseInfo: undefined
key: undefined
};
export class LicenseInfo {
static getKey() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.key;
static getLicenseInfo() {
// eslint-disable-next-line no-underscore-dangle
return ponyfillGlobal.__MUI_LICENSE_INFO__;
}
static getReleaseInfo() {
return ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo;
static getLicenseKey() {
return LicenseInfo.getLicenseInfo().key;
}
static setLicenseKey(key) {
ponyfillGlobal.__MUI_LICENSE_INFO__.key = key;
const licenseInfo = LicenseInfo.getLicenseInfo();
licenseInfo.key = key;
}
static setReleaseInfo(encodedReleaseInfo) {
ponyfillGlobal.__MUI_LICENSE_INFO__.releaseInfo = encodedReleaseInfo;
}
}
import { LicenseStatus } from '../utils/licenseStatus';
export declare function generateReleaseInfo(): string;
export declare function verifyLicense(releaseInfo: string, encodedLicense: string): LicenseStatus;
export declare function verifyLicense(releaseInfo: string, encodedLicense: string | undefined): LicenseStatus;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc