strapi-plugin-magic-sessionmanager 4.5.13 → 4.6.2

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +90 -34
  3. package/dist/{_chunks/Analytics-DM4_UffY.js → admin/Analytics-BMkhiuRX.js} +3 -121
  4. package/dist/{_chunks/Analytics--qB2cKuD.mjs → admin/Analytics-CwNJ3TNI.mjs} +5 -123
  5. package/dist/{_chunks/App-DF-VsbDW.js → admin/App-DazHh7Zi.js} +67 -646
  6. package/dist/{_chunks/App-CL5q29Mi.mjs → admin/App-Sk0F9UEN.mjs} +69 -648
  7. package/dist/{_chunks/License-D9piCp34.mjs → admin/License-6SIpR7Rk.mjs} +34 -113
  8. package/dist/{_chunks/License-Dmm1d3fQ.js → admin/License-BwbmzbP_.js} +34 -113
  9. package/dist/{_chunks/OnlineUsersWidget-KchZ_ScS.js → admin/OnlineUsersWidget-BIfnbFcZ.js} +44 -36
  10. package/dist/{_chunks/OnlineUsersWidget-DHsthkt0.mjs → admin/OnlineUsersWidget-Qq_uCTi1.mjs} +44 -36
  11. package/dist/{_chunks/Settings-D6ILgR9X.mjs → admin/Settings-BA7S_8DF.mjs} +286 -112
  12. package/dist/{_chunks/Settings-CUNaxDWk.js → admin/Settings-CCYScjxv.js} +284 -110
  13. package/dist/{_chunks/de-CDA1V0rF.mjs → admin/de-6rIvkYOp.mjs} +37 -14
  14. package/dist/{_chunks/de-I-Q-pWqu.js → admin/de-DjP2WJ_V.js} +37 -14
  15. package/dist/{_chunks/en-Bd7_h-4e.js → admin/en-0pesBbOT.js} +37 -14
  16. package/dist/{_chunks/en-DzmOCyzQ.mjs → admin/en-8hiv31Dv.mjs} +37 -14
  17. package/dist/{_chunks/es-BcAx18XG.js → admin/es-DdBRpF7F.js} +37 -14
  18. package/dist/{_chunks/es-Cx-SN6qV.mjs → admin/es-LRQ148f5.mjs} +37 -14
  19. package/dist/{_chunks/fr-DXlXE5Eo.mjs → admin/fr-CKhx_qil.mjs} +37 -14
  20. package/dist/{_chunks/fr-DCzYMuJ-.js → admin/fr-DJ6DbeDy.js} +37 -14
  21. package/dist/{_chunks/index-CTxGMDHr.js → admin/index-DTskQVDl.js} +12 -25
  22. package/dist/{_chunks/index-CwxKazpc.mjs → admin/index-UTLA1r40.mjs} +12 -25
  23. package/dist/admin/index.js +3 -2
  24. package/dist/admin/index.mjs +1 -1
  25. package/dist/{_chunks/pt-21-MAb72.js → admin/pt-D0SMoAmo.js} +37 -14
  26. package/dist/{_chunks/pt-zsdTSjba.mjs → admin/pt-DXizUvcj.mjs} +37 -14
  27. package/dist/server/index.js +9680 -8914
  28. package/dist/server/index.mjs +9701 -8918
  29. package/package.json +25 -14
  30. package/scripts/geoip-updater.cjs +220 -0
  31. package/scripts/update-geoip-db.mjs +38 -0
  32. package/strapi-admin.js +2 -1
  33. package/strapi-server.js +2 -1
  34. package/dist/_chunks/UpgradePage-D697BVWo.mjs +0 -352
  35. package/dist/_chunks/UpgradePage-Dwrv7g8L.js +0 -354
  36. package/dist/_chunks/useLicense-B9WW9s_d.mjs +0 -86
  37. package/dist/_chunks/useLicense-BEbtA_Zo.js +0 -85
  38. /package/dist/{_chunks → admin}/StyledButtons-Cz8oYhmc.mjs +0 -0
  39. /package/dist/{_chunks → admin}/StyledButtons-DDuxnYz8.js +0 -0
