@mui/x-license 9.0.0-alpha.2 → 9.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -1
- package/Watermark/Watermark.d.mts +2 -3
- package/Watermark/Watermark.d.ts +2 -3
- package/Watermark/Watermark.js +2 -3
- package/Watermark/Watermark.mjs +2 -3
- package/index.d.mts +0 -1
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/index.d.mts +13 -0
- package/internals/index.d.ts +13 -0
- package/internals/index.js +108 -0
- package/internals/index.mjs +9 -0
- package/package.json +10 -94
- package/test-keys.d.mts +10 -0
- package/test-keys.d.ts +10 -0
- package/test-keys.js +16 -2
- package/test-keys.mjs +15 -1
- package/useLicenseVerifier/useLicenseVerifier.d.mts +2 -2
- package/useLicenseVerifier/useLicenseVerifier.d.ts +2 -2
- package/useLicenseVerifier/useLicenseVerifier.js +13 -7
- package/useLicenseVerifier/useLicenseVerifier.mjs +14 -8
- package/utils/commercialPackages.d.mts +6 -1
- package/utils/commercialPackages.d.ts +6 -1
- package/utils/index.d.mts +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/licenseErrorMessageUtils.d.mts +1 -0
- package/utils/licenseErrorMessageUtils.d.ts +1 -0
- package/utils/licenseErrorMessageUtils.js +4 -0
- package/utils/licenseErrorMessageUtils.mjs +3 -0
- package/utils/licensePlan.d.mts +8 -1
- package/utils/licensePlan.d.ts +8 -1
- package/utils/licensePlan.js +13 -1
- package/utils/licensePlan.mjs +12 -1
- package/utils/licenseStatus.d.mts +1 -0
- package/utils/licenseStatus.d.ts +1 -0
- package/utils/licenseStatus.js +1 -0
- package/utils/licenseStatus.mjs +1 -0
- package/verifyLicense/verifyLicense.d.mts +4 -6
- package/verifyLicense/verifyLicense.d.ts +4 -6
- package/verifyLicense/verifyLicense.js +26 -5
- package/verifyLicense/verifyLicense.mjs +27 -6
- package/license-env.d.mts +0 -6
- package/license-env.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0-alpha.3
|
|
4
|
+
|
|
5
|
+
_Mar 12, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- 🐞 Bugfixes and internal improvements
|
|
10
|
+
|
|
11
|
+
The following team members contributed to this release:
|
|
12
|
+
@aemartos, @alexfauquette, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @MBilalShafi, @michelengelen, @rita-codes, @sai6855, @siriwatknp
|
|
13
|
+
|
|
14
|
+
### Data Grid
|
|
15
|
+
|
|
16
|
+
#### `@mui/x-data-grid@9.0.0-alpha.3`
|
|
17
|
+
|
|
18
|
+
- [DataGrid] Fix crash when `rows` and `rowModesModel` are updated simultaneously (#21265) @michelengelen
|
|
19
|
+
- [DataGrid] Add missing `resizablePanelHandle` classes to `gridClasses` object (#21538) @sai6855
|
|
20
|
+
- [DataGrid] Refactor `headerAlign` style calls (#21541) @sai6855
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@9.0.0-alpha.3`, plus:
|
|
25
|
+
|
|
26
|
+
- [DataGridPro] Add `role="presentation"` to detail panel toggle header content (#21634) @michelengelen
|
|
27
|
+
- [DataGridPro] Fix sorting not reflected in nested server-side data (#21619) @MBilalShafi
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-premium@9.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.0-alpha.3`.
|
|
32
|
+
|
|
33
|
+
### Date and Time Pickers
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-date-pickers@9.0.0-alpha.3`
|
|
36
|
+
|
|
37
|
+
- [pickers] Refactor `DateRangePickerDay` overrides to use a centralized `elementOverrides` object (#21426) @sai6855
|
|
38
|
+
- [pickers] Migrate from deprecated props for `PickersModalDialog` (#21702) @siriwatknp
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@9.0.0-alpha.3`.
|
|
43
|
+
|
|
44
|
+
### Charts
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-charts@9.0.0-alpha.3`
|
|
47
|
+
|
|
48
|
+
- [charts] Differentiate Line Plot roots classes (#21679) @JCQuintas
|
|
49
|
+
- [charts] Enable keyboard navigation by default (#21675) @alexfauquette
|
|
50
|
+
- [charts] Fix keyboard tooltip radar (#21667) @alexfauquette
|
|
51
|
+
- [charts] Fix selector default parameter (#21638) @JCQuintas
|
|
52
|
+
- [charts] Fix tooltip blink between node and pointer anchor (#21611) @alexfauquette
|
|
53
|
+
- [charts] Let tooltip and legend reflect the line shape (#21475) @alexfauquette
|
|
54
|
+
- [charts] Refactor `BarChart` classes structure (#21601) @JCQuintas
|
|
55
|
+
- [charts] Refactor `LineChart` classes structure (#21648) @JCQuintas
|
|
56
|
+
- [charts] Refactor `ScatterChart` classes structure (#21651) @JCQuintas
|
|
57
|
+
- [charts] Refactor `PieChart` classes structure (#21649) @JCQuintas
|
|
58
|
+
- [charts] Remove batch rendering checks in highlight selectors (#21646) @bernardobelchior
|
|
59
|
+
- [charts] Standardize generic arg names to `SeriesType` (#21694) @alexfauquette
|
|
60
|
+
- [charts] Simplify highlight hooks return types (#21695) @alexfauquette
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-charts-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-charts@9.0.0-alpha.3`, plus:
|
|
65
|
+
|
|
66
|
+
- [charts-pro] Fix heatmap style override from `arc` to `cell` (#21693) @Copilot
|
|
67
|
+
- [charts-pro] Fix image export truncated when page is zoomed out (#21685) @bernardobelchior
|
|
68
|
+
- [charts-pro] Speed-up heatmap cell search with an index lookup (#21130) @alexfauquette
|
|
69
|
+
- [charts-pro] Fix heatmap highlight not working (#21710) @Copilot
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts-premium@9.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-charts-pro@9.0.0-alpha.3`, plus:
|
|
74
|
+
|
|
75
|
+
- [charts-premium] Re-enable WebGL tests (#21708) @bernardobelchior
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### Breaking changes
|
|
80
|
+
|
|
81
|
+
- Remove `TreeViewBaseItem` type (use `TreeViewDefaultItemModelProperties` or a custom interface)
|
|
82
|
+
- Remove `useTreeViewApiRef` hook (use `useRichTreeViewApiRef`, `useSimpleTreeViewApiRef`, or `useRichTreeViewProApiRef`)
|
|
83
|
+
- Remove `status` from content slot props returned by `getContentProps()` (use `data-*` attributes; `status` on `useTreeItem` return value is unchanged)
|
|
84
|
+
- Remove deprecated CSS state classes from `treeItemClasses`: `expanded`, `selected`, `focused`, `disabled`, `editable`, `editing` (use `[data-expanded]`, `[data-selected]`, etc.)
|
|
85
|
+
- The `<RichTreeViewPro />` component has now virtualization enabled by default.
|
|
86
|
+
- The items used inside the `<RichTreeViewPro />` now have a default height of `32px`.
|
|
87
|
+
- The events of the `<RichTreeViewPro />` are now rendered as a flat list instead of a nested tree.
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@9.0.0-alpha.3`
|
|
90
|
+
|
|
91
|
+
- [tree view] Remove deprecated APIs (#21591) @flaviendelangle
|
|
92
|
+
- [tree view] Fix collapsed children not selected with `selectionPropagation.descendants` in `SimpleTreeView` (#21253) @flaviendelangle
|
|
93
|
+
|
|
94
|
+
#### `@mui/x-tree-view-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
95
|
+
|
|
96
|
+
Same changes as in `@mui/x-tree-view@9.0.0-alpha.3`, plus:
|
|
97
|
+
|
|
98
|
+
- [RichTreeViewPro] Make the virtualization opt-out and port the layout doc from the data grid (#21461) @flaviendelangle
|
|
99
|
+
|
|
100
|
+
### Codemod
|
|
101
|
+
|
|
102
|
+
#### `@mui/x-codemod@9.0.0-alpha.3`
|
|
103
|
+
|
|
104
|
+
Internal changes.
|
|
105
|
+
|
|
106
|
+
### Docs
|
|
107
|
+
|
|
108
|
+
- [docs] Fix `AssistantWithDataSource` demo crashing (#21555) @sai6855
|
|
109
|
+
- [docs] Remove `Preview` pill from Sankey (#21623) @bernardobelchior
|
|
110
|
+
- [docs] Migrate internal Material UI deprecated APIs (#21680) @siriwatknp
|
|
111
|
+
- [docs] Remove `New` flag on Tree View and Date and Time Pickers features released before v9 alpha (#21585) @flaviendelangle
|
|
112
|
+
|
|
113
|
+
### Core
|
|
114
|
+
|
|
115
|
+
- [code-infra] Remove checkout step (#21688) @Janpot
|
|
116
|
+
- [code-infra] Fix contributor generation in changelog (#21718) @brijeshb42
|
|
117
|
+
- [docs-infra] Do not point to non-existent v8 subdomain (#21640) @cherniavskii
|
|
118
|
+
|
|
119
|
+
### Miscellaneous
|
|
120
|
+
|
|
121
|
+
- [test] Add missing tests for forwarding props to filter operators in DataGrid (#21441) @siriwatknp
|
|
122
|
+
- [x-license] Export additional license types and constants (#21625) @aemartos
|
|
123
|
+
- [x-license] Refactor license verification to accept package info object and add v9 version gating (#21690) @aemartos
|
|
124
|
+
|
|
3
125
|
## 9.0.0-alpha.2
|
|
4
126
|
|
|
5
127
|
_Mar 5, 2026_
|
|
@@ -92,7 +214,7 @@ Internal changes.
|
|
|
92
214
|
|
|
93
215
|
- [docs] Add backticks and parentheses to all functions and hooks (DX-173) (#21496) @mapache-salvaje
|
|
94
216
|
- [docs] Remove mentions of `mySvgRef` (#21559) @bernardobelchior
|
|
95
|
-
- [docs] Update Roadmap section in the docs
|
|
217
|
+
- [docs] Update Roadmap section in the docs (#20892) @alelthomas
|
|
96
218
|
- [docs] Add tutorial and example app for aggregation with row grouping (DX-162) (#21102) @mapache-salvaje
|
|
97
219
|
- [docs] Fix missing codemod docs (#21604) @JCQuintas
|
|
98
220
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommercialPackageInfo } from "../utils/commercialPackages.mjs";
|
|
2
2
|
interface WatermarkProps {
|
|
3
|
-
|
|
4
|
-
releaseInfo: string;
|
|
3
|
+
packageInfo: CommercialPackageInfo;
|
|
5
4
|
}
|
|
6
5
|
declare function Watermark(props: WatermarkProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
declare const MemoizedWatermark: typeof Watermark;
|
package/Watermark/Watermark.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommercialPackageInfo } from "../utils/commercialPackages.js";
|
|
2
2
|
interface WatermarkProps {
|
|
3
|
-
|
|
4
|
-
releaseInfo: string;
|
|
3
|
+
packageInfo: CommercialPackageInfo;
|
|
5
4
|
}
|
|
6
5
|
declare function Watermark(props: WatermarkProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
declare const MemoizedWatermark: typeof Watermark;
|
package/Watermark/Watermark.js
CHANGED
|
@@ -31,10 +31,9 @@ function getLicenseErrorMessage(licenseStatus) {
|
|
|
31
31
|
}
|
|
32
32
|
function Watermark(props) {
|
|
33
33
|
const {
|
|
34
|
-
|
|
35
|
-
releaseInfo
|
|
34
|
+
packageInfo
|
|
36
35
|
} = props;
|
|
37
|
-
const licenseStatus = (0, _useLicenseVerifier.useLicenseVerifier)(
|
|
36
|
+
const licenseStatus = (0, _useLicenseVerifier.useLicenseVerifier)(packageInfo);
|
|
38
37
|
if (licenseStatus.status === _licenseStatus.LICENSE_STATUS.Valid) {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
package/Watermark/Watermark.mjs
CHANGED
|
@@ -24,10 +24,9 @@ function getLicenseErrorMessage(licenseStatus) {
|
|
|
24
24
|
}
|
|
25
25
|
function Watermark(props) {
|
|
26
26
|
const {
|
|
27
|
-
|
|
28
|
-
releaseInfo
|
|
27
|
+
packageInfo
|
|
29
28
|
} = props;
|
|
30
|
-
const licenseStatus = useLicenseVerifier(
|
|
29
|
+
const licenseStatus = useLicenseVerifier(packageInfo);
|
|
31
30
|
if (licenseStatus.status === LICENSE_STATUS.Valid) {
|
|
32
31
|
return null;
|
|
33
32
|
}
|
package/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { Unstable_LicenseInfoProvider, type Unstable_LicenseInfoProviderProps } from "./Unstable_LicenseInfoProvider/index.mjs";
|
|
2
2
|
export { LicenseInfo } from "./utils/index.mjs";
|
|
3
|
-
export type { LicenseStatus, MuiLicenseInfo, AppType, KeyVersion, LicenseDetails, LicenseModel, PlanScope } from "./utils/index.mjs";
|
|
4
3
|
export { muiXTelemetrySettings } from '@mui/x-telemetry';
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { Unstable_LicenseInfoProvider, type Unstable_LicenseInfoProviderProps } from "./Unstable_LicenseInfoProvider/index.js";
|
|
2
2
|
export { LicenseInfo } from "./utils/index.js";
|
|
3
|
-
export type { LicenseStatus, MuiLicenseInfo, AppType, KeyVersion, LicenseDetails, LicenseModel, PlanScope } from "./utils/index.js";
|
|
4
3
|
export { muiXTelemetrySettings } from '@mui/x-telemetry';
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { base64Decode, base64Encode } from "../encoding/base64.mjs";
|
|
2
|
+
export { md5 } from "../encoding/md5.mjs";
|
|
3
|
+
export { APP_TYPES, type AppType } from "../utils/licenseAppType.mjs";
|
|
4
|
+
export { PLAN_SCOPES, PLAN_VERSIONS, type PlanScope, type PlanVersion } from "../utils/licensePlan.mjs";
|
|
5
|
+
export { LICENSE_MODELS, type LicenseModel } from "../utils/licenseModel.mjs";
|
|
6
|
+
export type { KeyVersion, LicenseDetails, NullableLicenseDetails } from "../utils/licenseDetails.mjs";
|
|
7
|
+
export type { LicenseStatus } from "../utils/licenseStatus.mjs";
|
|
8
|
+
export type { MuiLicenseInfo } from "../utils/licenseInfo.mjs";
|
|
9
|
+
export type { MuiCommercialPackageName, CommercialPackageInfo } from "../utils/commercialPackages.mjs";
|
|
10
|
+
export { Watermark } from "../Watermark/Watermark.mjs";
|
|
11
|
+
export { useLicenseVerifier, clearLicenseStatusCache } from "../useLicenseVerifier/useLicenseVerifier.mjs";
|
|
12
|
+
export * from "../verifyLicense/verifyLicense.mjs";
|
|
13
|
+
export * from "../test-keys.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { base64Decode, base64Encode } from "../encoding/base64.js";
|
|
2
|
+
export { md5 } from "../encoding/md5.js";
|
|
3
|
+
export { APP_TYPES, type AppType } from "../utils/licenseAppType.js";
|
|
4
|
+
export { PLAN_SCOPES, PLAN_VERSIONS, type PlanScope, type PlanVersion } from "../utils/licensePlan.js";
|
|
5
|
+
export { LICENSE_MODELS, type LicenseModel } from "../utils/licenseModel.js";
|
|
6
|
+
export type { KeyVersion, LicenseDetails, NullableLicenseDetails } from "../utils/licenseDetails.js";
|
|
7
|
+
export type { LicenseStatus } from "../utils/licenseStatus.js";
|
|
8
|
+
export type { MuiLicenseInfo } from "../utils/licenseInfo.js";
|
|
9
|
+
export type { MuiCommercialPackageName, CommercialPackageInfo } from "../utils/commercialPackages.js";
|
|
10
|
+
export { Watermark } from "../Watermark/Watermark.js";
|
|
11
|
+
export { useLicenseVerifier, clearLicenseStatusCache } from "../useLicenseVerifier/useLicenseVerifier.js";
|
|
12
|
+
export * from "../verifyLicense/verifyLicense.js";
|
|
13
|
+
export * from "../test-keys.js";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
base64Decode: true,
|
|
8
|
+
base64Encode: true,
|
|
9
|
+
md5: true,
|
|
10
|
+
APP_TYPES: true,
|
|
11
|
+
PLAN_SCOPES: true,
|
|
12
|
+
PLAN_VERSIONS: true,
|
|
13
|
+
LICENSE_MODELS: true,
|
|
14
|
+
Watermark: true,
|
|
15
|
+
useLicenseVerifier: true,
|
|
16
|
+
clearLicenseStatusCache: true
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "APP_TYPES", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _licenseAppType.APP_TYPES;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "LICENSE_MODELS", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _licenseModel.LICENSE_MODELS;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "PLAN_SCOPES", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _licensePlan.PLAN_SCOPES;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "PLAN_VERSIONS", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _licensePlan.PLAN_VERSIONS;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "Watermark", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _Watermark.Watermark;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "base64Decode", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _base.base64Decode;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "base64Encode", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _base.base64Encode;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "clearLicenseStatusCache", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _useLicenseVerifier.clearLicenseStatusCache;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "md5", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _md.md5;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "useLicenseVerifier", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _useLicenseVerifier.useLicenseVerifier;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var _base = require("../encoding/base64");
|
|
79
|
+
var _md = require("../encoding/md5");
|
|
80
|
+
var _licenseAppType = require("../utils/licenseAppType");
|
|
81
|
+
var _licensePlan = require("../utils/licensePlan");
|
|
82
|
+
var _licenseModel = require("../utils/licenseModel");
|
|
83
|
+
var _Watermark = require("../Watermark/Watermark");
|
|
84
|
+
var _useLicenseVerifier = require("../useLicenseVerifier/useLicenseVerifier");
|
|
85
|
+
var _verifyLicense = require("../verifyLicense/verifyLicense");
|
|
86
|
+
Object.keys(_verifyLicense).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _verifyLicense[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _verifyLicense[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
var _testKeys = require("../test-keys");
|
|
98
|
+
Object.keys(_testKeys).forEach(function (key) {
|
|
99
|
+
if (key === "default" || key === "__esModule") return;
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
101
|
+
if (key in exports && exports[key] === _testKeys[key]) return;
|
|
102
|
+
Object.defineProperty(exports, key, {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _testKeys[key];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { base64Decode, base64Encode } from "../encoding/base64.mjs";
|
|
2
|
+
export { md5 } from "../encoding/md5.mjs";
|
|
3
|
+
export { APP_TYPES } from "../utils/licenseAppType.mjs";
|
|
4
|
+
export { PLAN_SCOPES, PLAN_VERSIONS } from "../utils/licensePlan.mjs";
|
|
5
|
+
export { LICENSE_MODELS } from "../utils/licenseModel.mjs";
|
|
6
|
+
export { Watermark } from "../Watermark/Watermark.mjs";
|
|
7
|
+
export { useLicenseVerifier, clearLicenseStatusCache } from "../useLicenseVerifier/useLicenseVerifier.mjs";
|
|
8
|
+
export * from "../verifyLicense/verifyLicense.mjs";
|
|
9
|
+
export * from "../test-keys.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-license",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.3",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI X License verification.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.28.6",
|
|
25
25
|
"@mui/utils": "^7.3.7",
|
|
26
|
-
"@mui/x-
|
|
27
|
-
"@mui/x-
|
|
26
|
+
"@mui/x-telemetry": "9.0.0-alpha.2",
|
|
27
|
+
"@mui/x-internals": "9.0.0-alpha.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
@@ -49,102 +49,18 @@
|
|
|
49
49
|
"default": "./index.mjs"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"./
|
|
52
|
+
"./internals": {
|
|
53
53
|
"import": {
|
|
54
|
-
"types": "./
|
|
55
|
-
"default": "./
|
|
54
|
+
"types": "./internals/index.d.mts",
|
|
55
|
+
"default": "./internals/index.mjs"
|
|
56
56
|
},
|
|
57
57
|
"require": {
|
|
58
|
-
"types": "./
|
|
59
|
-
"default": "./
|
|
58
|
+
"types": "./internals/index.d.ts",
|
|
59
|
+
"default": "./internals/index.js"
|
|
60
60
|
},
|
|
61
61
|
"default": {
|
|
62
|
-
"types": "./
|
|
63
|
-
"default": "./
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"./useLicenseVerifier": {
|
|
67
|
-
"import": {
|
|
68
|
-
"types": "./useLicenseVerifier/index.d.mts",
|
|
69
|
-
"default": "./useLicenseVerifier/index.mjs"
|
|
70
|
-
},
|
|
71
|
-
"require": {
|
|
72
|
-
"types": "./useLicenseVerifier/index.d.ts",
|
|
73
|
-
"default": "./useLicenseVerifier/index.js"
|
|
74
|
-
},
|
|
75
|
-
"default": {
|
|
76
|
-
"types": "./useLicenseVerifier/index.d.mts",
|
|
77
|
-
"default": "./useLicenseVerifier/index.mjs"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"./verifyLicense": {
|
|
81
|
-
"import": {
|
|
82
|
-
"types": "./verifyLicense/index.d.mts",
|
|
83
|
-
"default": "./verifyLicense/index.mjs"
|
|
84
|
-
},
|
|
85
|
-
"require": {
|
|
86
|
-
"types": "./verifyLicense/index.d.ts",
|
|
87
|
-
"default": "./verifyLicense/index.js"
|
|
88
|
-
},
|
|
89
|
-
"default": {
|
|
90
|
-
"types": "./verifyLicense/index.d.mts",
|
|
91
|
-
"default": "./verifyLicense/index.mjs"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
"./utils": {
|
|
95
|
-
"import": {
|
|
96
|
-
"types": "./utils/index.d.mts",
|
|
97
|
-
"default": "./utils/index.mjs"
|
|
98
|
-
},
|
|
99
|
-
"require": {
|
|
100
|
-
"types": "./utils/index.d.ts",
|
|
101
|
-
"default": "./utils/index.js"
|
|
102
|
-
},
|
|
103
|
-
"default": {
|
|
104
|
-
"types": "./utils/index.d.mts",
|
|
105
|
-
"default": "./utils/index.mjs"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"./test-keys": {
|
|
109
|
-
"import": {
|
|
110
|
-
"types": "./test-keys.d.mts",
|
|
111
|
-
"default": "./test-keys.mjs"
|
|
112
|
-
},
|
|
113
|
-
"require": {
|
|
114
|
-
"types": "./test-keys.d.ts",
|
|
115
|
-
"default": "./test-keys.js"
|
|
116
|
-
},
|
|
117
|
-
"default": {
|
|
118
|
-
"types": "./test-keys.d.mts",
|
|
119
|
-
"default": "./test-keys.mjs"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
"./Unstable_LicenseInfoProvider": {
|
|
123
|
-
"import": {
|
|
124
|
-
"types": "./Unstable_LicenseInfoProvider/index.d.mts",
|
|
125
|
-
"default": "./Unstable_LicenseInfoProvider/index.mjs"
|
|
126
|
-
},
|
|
127
|
-
"require": {
|
|
128
|
-
"types": "./Unstable_LicenseInfoProvider/index.d.ts",
|
|
129
|
-
"default": "./Unstable_LicenseInfoProvider/index.js"
|
|
130
|
-
},
|
|
131
|
-
"default": {
|
|
132
|
-
"types": "./Unstable_LicenseInfoProvider/index.d.mts",
|
|
133
|
-
"default": "./Unstable_LicenseInfoProvider/index.mjs"
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"./encoding": {
|
|
137
|
-
"import": {
|
|
138
|
-
"types": "./encoding/index.d.mts",
|
|
139
|
-
"default": "./encoding/index.mjs"
|
|
140
|
-
},
|
|
141
|
-
"require": {
|
|
142
|
-
"types": "./encoding/index.d.ts",
|
|
143
|
-
"default": "./encoding/index.js"
|
|
144
|
-
},
|
|
145
|
-
"default": {
|
|
146
|
-
"types": "./encoding/index.d.mts",
|
|
147
|
-
"default": "./encoding/index.mjs"
|
|
62
|
+
"types": "./internals/index.d.mts",
|
|
63
|
+
"default": "./internals/index.mjs"
|
|
148
64
|
}
|
|
149
65
|
}
|
|
150
66
|
},
|
package/test-keys.d.mts
CHANGED
|
@@ -80,6 +80,16 @@ export declare const TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = "5f52871b5845f28ebdd0fabbe
|
|
|
80
80
|
* orderId: #123, keyVersion: 3, expiryDate: 3001-01-01
|
|
81
81
|
*/
|
|
82
82
|
export declare const TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = "450d9fc1b28e709fcb73969bd10e1c30Tz0xMjMsRT0zMjUzNTEyNjAwMDAwMCxTPXByZW1pdW0sTE09YW5udWFsLFBWPVExLTIwMjYsUT0xMCxBVD1zaW5nbGUsVD10cnVlLEtWPTM=";
|
|
83
|
+
/**
|
|
84
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate + 1 day (not expired).
|
|
85
|
+
* orderId: #123, keyVersion: 2
|
|
86
|
+
*/
|
|
87
|
+
export declare const TEST_KEY_PRO_PERPETUAL_Q1_2026 = "5f78509380f3ea3b3c91d7af3f5496eaTz0xMjMsRT0xNTE0NzYxMjAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y";
|
|
88
|
+
/**
|
|
89
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate - 1 day (expired before release).
|
|
90
|
+
* orderId: #123, keyVersion: 2
|
|
91
|
+
*/
|
|
92
|
+
export declare const TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = "191d8aaf174e38bcbf367e07fa39e423Tz0xMjMsRT0xNTE0NTg4NDAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y";
|
|
83
93
|
/**
|
|
84
94
|
* Invalid key: hash does not match payload (tampered).
|
|
85
95
|
* Used to test that verifyLicense rejects tampered keys.
|
package/test-keys.d.ts
CHANGED
|
@@ -80,6 +80,16 @@ export declare const TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = "5f52871b5845f28ebdd0fabbe
|
|
|
80
80
|
* orderId: #123, keyVersion: 3, expiryDate: 3001-01-01
|
|
81
81
|
*/
|
|
82
82
|
export declare const TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = "450d9fc1b28e709fcb73969bd10e1c30Tz0xMjMsRT0zMjUzNTEyNjAwMDAwMCxTPXByZW1pdW0sTE09YW5udWFsLFBWPVExLTIwMjYsUT0xMCxBVD1zaW5nbGUsVD10cnVlLEtWPTM=";
|
|
83
|
+
/**
|
|
84
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate + 1 day (not expired).
|
|
85
|
+
* orderId: #123, keyVersion: 2
|
|
86
|
+
*/
|
|
87
|
+
export declare const TEST_KEY_PRO_PERPETUAL_Q1_2026 = "5f78509380f3ea3b3c91d7af3f5496eaTz0xMjMsRT0xNTE0NzYxMjAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y";
|
|
88
|
+
/**
|
|
89
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate - 1 day (expired before release).
|
|
90
|
+
* orderId: #123, keyVersion: 2
|
|
91
|
+
*/
|
|
92
|
+
export declare const TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = "191d8aaf174e38bcbf367e07fa39e423Tz0xMjMsRT0xNTE0NTg4NDAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y";
|
|
83
93
|
/**
|
|
84
94
|
* Invalid key: hash does not match payload (tampered).
|
|
85
95
|
* Used to test that verifyLicense rejects tampered keys.
|
package/test-keys.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TEST_LICENSE_KEY_PRO = exports.TEST_LICENSE_KEY_PREMIUM = exports.TEST_KEY_V1 = exports.TEST_KEY_UNKNOWN_VERSION = exports.TEST_KEY_PRO_SUBSCRIPTION_FUTURE = exports.TEST_KEY_PRO_SUBSCRIPTION = exports.TEST_KEY_PRO_PERPETUAL_EXPIRED = exports.TEST_KEY_PRO_PERPETUAL = exports.TEST_KEY_PRO_ANNUAL_V3 = exports.TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PRO_ANNUAL_INITIAL = exports.TEST_KEY_PREMIUM_SUBSCRIPTION_FUTURE = exports.TEST_KEY_PREMIUM_SUBSCRIPTION = exports.TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PREMIUM_ANNUAL_INITIAL = exports.TEST_KEY_INVALID = exports.TEST_KEY_EXPIRED_GRACE = exports.TEST_KEY_EXPIRED_30DAYS = void 0;
|
|
6
|
+
exports.TEST_LICENSE_KEY_PRO = exports.TEST_LICENSE_KEY_PREMIUM = exports.TEST_KEY_V1 = exports.TEST_KEY_UNKNOWN_VERSION = exports.TEST_KEY_PRO_SUBSCRIPTION_FUTURE = exports.TEST_KEY_PRO_SUBSCRIPTION = exports.TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = exports.TEST_KEY_PRO_PERPETUAL_Q1_2026 = exports.TEST_KEY_PRO_PERPETUAL_EXPIRED = exports.TEST_KEY_PRO_PERPETUAL = exports.TEST_KEY_PRO_ANNUAL_V3 = exports.TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PRO_ANNUAL_INITIAL = exports.TEST_KEY_PREMIUM_SUBSCRIPTION_FUTURE = exports.TEST_KEY_PREMIUM_SUBSCRIPTION = exports.TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PREMIUM_ANNUAL_INITIAL = exports.TEST_KEY_INVALID = exports.TEST_KEY_EXPIRED_GRACE = exports.TEST_KEY_EXPIRED_30DAYS = void 0;
|
|
7
7
|
// =============================================================================
|
|
8
8
|
// Test license keys for use in test suites.
|
|
9
9
|
// All keys contain T=true in their payload and are rejected outside test environments.
|
|
10
|
-
// Import via '@mui/x-license/
|
|
10
|
+
// Import via '@mui/x-license/internals'.
|
|
11
11
|
// =============================================================================
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -120,6 +120,20 @@ const TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PRO_ANNUAL_Q1_2026_V3 =
|
|
|
120
120
|
*/
|
|
121
121
|
const TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = exports.TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = '450d9fc1b28e709fcb73969bd10e1c30Tz0xMjMsRT0zMjUzNTEyNjAwMDAwMCxTPXByZW1pdW0sTE09YW5udWFsLFBWPVExLTIwMjYsUT0xMCxBVD1zaW5nbGUsVD10cnVlLEtWPTM=';
|
|
122
122
|
|
|
123
|
+
// --- Keys for v9 plan version check tests (perpetual + Q1-2026) ---
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate + 1 day (not expired).
|
|
127
|
+
* orderId: #123, keyVersion: 2
|
|
128
|
+
*/
|
|
129
|
+
const TEST_KEY_PRO_PERPETUAL_Q1_2026 = exports.TEST_KEY_PRO_PERPETUAL_Q1_2026 = '5f78509380f3ea3b3c91d7af3f5496eaTz0xMjMsRT0xNTE0NzYxMjAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate - 1 day (expired before release).
|
|
133
|
+
* orderId: #123, keyVersion: 2
|
|
134
|
+
*/
|
|
135
|
+
const TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = exports.TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = '191d8aaf174e38bcbf367e07fa39e423Tz0xMjMsRT0xNTE0NTg4NDAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y';
|
|
136
|
+
|
|
123
137
|
// --- Invalid / edge-case keys ---
|
|
124
138
|
|
|
125
139
|
/**
|
package/test-keys.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// Test license keys for use in test suites.
|
|
3
3
|
// All keys contain T=true in their payload and are rejected outside test environments.
|
|
4
|
-
// Import via '@mui/x-license/
|
|
4
|
+
// Import via '@mui/x-license/internals'.
|
|
5
5
|
// =============================================================================
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -114,6 +114,20 @@ export const TEST_KEY_PRO_ANNUAL_Q1_2026_V3 = '5f52871b5845f28ebdd0fabbe0b89695T
|
|
|
114
114
|
*/
|
|
115
115
|
export const TEST_KEY_PREMIUM_ANNUAL_Q1_2026_V3 = '450d9fc1b28e709fcb73969bd10e1c30Tz0xMjMsRT0zMjUzNTEyNjAwMDAwMCxTPXByZW1pdW0sTE09YW5udWFsLFBWPVExLTIwMjYsUT0xMCxBVD1zaW5nbGUsVD10cnVlLEtWPTM=';
|
|
116
116
|
|
|
117
|
+
// --- Keys for v9 plan version check tests (perpetual + Q1-2026) ---
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate + 1 day (not expired).
|
|
121
|
+
* orderId: #123, keyVersion: 2
|
|
122
|
+
*/
|
|
123
|
+
export const TEST_KEY_PRO_PERPETUAL_Q1_2026 = '5f78509380f3ea3b3c91d7af3f5496eaTz0xMjMsRT0xNTE0NzYxMjAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y';
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Pro perpetual, Q1-2026, expiry = releaseDate - 1 day (expired before release).
|
|
127
|
+
* orderId: #123, keyVersion: 2
|
|
128
|
+
*/
|
|
129
|
+
export const TEST_KEY_PRO_PERPETUAL_Q1_2026_EXPIRED = '191d8aaf174e38bcbf367e07fa39e423Tz0xMjMsRT0xNTE0NTg4NDAwMDAwLFM9cHJvLExNPXBlcnBldHVhbCxQVj1RMS0yMDI2LFQ9dHJ1ZSxLVj0y';
|
|
130
|
+
|
|
117
131
|
// --- Invalid / edge-case keys ---
|
|
118
132
|
|
|
119
133
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LicenseStatus } from "../utils/licenseStatus.mjs";
|
|
2
|
-
import { MuiCommercialPackageName } from "../utils/commercialPackages.mjs";
|
|
2
|
+
import { MuiCommercialPackageName, CommercialPackageInfo } from "../utils/commercialPackages.mjs";
|
|
3
3
|
export declare const sharedLicenseStatuses: { [packageName in MuiCommercialPackageName]?: {
|
|
4
4
|
key: string | undefined;
|
|
5
5
|
licenseVerifier: {
|
|
@@ -11,6 +11,6 @@ export declare const sharedLicenseStatuses: { [packageName in MuiCommercialPacka
|
|
|
11
11
|
* This should not be used in production code, but can be useful for testing purposes.
|
|
12
12
|
*/
|
|
13
13
|
export declare function clearLicenseStatusCache(): void;
|
|
14
|
-
export declare function useLicenseVerifier(
|
|
14
|
+
export declare function useLicenseVerifier(packageInfo: CommercialPackageInfo): {
|
|
15
15
|
status: LicenseStatus;
|
|
16
16
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LicenseStatus } from "../utils/licenseStatus.js";
|
|
2
|
-
import { MuiCommercialPackageName } from "../utils/commercialPackages.js";
|
|
2
|
+
import { MuiCommercialPackageName, CommercialPackageInfo } from "../utils/commercialPackages.js";
|
|
3
3
|
export declare const sharedLicenseStatuses: { [packageName in MuiCommercialPackageName]?: {
|
|
4
4
|
key: string | undefined;
|
|
5
5
|
licenseVerifier: {
|
|
@@ -11,6 +11,6 @@ export declare const sharedLicenseStatuses: { [packageName in MuiCommercialPacka
|
|
|
11
11
|
* This should not be used in production code, but can be useful for testing purposes.
|
|
12
12
|
*/
|
|
13
13
|
export declare function clearLicenseStatusCache(): void;
|
|
14
|
-
export declare function useLicenseVerifier(
|
|
14
|
+
export declare function useLicenseVerifier(packageInfo: CommercialPackageInfo): {
|
|
15
15
|
status: LicenseStatus;
|
|
16
16
|
};
|
|
@@ -30,12 +30,17 @@ function clearLicenseStatusCache() {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function useLicenseVerifier(
|
|
33
|
+
function useLicenseVerifier(packageInfo) {
|
|
34
34
|
const {
|
|
35
35
|
key: contextKey
|
|
36
36
|
} = React.useContext(_MuiLicenseInfoContext.default);
|
|
37
37
|
return React.useMemo(() => {
|
|
38
38
|
const licenseKey = contextKey ?? _licenseInfo.LicenseInfo.getLicenseKey();
|
|
39
|
+
const {
|
|
40
|
+
name: packageName,
|
|
41
|
+
releaseDate,
|
|
42
|
+
version: packageVersion
|
|
43
|
+
} = packageInfo;
|
|
39
44
|
|
|
40
45
|
// Cache the response to not trigger the error twice.
|
|
41
46
|
if (sharedLicenseStatuses[packageName] && sharedLicenseStatuses[packageName].key === licenseKey) {
|
|
@@ -43,17 +48,16 @@ function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
43
48
|
}
|
|
44
49
|
const plan = packageName.includes('premium') ? 'Premium' : 'Pro';
|
|
45
50
|
const licenseStatus = (0, _verifyLicense.verifyLicense)({
|
|
46
|
-
|
|
47
|
-
licenseKey
|
|
48
|
-
packageName
|
|
51
|
+
packageInfo,
|
|
52
|
+
licenseKey
|
|
49
53
|
});
|
|
50
54
|
const fullPackageName = `@mui/${packageName}`;
|
|
51
55
|
(0, _xTelemetry.sendMuiXTelemetryEvent)(_xTelemetry.muiXTelemetryEvents.licenseVerification({
|
|
52
56
|
licenseKey,
|
|
53
|
-
xLicenseClientVersion:
|
|
57
|
+
xLicenseClientVersion: packageVersion
|
|
54
58
|
}, {
|
|
55
59
|
packageName,
|
|
56
|
-
packageReleaseInfo:
|
|
60
|
+
packageReleaseInfo: releaseDate,
|
|
57
61
|
licenseStatus: licenseStatus?.status
|
|
58
62
|
}));
|
|
59
63
|
if (licenseStatus.status === _licenseStatus.LICENSE_STATUS.Valid) {
|
|
@@ -83,6 +87,8 @@ function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
83
87
|
(0, _licenseErrorMessageUtils.showExpiredPackageVersionError)({
|
|
84
88
|
packageName: fullPackageName
|
|
85
89
|
});
|
|
90
|
+
} else if (licenseStatus.status === _licenseStatus.LICENSE_STATUS.NotValidForPackage) {
|
|
91
|
+
(0, _licenseErrorMessageUtils.showLicenseKeyVersionMismatchError)();
|
|
86
92
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
87
93
|
throw new Error('missing status handler');
|
|
88
94
|
}
|
|
@@ -91,5 +97,5 @@ function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
91
97
|
licenseVerifier: licenseStatus
|
|
92
98
|
};
|
|
93
99
|
return licenseStatus;
|
|
94
|
-
}, [
|
|
100
|
+
}, [packageInfo, contextKey]);
|
|
95
101
|
}
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { sendMuiXTelemetryEvent, muiXTelemetryEvents } from '@mui/x-telemetry';
|
|
6
6
|
import { verifyLicense } from "../verifyLicense/verifyLicense.mjs";
|
|
7
7
|
import { LicenseInfo } from "../utils/licenseInfo.mjs";
|
|
8
|
-
import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError } from "../utils/licenseErrorMessageUtils.mjs";
|
|
8
|
+
import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError, showLicenseKeyVersionMismatchError } from "../utils/licenseErrorMessageUtils.mjs";
|
|
9
9
|
import { LICENSE_STATUS } from "../utils/licenseStatus.mjs";
|
|
10
10
|
import MuiLicenseInfoContext from "../Unstable_LicenseInfoProvider/MuiLicenseInfoContext.mjs";
|
|
11
11
|
export const sharedLicenseStatuses = {};
|
|
@@ -21,12 +21,17 @@ export function clearLicenseStatusCache() {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
export function useLicenseVerifier(
|
|
24
|
+
export function useLicenseVerifier(packageInfo) {
|
|
25
25
|
const {
|
|
26
26
|
key: contextKey
|
|
27
27
|
} = React.useContext(MuiLicenseInfoContext);
|
|
28
28
|
return React.useMemo(() => {
|
|
29
29
|
const licenseKey = contextKey ?? LicenseInfo.getLicenseKey();
|
|
30
|
+
const {
|
|
31
|
+
name: packageName,
|
|
32
|
+
releaseDate,
|
|
33
|
+
version: packageVersion
|
|
34
|
+
} = packageInfo;
|
|
30
35
|
|
|
31
36
|
// Cache the response to not trigger the error twice.
|
|
32
37
|
if (sharedLicenseStatuses[packageName] && sharedLicenseStatuses[packageName].key === licenseKey) {
|
|
@@ -34,17 +39,16 @@ export function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
34
39
|
}
|
|
35
40
|
const plan = packageName.includes('premium') ? 'Premium' : 'Pro';
|
|
36
41
|
const licenseStatus = verifyLicense({
|
|
37
|
-
|
|
38
|
-
licenseKey
|
|
39
|
-
packageName
|
|
42
|
+
packageInfo,
|
|
43
|
+
licenseKey
|
|
40
44
|
});
|
|
41
45
|
const fullPackageName = `@mui/${packageName}`;
|
|
42
46
|
sendMuiXTelemetryEvent(muiXTelemetryEvents.licenseVerification({
|
|
43
47
|
licenseKey,
|
|
44
|
-
xLicenseClientVersion:
|
|
48
|
+
xLicenseClientVersion: packageVersion
|
|
45
49
|
}, {
|
|
46
50
|
packageName,
|
|
47
|
-
packageReleaseInfo:
|
|
51
|
+
packageReleaseInfo: releaseDate,
|
|
48
52
|
licenseStatus: licenseStatus?.status
|
|
49
53
|
}));
|
|
50
54
|
if (licenseStatus.status === LICENSE_STATUS.Valid) {
|
|
@@ -74,6 +78,8 @@ export function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
74
78
|
showExpiredPackageVersionError({
|
|
75
79
|
packageName: fullPackageName
|
|
76
80
|
});
|
|
81
|
+
} else if (licenseStatus.status === LICENSE_STATUS.NotValidForPackage) {
|
|
82
|
+
showLicenseKeyVersionMismatchError();
|
|
77
83
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
78
84
|
throw new Error('missing status handler');
|
|
79
85
|
}
|
|
@@ -82,5 +88,5 @@ export function useLicenseVerifier(packageName, releaseInfo) {
|
|
|
82
88
|
licenseVerifier: licenseStatus
|
|
83
89
|
};
|
|
84
90
|
return licenseStatus;
|
|
85
|
-
}, [
|
|
91
|
+
}, [packageInfo, contextKey]);
|
|
86
92
|
}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export type MuiCommercialPackageName = 'x-data-grid-pro' | 'x-data-grid-premium' | 'x-date-pickers-pro' | 'x-tree-view-pro' | 'x-charts-pro' | 'x-charts-premium' | 'x-scheduler-premium';
|
|
1
|
+
export type MuiCommercialPackageName = 'x-data-grid-pro' | 'x-data-grid-premium' | 'x-date-pickers-pro' | 'x-tree-view-pro' | 'x-charts-pro' | 'x-charts-premium' | 'x-scheduler-premium';
|
|
2
|
+
export interface CommercialPackageInfo {
|
|
3
|
+
releaseDate: string;
|
|
4
|
+
version: string;
|
|
5
|
+
name: MuiCommercialPackageName;
|
|
6
|
+
}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export type MuiCommercialPackageName = 'x-data-grid-pro' | 'x-data-grid-premium' | 'x-date-pickers-pro' | 'x-tree-view-pro' | 'x-charts-pro' | 'x-charts-premium' | 'x-scheduler-premium';
|
|
1
|
+
export type MuiCommercialPackageName = 'x-data-grid-pro' | 'x-data-grid-premium' | 'x-date-pickers-pro' | 'x-tree-view-pro' | 'x-charts-pro' | 'x-charts-premium' | 'x-scheduler-premium';
|
|
2
|
+
export interface CommercialPackageInfo {
|
|
3
|
+
releaseDate: string;
|
|
4
|
+
version: string;
|
|
5
|
+
name: MuiCommercialPackageName;
|
|
6
|
+
}
|
package/utils/index.d.mts
CHANGED
|
@@ -5,4 +5,4 @@ export type { AppType } from "./licenseAppType.mjs";
|
|
|
5
5
|
export type { PlanScope } from "./licensePlan.mjs";
|
|
6
6
|
export type { LicenseModel } from "./licenseModel.mjs";
|
|
7
7
|
export type { KeyVersion, LicenseDetails, NullableLicenseDetails } from "./licenseDetails.mjs";
|
|
8
|
-
export type { MuiCommercialPackageName } from "./commercialPackages.mjs";
|
|
8
|
+
export type { MuiCommercialPackageName, CommercialPackageInfo } from "./commercialPackages.mjs";
|
package/utils/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export type { AppType } from "./licenseAppType.js";
|
|
|
5
5
|
export type { PlanScope } from "./licensePlan.js";
|
|
6
6
|
export type { LicenseModel } from "./licenseModel.js";
|
|
7
7
|
export type { KeyVersion, LicenseDetails, NullableLicenseDetails } from "./licenseDetails.js";
|
|
8
|
-
export type { MuiCommercialPackageName } from "./commercialPackages.js";
|
|
8
|
+
export type { MuiCommercialPackageName, CommercialPackageInfo } from "./commercialPackages.js";
|
|
@@ -5,6 +5,7 @@ export declare function showLicenseKeyPlanMismatchError({
|
|
|
5
5
|
packageName: string;
|
|
6
6
|
}): void;
|
|
7
7
|
export declare function showNotAvailableInInitialProPlanError(): void;
|
|
8
|
+
export declare function showLicenseKeyVersionMismatchError(): void;
|
|
8
9
|
export declare function showMissingLicenseKeyError({
|
|
9
10
|
plan,
|
|
10
11
|
packageName
|
|
@@ -5,6 +5,7 @@ export declare function showLicenseKeyPlanMismatchError({
|
|
|
5
5
|
packageName: string;
|
|
6
6
|
}): void;
|
|
7
7
|
export declare function showNotAvailableInInitialProPlanError(): void;
|
|
8
|
+
export declare function showLicenseKeyVersionMismatchError(): void;
|
|
8
9
|
export declare function showMissingLicenseKeyError({
|
|
9
10
|
plan,
|
|
10
11
|
packageName
|
|
@@ -9,6 +9,7 @@ exports.showExpiredAnnualLicenseKeyError = showExpiredAnnualLicenseKeyError;
|
|
|
9
9
|
exports.showExpiredPackageVersionError = showExpiredPackageVersionError;
|
|
10
10
|
exports.showInvalidLicenseKeyError = showInvalidLicenseKeyError;
|
|
11
11
|
exports.showLicenseKeyPlanMismatchError = showLicenseKeyPlanMismatchError;
|
|
12
|
+
exports.showLicenseKeyVersionMismatchError = showLicenseKeyVersionMismatchError;
|
|
12
13
|
exports.showMissingLicenseKeyError = showMissingLicenseKeyError;
|
|
13
14
|
exports.showNotAvailableInInitialProPlanError = showNotAvailableInInitialProPlanError;
|
|
14
15
|
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
@@ -39,6 +40,9 @@ function showLicenseKeyPlanMismatchError({
|
|
|
39
40
|
function showNotAvailableInInitialProPlanError() {
|
|
40
41
|
showError(['MUI X: Component not included in your license.', '', 'The component you are trying to use is not included in the Pro Plan you purchased.', '', 'Your license is from an old version of the Pro Plan that is only compatible with the `@mui/x-data-grid-pro` and `@mui/x-date-pickers-pro` commercial packages.', '', 'To start using another Pro package, please consider reaching to our sales team to upgrade your license or visit https://mui.com/r/x-get-license to get a new license key.']);
|
|
41
42
|
}
|
|
43
|
+
function showLicenseKeyVersionMismatchError() {
|
|
44
|
+
showError(['MUI X: License key version mismatch.', '', 'The license key you are using is not compatible with the version of the MUI X packages installed.', 'This happens when using a license key from a previous major version (e.g. a v8 license with v9 packages).', '', 'To solve the issue, you can upgrade your license at https://mui.com/r/x-get-license or install an older version of the MUI X packages that is compatible with your license key.']);
|
|
45
|
+
}
|
|
42
46
|
function showMissingLicenseKeyError({
|
|
43
47
|
plan,
|
|
44
48
|
packageName
|
|
@@ -26,6 +26,9 @@ export function showLicenseKeyPlanMismatchError({
|
|
|
26
26
|
export function showNotAvailableInInitialProPlanError() {
|
|
27
27
|
showError(['MUI X: Component not included in your license.', '', 'The component you are trying to use is not included in the Pro Plan you purchased.', '', 'Your license is from an old version of the Pro Plan that is only compatible with the `@mui/x-data-grid-pro` and `@mui/x-date-pickers-pro` commercial packages.', '', 'To start using another Pro package, please consider reaching to our sales team to upgrade your license or visit https://mui.com/r/x-get-license to get a new license key.']);
|
|
28
28
|
}
|
|
29
|
+
export function showLicenseKeyVersionMismatchError() {
|
|
30
|
+
showError(['MUI X: License key version mismatch.', '', 'The license key you are using is not compatible with the version of the MUI X packages installed.', 'This happens when using a license key from a previous major version (e.g. a v8 license with v9 packages).', '', 'To solve the issue, you can upgrade your license at https://mui.com/r/x-get-license or install an older version of the MUI X packages that is compatible with your license key.']);
|
|
31
|
+
}
|
|
29
32
|
export function showMissingLicenseKeyError({
|
|
30
33
|
plan,
|
|
31
34
|
packageName
|
package/utils/licensePlan.d.mts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export declare const PLAN_SCOPES: readonly ["pro", "premium"];
|
|
2
2
|
export declare const PLAN_VERSIONS: readonly ["initial", "Q3-2024", "Q1-2026"];
|
|
3
3
|
export type PlanScope = (typeof PLAN_SCOPES)[number];
|
|
4
|
-
export type PlanVersion = (typeof PLAN_VERSIONS)[number];
|
|
4
|
+
export type PlanVersion = (typeof PLAN_VERSIONS)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Checks if a plan version is older than or equal to the given threshold
|
|
7
|
+
* using the ordering defined in PLAN_VERSIONS.
|
|
8
|
+
* This can be reused for future major version gates
|
|
9
|
+
* (e.g. v10 could set its own max plan version).
|
|
10
|
+
*/
|
|
11
|
+
export declare function isPlanVersionOlderOrEqual(planVersion: string, maxVersion: PlanVersion): boolean;
|
package/utils/licensePlan.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export declare const PLAN_SCOPES: readonly ["pro", "premium"];
|
|
2
2
|
export declare const PLAN_VERSIONS: readonly ["initial", "Q3-2024", "Q1-2026"];
|
|
3
3
|
export type PlanScope = (typeof PLAN_SCOPES)[number];
|
|
4
|
-
export type PlanVersion = (typeof PLAN_VERSIONS)[number];
|
|
4
|
+
export type PlanVersion = (typeof PLAN_VERSIONS)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Checks if a plan version is older than or equal to the given threshold
|
|
7
|
+
* using the ordering defined in PLAN_VERSIONS.
|
|
8
|
+
* This can be reused for future major version gates
|
|
9
|
+
* (e.g. v10 could set its own max plan version).
|
|
10
|
+
*/
|
|
11
|
+
export declare function isPlanVersionOlderOrEqual(planVersion: string, maxVersion: PlanVersion): boolean;
|
package/utils/licensePlan.js
CHANGED
|
@@ -4,5 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PLAN_VERSIONS = exports.PLAN_SCOPES = void 0;
|
|
7
|
+
exports.isPlanVersionOlderOrEqual = isPlanVersionOlderOrEqual;
|
|
7
8
|
const PLAN_SCOPES = exports.PLAN_SCOPES = ['pro', 'premium'];
|
|
8
|
-
const PLAN_VERSIONS = exports.PLAN_VERSIONS = ['initial', 'Q3-2024', 'Q1-2026'];
|
|
9
|
+
const PLAN_VERSIONS = exports.PLAN_VERSIONS = ['initial', 'Q3-2024', 'Q1-2026'];
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a plan version is older than or equal to the given threshold
|
|
12
|
+
* using the ordering defined in PLAN_VERSIONS.
|
|
13
|
+
* This can be reused for future major version gates
|
|
14
|
+
* (e.g. v10 could set its own max plan version).
|
|
15
|
+
*/
|
|
16
|
+
function isPlanVersionOlderOrEqual(planVersion, maxVersion) {
|
|
17
|
+
const index = PLAN_VERSIONS.indexOf(planVersion);
|
|
18
|
+
const maxIndex = PLAN_VERSIONS.indexOf(maxVersion);
|
|
19
|
+
return index !== -1 && index <= maxIndex;
|
|
20
|
+
}
|
package/utils/licensePlan.mjs
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export const PLAN_SCOPES = ['pro', 'premium'];
|
|
2
|
-
export const PLAN_VERSIONS = ['initial', 'Q3-2024', 'Q1-2026'];
|
|
2
|
+
export const PLAN_VERSIONS = ['initial', 'Q3-2024', 'Q1-2026'];
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a plan version is older than or equal to the given threshold
|
|
5
|
+
* using the ordering defined in PLAN_VERSIONS.
|
|
6
|
+
* This can be reused for future major version gates
|
|
7
|
+
* (e.g. v10 could set its own max plan version).
|
|
8
|
+
*/
|
|
9
|
+
export function isPlanVersionOlderOrEqual(planVersion, maxVersion) {
|
|
10
|
+
const index = PLAN_VERSIONS.indexOf(planVersion);
|
|
11
|
+
const maxIndex = PLAN_VERSIONS.indexOf(maxVersion);
|
|
12
|
+
return index !== -1 && index <= maxIndex;
|
|
13
|
+
}
|
package/utils/licenseStatus.d.ts
CHANGED
package/utils/licenseStatus.js
CHANGED
|
@@ -14,5 +14,6 @@ let LICENSE_STATUS = exports.LICENSE_STATUS = /*#__PURE__*/function (LICENSE_STA
|
|
|
14
14
|
LICENSE_STATUS["Valid"] = "Valid";
|
|
15
15
|
LICENSE_STATUS["OutOfScope"] = "OutOfScope";
|
|
16
16
|
LICENSE_STATUS["NotAvailableInInitialProPlan"] = "NotAvailableInInitialProPlan";
|
|
17
|
+
LICENSE_STATUS["NotValidForPackage"] = "NotValidForPackage";
|
|
17
18
|
return LICENSE_STATUS;
|
|
18
19
|
}({});
|
package/utils/licenseStatus.mjs
CHANGED
|
@@ -8,5 +8,6 @@ export let LICENSE_STATUS = /*#__PURE__*/function (LICENSE_STATUS) {
|
|
|
8
8
|
LICENSE_STATUS["Valid"] = "Valid";
|
|
9
9
|
LICENSE_STATUS["OutOfScope"] = "OutOfScope";
|
|
10
10
|
LICENSE_STATUS["NotAvailableInInitialProPlan"] = "NotAvailableInInitialProPlan";
|
|
11
|
+
LICENSE_STATUS["NotValidForPackage"] = "NotValidForPackage";
|
|
11
12
|
return LICENSE_STATUS;
|
|
12
13
|
}({});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LicenseStatus } from "../utils/licenseStatus.mjs";
|
|
2
2
|
import type { NullableLicenseDetails } from "../utils/licenseDetails.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { CommercialPackageInfo } from "../utils/commercialPackages.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* Parse a comma-separated key=value license string into a NullableLicenseDetails object.
|
|
6
6
|
* Shared by v2 and v3 decoders.
|
|
@@ -19,13 +19,11 @@ export declare function decodeLicenseVersion3(license: string): NullableLicenseD
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function decodeLicense(encodedLicense: string): NullableLicenseDetails | null;
|
|
21
21
|
export declare function verifyLicense({
|
|
22
|
-
|
|
23
|
-
licenseKey
|
|
24
|
-
packageName
|
|
22
|
+
packageInfo,
|
|
23
|
+
licenseKey
|
|
25
24
|
}: {
|
|
26
|
-
|
|
25
|
+
packageInfo: CommercialPackageInfo;
|
|
27
26
|
licenseKey?: string;
|
|
28
|
-
packageName: MuiCommercialPackageName;
|
|
29
27
|
}): {
|
|
30
28
|
status: LicenseStatus;
|
|
31
29
|
meta?: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LicenseStatus } from "../utils/licenseStatus.js";
|
|
2
2
|
import type { NullableLicenseDetails } from "../utils/licenseDetails.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CommercialPackageInfo } from "../utils/commercialPackages.js";
|
|
4
4
|
/**
|
|
5
5
|
* Parse a comma-separated key=value license string into a NullableLicenseDetails object.
|
|
6
6
|
* Shared by v2 and v3 decoders.
|
|
@@ -19,13 +19,11 @@ export declare function decodeLicenseVersion3(license: string): NullableLicenseD
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function decodeLicense(encodedLicense: string): NullableLicenseDetails | null;
|
|
21
21
|
export declare function verifyLicense({
|
|
22
|
-
|
|
23
|
-
licenseKey
|
|
24
|
-
packageName
|
|
22
|
+
packageInfo,
|
|
23
|
+
licenseKey
|
|
25
24
|
}: {
|
|
26
|
-
|
|
25
|
+
packageInfo: CommercialPackageInfo;
|
|
27
26
|
licenseKey?: string;
|
|
28
|
-
packageName: MuiCommercialPackageName;
|
|
29
27
|
}): {
|
|
30
28
|
status: LicenseStatus;
|
|
31
29
|
meta?: any;
|
|
@@ -29,6 +29,7 @@ function isPlanScopeSufficient(packageName, planScope) {
|
|
|
29
29
|
const expiryReg = /^.*EXPIRY=([0-9]+),.*$/;
|
|
30
30
|
const orderReg = /^.*ORDER:([0-9]+),.*$/;
|
|
31
31
|
const PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN = ['x-data-grid-pro', 'x-date-pickers-pro'];
|
|
32
|
+
const MAX_V8_PLAN_VERSION = 'Q3-2024';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Format: ORDER:${orderNumber},EXPIRY=${expiryTimestamp},KEYVERSION=1
|
|
@@ -163,11 +164,16 @@ function decodeLicense(encodedLicense) {
|
|
|
163
164
|
return null;
|
|
164
165
|
}
|
|
165
166
|
function verifyLicense({
|
|
166
|
-
|
|
167
|
-
licenseKey
|
|
168
|
-
packageName
|
|
167
|
+
packageInfo,
|
|
168
|
+
licenseKey
|
|
169
169
|
}) {
|
|
170
|
-
|
|
170
|
+
const {
|
|
171
|
+
name: packageName,
|
|
172
|
+
releaseDate,
|
|
173
|
+
version: packageVersion
|
|
174
|
+
} = packageInfo;
|
|
175
|
+
const packageMajorVersion = parseInt(packageVersion ?? '', 10);
|
|
176
|
+
if (!releaseDate) {
|
|
171
177
|
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: The release information is missing and license validation cannot proceed. ' + 'This is an internal error that should not occur in normal usage. ' + 'Please report this issue if you encounter it.' : (0, _formatErrorMessage2.default)(188));
|
|
172
178
|
}
|
|
173
179
|
if (!licenseKey) {
|
|
@@ -213,11 +219,18 @@ function verifyLicense({
|
|
|
213
219
|
};
|
|
214
220
|
}
|
|
215
221
|
if (license.licenseModel === 'perpetual' || process.env.NODE_ENV === 'production') {
|
|
216
|
-
const pkgTimestamp = parseInt((0, _base.base64Decode)(
|
|
222
|
+
const pkgTimestamp = parseInt((0, _base.base64Decode)(releaseDate), 10);
|
|
217
223
|
if (Number.isNaN(pkgTimestamp)) {
|
|
218
224
|
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: The release information is invalid and license validation cannot proceed. ' + 'The package release timestamp could not be parsed. ' + 'This may indicate a corrupted package. Try reinstalling the MUI X packages.' : (0, _formatErrorMessage2.default)(189));
|
|
219
225
|
}
|
|
220
226
|
if (license.expiryTimestamp < pkgTimestamp) {
|
|
227
|
+
// Perpetual v8 (or older) licenses whose expiry predates this package release
|
|
228
|
+
// are not valid for v9 packages.
|
|
229
|
+
if (packageMajorVersion != null && packageMajorVersion >= 9 && license.licenseModel === 'perpetual' && (0, _licensePlan.isPlanVersionOlderOrEqual)(license.planVersion, MAX_V8_PLAN_VERSION)) {
|
|
230
|
+
return {
|
|
231
|
+
status: _licenseStatus.LICENSE_STATUS.NotValidForPackage
|
|
232
|
+
};
|
|
233
|
+
}
|
|
221
234
|
return {
|
|
222
235
|
status: _licenseStatus.LICENSE_STATUS.ExpiredVersion
|
|
223
236
|
};
|
|
@@ -262,6 +275,14 @@ function verifyLicense({
|
|
|
262
275
|
status: _licenseStatus.LICENSE_STATUS.NotAvailableInInitialProPlan
|
|
263
276
|
};
|
|
264
277
|
}
|
|
278
|
+
|
|
279
|
+
// v8 licenses (Q1-2026 and older) are not valid for v9 packages.
|
|
280
|
+
// Perpetual licenses are exempt as they are already gated by the expiry date check.
|
|
281
|
+
if (packageMajorVersion != null && packageMajorVersion >= 9 && license.licenseModel !== 'perpetual' && (0, _licensePlan.isPlanVersionOlderOrEqual)(license.planVersion, MAX_V8_PLAN_VERSION)) {
|
|
282
|
+
return {
|
|
283
|
+
status: _licenseStatus.LICENSE_STATUS.NotValidForPackage
|
|
284
|
+
};
|
|
285
|
+
}
|
|
265
286
|
return {
|
|
266
287
|
status: _licenseStatus.LICENSE_STATUS.Valid
|
|
267
288
|
};
|
|
@@ -2,7 +2,7 @@ import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
|
2
2
|
import { base64Decode } from "../encoding/base64.mjs";
|
|
3
3
|
import { md5 } from "../encoding/md5.mjs";
|
|
4
4
|
import { LICENSE_STATUS } from "../utils/licenseStatus.mjs";
|
|
5
|
-
import { PLAN_SCOPES } from "../utils/licensePlan.mjs";
|
|
5
|
+
import { PLAN_SCOPES, isPlanVersionOlderOrEqual } from "../utils/licensePlan.mjs";
|
|
6
6
|
import { LICENSE_MODELS } from "../utils/licenseModel.mjs";
|
|
7
7
|
function isPlanScopeSufficient(packageName, planScope) {
|
|
8
8
|
let acceptedScopes;
|
|
@@ -18,6 +18,7 @@ function isPlanScopeSufficient(packageName, planScope) {
|
|
|
18
18
|
const expiryReg = /^.*EXPIRY=([0-9]+),.*$/;
|
|
19
19
|
const orderReg = /^.*ORDER:([0-9]+),.*$/;
|
|
20
20
|
const PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN = ['x-data-grid-pro', 'x-date-pickers-pro'];
|
|
21
|
+
const MAX_V8_PLAN_VERSION = 'Q3-2024';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Format: ORDER:${orderNumber},EXPIRY=${expiryTimestamp},KEYVERSION=1
|
|
@@ -152,11 +153,16 @@ export function decodeLicense(encodedLicense) {
|
|
|
152
153
|
return null;
|
|
153
154
|
}
|
|
154
155
|
export function verifyLicense({
|
|
155
|
-
|
|
156
|
-
licenseKey
|
|
157
|
-
packageName
|
|
156
|
+
packageInfo,
|
|
157
|
+
licenseKey
|
|
158
158
|
}) {
|
|
159
|
-
|
|
159
|
+
const {
|
|
160
|
+
name: packageName,
|
|
161
|
+
releaseDate,
|
|
162
|
+
version: packageVersion
|
|
163
|
+
} = packageInfo;
|
|
164
|
+
const packageMajorVersion = parseInt(packageVersion ?? '', 10);
|
|
165
|
+
if (!releaseDate) {
|
|
160
166
|
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: The release information is missing and license validation cannot proceed. ' + 'This is an internal error that should not occur in normal usage. ' + 'Please report this issue if you encounter it.' : _formatErrorMessage(188));
|
|
161
167
|
}
|
|
162
168
|
if (!licenseKey) {
|
|
@@ -202,11 +208,18 @@ export function verifyLicense({
|
|
|
202
208
|
};
|
|
203
209
|
}
|
|
204
210
|
if (license.licenseModel === 'perpetual' || process.env.NODE_ENV === 'production') {
|
|
205
|
-
const pkgTimestamp = parseInt(base64Decode(
|
|
211
|
+
const pkgTimestamp = parseInt(base64Decode(releaseDate), 10);
|
|
206
212
|
if (Number.isNaN(pkgTimestamp)) {
|
|
207
213
|
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X: The release information is invalid and license validation cannot proceed. ' + 'The package release timestamp could not be parsed. ' + 'This may indicate a corrupted package. Try reinstalling the MUI X packages.' : _formatErrorMessage(189));
|
|
208
214
|
}
|
|
209
215
|
if (license.expiryTimestamp < pkgTimestamp) {
|
|
216
|
+
// Perpetual v8 (or older) licenses whose expiry predates this package release
|
|
217
|
+
// are not valid for v9 packages.
|
|
218
|
+
if (packageMajorVersion != null && packageMajorVersion >= 9 && license.licenseModel === 'perpetual' && isPlanVersionOlderOrEqual(license.planVersion, MAX_V8_PLAN_VERSION)) {
|
|
219
|
+
return {
|
|
220
|
+
status: LICENSE_STATUS.NotValidForPackage
|
|
221
|
+
};
|
|
222
|
+
}
|
|
210
223
|
return {
|
|
211
224
|
status: LICENSE_STATUS.ExpiredVersion
|
|
212
225
|
};
|
|
@@ -251,6 +264,14 @@ export function verifyLicense({
|
|
|
251
264
|
status: LICENSE_STATUS.NotAvailableInInitialProPlan
|
|
252
265
|
};
|
|
253
266
|
}
|
|
267
|
+
|
|
268
|
+
// v8 licenses (Q1-2026 and older) are not valid for v9 packages.
|
|
269
|
+
// Perpetual licenses are exempt as they are already gated by the expiry date check.
|
|
270
|
+
if (packageMajorVersion != null && packageMajorVersion >= 9 && license.licenseModel !== 'perpetual' && isPlanVersionOlderOrEqual(license.planVersion, MAX_V8_PLAN_VERSION)) {
|
|
271
|
+
return {
|
|
272
|
+
status: LICENSE_STATUS.NotValidForPackage
|
|
273
|
+
};
|
|
274
|
+
}
|
|
254
275
|
return {
|
|
255
276
|
status: LICENSE_STATUS.Valid
|
|
256
277
|
};
|
package/license-env.d.mts
DELETED