@@ -1,86 +0,0 @@
1
- import { useState, useEffect } from "react";
2
- import { useFetchClient } from "@strapi/strapi/admin";
3
- import { a as pluginId } from "./index-CwxKazpc.mjs";
4
- const useLicense = () => {
5
- const { get } = useFetchClient();
6
- const [isPremium, setIsPremium] = useState(false);
7
- const [isAdvanced, setIsAdvanced] = useState(false);
8
- const [isEnterprise, setIsEnterprise] = useState(false);
9
- const [loading, setLoading] = useState(true);
10
- const [error, setError] = useState(null);
11
- const [licenseData, setLicenseData] = useState(null);
12
- useEffect(() => {
13
- checkLicense();
14
- const interval = setInterval(() => {
15
- checkLicense(true);
16
- }, 60 * 60 * 1e3);
17
- return () => clearInterval(interval);
18
- }, []);
19
- const checkLicense = async (silent = false) => {
20
- if (!silent) {
21
- setLoading(true);
22
- }
23
- try {
24
- const response = await get(`/${pluginId}/license/status`);
25
- if (!silent) {
26
- console.log("[magic-sessionmanager/useLicense] Full API Response:", response.data);
27
- console.log("[magic-sessionmanager/useLicense] License Details:", {
28
- valid: response.data?.valid,
29
- demo: response.data?.demo,
30
- licenseKey: response.data?.data?.licenseKey?.substring(0, 13) + "...",
31
- email: response.data?.data?.email,
32
- features: response.data?.data?.features,
33
- rawFeaturePremium: response.data?.data?.features?.premium
34
- });
35
- }
36
- const isValid = response.data?.valid || false;
37
- const hasPremiumFeature = response.data?.data?.features?.premium || false;
38
- const hasAdvancedFeature = response.data?.data?.features?.advanced || false;
39
- const hasEnterpriseFeature = response.data?.data?.features?.enterprise || false;
40
- const newIsPremium = isValid && hasPremiumFeature;
41
- const newIsAdvanced = isValid && hasAdvancedFeature;
42
- const newIsEnterprise = isValid && hasEnterpriseFeature;
43
- if ((newIsPremium !== isPremium || !silent) && !silent) {
44
- console.log(`[magic-sessionmanager/useLicense] Premium Status: ${newIsPremium} (valid: ${isValid}, featurePremium: ${hasPremiumFeature})`);
45
- if (!newIsPremium && isValid) {
46
- console.warn("[magic-sessionmanager/useLicense] [WARN] License is valid but Premium feature is not enabled!");
47
- }
48
- }
49
- setIsPremium(newIsPremium);
50
- setIsAdvanced(newIsAdvanced);
51
- setIsEnterprise(newIsEnterprise);
52
- setLicenseData(response.data?.data || null);
53
- setError(null);
54
- } catch (err) {
55
- if (!silent) {
56
- console.error("[useLicense] Error checking license:", err);
57
- }
58
- setIsPremium(false);
59
- setIsAdvanced(false);
60
- setIsEnterprise(false);
61
- setLicenseData(null);
62
- setError(err);
63
- } finally {
64
- if (!silent) {
65
- setLoading(false);
66
- }
67
- }
68
- };
69
- return {
70
- isPremium,
71
- isAdvanced,
72
- isEnterprise,
73
- loading,
74
- error,
75
- licenseData,
76
- features: {
77
- premium: isPremium,
78
- advanced: isAdvanced,
79
- enterprise: isEnterprise
80
- },
81
- refetch: checkLicense
82
- };
83
- };
84
- export {
85
- useLicense as u
86
- };
@@ -1,85 +0,0 @@
1
- "use strict";
2
- const react = require("react");
3
- const admin = require("@strapi/strapi/admin");
4
- const index = require("./index-CTxGMDHr.js");
5
- const useLicense = () => {
6
- const { get } = admin.useFetchClient();
7
- const [isPremium, setIsPremium] = react.useState(false);
8
- const [isAdvanced, setIsAdvanced] = react.useState(false);
9
- const [isEnterprise, setIsEnterprise] = react.useState(false);
10
- const [loading, setLoading] = react.useState(true);
11
- const [error, setError] = react.useState(null);
12
- const [licenseData, setLicenseData] = react.useState(null);
13
- react.useEffect(() => {
14
- checkLicense();
15
- const interval = setInterval(() => {
16
- checkLicense(true);
17
- }, 60 * 60 * 1e3);
18
- return () => clearInterval(interval);
19
- }, []);
20
- const checkLicense = async (silent = false) => {
21
- if (!silent) {
22
- setLoading(true);
23
- }
24
- try {
25
- const response = await get(`/${index.pluginId}/license/status`);
26
- if (!silent) {
27
- console.log("[magic-sessionmanager/useLicense] Full API Response:", response.data);
28
- console.log("[magic-sessionmanager/useLicense] License Details:", {
29
- valid: response.data?.valid,
30
- demo: response.data?.demo,
31
- licenseKey: response.data?.data?.licenseKey?.substring(0, 13) + "...",
32
- email: response.data?.data?.email,
33
- features: response.data?.data?.features,
34
- rawFeaturePremium: response.data?.data?.features?.premium
35
- });
36
- }
37
- const isValid = response.data?.valid || false;
38
- const hasPremiumFeature = response.data?.data?.features?.premium || false;
39
- const hasAdvancedFeature = response.data?.data?.features?.advanced || false;
40
- const hasEnterpriseFeature = response.data?.data?.features?.enterprise || false;
41
- const newIsPremium = isValid && hasPremiumFeature;
42
- const newIsAdvanced = isValid && hasAdvancedFeature;
43
- const newIsEnterprise = isValid && hasEnterpriseFeature;
44
- if ((newIsPremium !== isPremium || !silent) && !silent) {
45
- console.log(`[magic-sessionmanager/useLicense] Premium Status: ${newIsPremium} (valid: ${isValid}, featurePremium: ${hasPremiumFeature})`);
46
- if (!newIsPremium && isValid) {
47
- console.warn("[magic-sessionmanager/useLicense] [WARN] License is valid but Premium feature is not enabled!");
48
- }
49
- }
50
- setIsPremium(newIsPremium);
51
- setIsAdvanced(newIsAdvanced);
52
- setIsEnterprise(newIsEnterprise);
53
- setLicenseData(response.data?.data || null);
54
- setError(null);
55
- } catch (err) {
56
- if (!silent) {
57
- console.error("[useLicense] Error checking license:", err);
58
- }
59
- setIsPremium(false);
60
- setIsAdvanced(false);
61
- setIsEnterprise(false);
62
- setLicenseData(null);
63
- setError(err);
64
- } finally {
65
- if (!silent) {
66
- setLoading(false);
67
- }
68
- }
69
- };
70
- return {
71
- isPremium,
72
- isAdvanced,
73
- isEnterprise,
74
- loading,
75
- error,
76
- licenseData,
77
- features: {
78
- premium: isPremium,
79
- advanced: isAdvanced,
80
- enterprise: isEnterprise
81
- },
82
- refetch: checkLicense
83
- };
84
- };
85
- exports.useLicense = useLicense;