strapi-plugin-magic-link-v5 5.5.5 → 5.5.6
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 +7 -0
- package/dist/_chunks/{index-C6WRQuex.mjs → index-34ICAF9_.mjs} +3 -3
- package/dist/_chunks/{index-DoSROJog.js → index-BFzW7Xex.js} +3 -3
- package/dist/_chunks/{index-Ki-zhMlp.mjs → index-BZFGxKmY.mjs} +1 -1
- package/dist/_chunks/{index-DJyAppvB.js → index-CddEy_As.js} +1 -1
- package/dist/_chunks/{index-CQ3Kd12m.js → index-CuXnqVl4.js} +12 -10
- package/dist/_chunks/{index-B9M8wkAj.mjs → index-CxCULraY.mjs} +1 -1
- package/dist/_chunks/{index-DC00x-wm.js → index-M5s7QN5m.js} +1 -1
- package/dist/_chunks/{index-CoZjdlQd.mjs → index-ivgYEX37.mjs} +12 -10
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +265 -276
- package/dist/server/index.mjs +265 -276
- package/package.json +8 -2
package/dist/server/index.js
CHANGED
|
@@ -4823,271 +4823,265 @@ var store$1 = ({ strapi: strapi2 }) => ({
|
|
|
4823
4823
|
return pluginStore.set({ key: "settings", value: settings });
|
|
4824
4824
|
}
|
|
4825
4825
|
});
|
|
4826
|
-
var features$1
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
//
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
//
|
|
4838
|
-
|
|
4839
|
-
//
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
//
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
//
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
/**
|
|
5007
|
-
* Check if a feature is available for given license tier
|
|
5008
|
-
*/
|
|
5009
|
-
hasFeature(licenseData, featureName) {
|
|
5010
|
-
if (!licenseData) {
|
|
5011
|
-
return this.free.features.includes(featureName);
|
|
5012
|
-
}
|
|
5013
|
-
let isEnterprise = false;
|
|
5014
|
-
let isAdvanced = false;
|
|
5015
|
-
let isPremium = false;
|
|
5016
|
-
if (licenseData.tier) {
|
|
5017
|
-
isEnterprise = licenseData.tier === "enterprise";
|
|
5018
|
-
isAdvanced = licenseData.tier === "advanced";
|
|
5019
|
-
isPremium = licenseData.tier === "premium";
|
|
5020
|
-
}
|
|
5021
|
-
if (licenseData.features) {
|
|
5022
|
-
isEnterprise = isEnterprise || licenseData.features.enterprise === true;
|
|
5023
|
-
isAdvanced = isAdvanced || licenseData.features.advanced === true;
|
|
5024
|
-
isPremium = isPremium || licenseData.features.premium === true;
|
|
5025
|
-
}
|
|
5026
|
-
if (licenseData.featureEnterprise === true) {
|
|
5027
|
-
isEnterprise = true;
|
|
5028
|
-
}
|
|
5029
|
-
if (licenseData.featureAdvanced === true) {
|
|
5030
|
-
isAdvanced = true;
|
|
5031
|
-
}
|
|
5032
|
-
if (licenseData.featurePremium === true) {
|
|
5033
|
-
isPremium = true;
|
|
5034
|
-
}
|
|
5035
|
-
if (isEnterprise && this.enterprise.features.includes(featureName)) {
|
|
5036
|
-
return true;
|
|
5037
|
-
}
|
|
5038
|
-
if (isAdvanced && this.advanced.features.includes(featureName)) {
|
|
5039
|
-
return true;
|
|
5040
|
-
}
|
|
5041
|
-
if (isPremium && this.premium.features.includes(featureName)) {
|
|
5042
|
-
return true;
|
|
5043
|
-
}
|
|
4826
|
+
var features$1 = {
|
|
4827
|
+
// FREE/DEMO Features
|
|
4828
|
+
free: {
|
|
4829
|
+
maxTokens: 100,
|
|
4830
|
+
// 100 aktive Tokens gleichzeitig
|
|
4831
|
+
maxSessions: 50,
|
|
4832
|
+
// 50 aktive JWT Sessions
|
|
4833
|
+
maxIPBans: 10,
|
|
4834
|
+
// 10 gebannte IPs
|
|
4835
|
+
features: [
|
|
4836
|
+
"basic-magic-link",
|
|
4837
|
+
// Basis Magic Link Auth
|
|
4838
|
+
"email-templates",
|
|
4839
|
+
// Basis Email Templates
|
|
4840
|
+
"jwt-sessions",
|
|
4841
|
+
// JWT Session Management
|
|
4842
|
+
"ip-tracking",
|
|
4843
|
+
// IP Tracking für Security
|
|
4844
|
+
"rate-limiting",
|
|
4845
|
+
// Basis Rate Limiting
|
|
4846
|
+
"auto-user-creation",
|
|
4847
|
+
// Auto User Creation
|
|
4848
|
+
"token-management",
|
|
4849
|
+
// Token Dashboard
|
|
4850
|
+
"ip-bans"
|
|
4851
|
+
// IP Ban Management
|
|
4852
|
+
]
|
|
4853
|
+
},
|
|
4854
|
+
// PREMIUM Features
|
|
4855
|
+
premium: {
|
|
4856
|
+
maxTokens: 1e3,
|
|
4857
|
+
// 1000 aktive Tokens
|
|
4858
|
+
maxSessions: 500,
|
|
4859
|
+
// 500 aktive Sessions
|
|
4860
|
+
maxIPBans: 100,
|
|
4861
|
+
// 100 gebannte IPs
|
|
4862
|
+
features: [
|
|
4863
|
+
"basic-magic-link",
|
|
4864
|
+
"email-templates",
|
|
4865
|
+
"jwt-sessions",
|
|
4866
|
+
"ip-tracking",
|
|
4867
|
+
"rate-limiting",
|
|
4868
|
+
"auto-user-creation",
|
|
4869
|
+
"token-management",
|
|
4870
|
+
"ip-bans",
|
|
4871
|
+
"otp-email",
|
|
4872
|
+
// Email OTP (6-digit code)
|
|
4873
|
+
"mfa-totp",
|
|
4874
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4875
|
+
"custom-email-templates",
|
|
4876
|
+
// Custom HTML/Text Templates
|
|
4877
|
+
"email-designer-integration",
|
|
4878
|
+
// Email Designer 5 Support
|
|
4879
|
+
"magic-mail-integration",
|
|
4880
|
+
// MagicMail Integration
|
|
4881
|
+
"advanced-rate-limiting",
|
|
4882
|
+
// Custom Rate Limits
|
|
4883
|
+
"session-management",
|
|
4884
|
+
// Erweiterte Session Verwaltung
|
|
4885
|
+
"bulk-operations",
|
|
4886
|
+
// Bulk Token/Session Operations
|
|
4887
|
+
"extended-logging",
|
|
4888
|
+
// Erweiterte Login-Info Logs
|
|
4889
|
+
"custom-redirect-urls"
|
|
4890
|
+
// Custom Redirect URLs per Token
|
|
4891
|
+
]
|
|
4892
|
+
},
|
|
4893
|
+
// ADVANCED Features
|
|
4894
|
+
advanced: {
|
|
4895
|
+
maxTokens: -1,
|
|
4896
|
+
// Unlimited
|
|
4897
|
+
maxSessions: -1,
|
|
4898
|
+
// Unlimited
|
|
4899
|
+
maxIPBans: -1,
|
|
4900
|
+
// Unlimited
|
|
4901
|
+
features: [
|
|
4902
|
+
"basic-magic-link",
|
|
4903
|
+
"email-templates",
|
|
4904
|
+
"jwt-sessions",
|
|
4905
|
+
"ip-tracking",
|
|
4906
|
+
"rate-limiting",
|
|
4907
|
+
"auto-user-creation",
|
|
4908
|
+
"token-management",
|
|
4909
|
+
"ip-bans",
|
|
4910
|
+
"otp-email",
|
|
4911
|
+
"mfa-totp",
|
|
4912
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4913
|
+
"otp-sms",
|
|
4914
|
+
// SMS OTP via Twilio/Vonage
|
|
4915
|
+
"otp-totp",
|
|
4916
|
+
// TOTP (Authenticator Apps)
|
|
4917
|
+
"totp-primary-login",
|
|
4918
|
+
// Login with Email + TOTP only (Szenario 2)
|
|
4919
|
+
"custom-email-templates",
|
|
4920
|
+
"email-designer-integration",
|
|
4921
|
+
"magic-mail-integration",
|
|
4922
|
+
"advanced-rate-limiting",
|
|
4923
|
+
"session-management",
|
|
4924
|
+
"bulk-operations",
|
|
4925
|
+
"extended-logging",
|
|
4926
|
+
"custom-redirect-urls",
|
|
4927
|
+
"webhook-notifications",
|
|
4928
|
+
// Webhooks für Events
|
|
4929
|
+
"api-access-tokens",
|
|
4930
|
+
// API Tokens für Programmatic Access
|
|
4931
|
+
"advanced-analytics",
|
|
4932
|
+
// Analytics Dashboard
|
|
4933
|
+
"custom-token-context",
|
|
4934
|
+
// Custom Context Data in Tokens
|
|
4935
|
+
"geolocation-tracking",
|
|
4936
|
+
// GeoIP Tracking
|
|
4937
|
+
"device-fingerprinting",
|
|
4938
|
+
// Device Fingerprinting
|
|
4939
|
+
"suspicious-login-alerts"
|
|
4940
|
+
// Alerts für verdächtige Logins
|
|
4941
|
+
]
|
|
4942
|
+
},
|
|
4943
|
+
// ENTERPRISE Features
|
|
4944
|
+
enterprise: {
|
|
4945
|
+
maxTokens: -1,
|
|
4946
|
+
maxSessions: -1,
|
|
4947
|
+
maxIPBans: -1,
|
|
4948
|
+
features: [
|
|
4949
|
+
"basic-magic-link",
|
|
4950
|
+
"email-templates",
|
|
4951
|
+
"jwt-sessions",
|
|
4952
|
+
"ip-tracking",
|
|
4953
|
+
"rate-limiting",
|
|
4954
|
+
"auto-user-creation",
|
|
4955
|
+
"token-management",
|
|
4956
|
+
"ip-bans",
|
|
4957
|
+
"otp-email",
|
|
4958
|
+
"mfa-totp",
|
|
4959
|
+
// MFA: Magic Link + TOTP (Szenario 1)
|
|
4960
|
+
"otp-sms",
|
|
4961
|
+
"otp-totp",
|
|
4962
|
+
"totp-primary-login",
|
|
4963
|
+
// Login with Email + TOTP only (Szenario 2)
|
|
4964
|
+
"otp-backup-codes",
|
|
4965
|
+
// Backup Recovery Codes
|
|
4966
|
+
"biometric-support",
|
|
4967
|
+
// WebAuthn/FIDO2
|
|
4968
|
+
"custom-email-templates",
|
|
4969
|
+
"email-designer-integration",
|
|
4970
|
+
"magic-mail-integration",
|
|
4971
|
+
"advanced-rate-limiting",
|
|
4972
|
+
"session-management",
|
|
4973
|
+
"bulk-operations",
|
|
4974
|
+
"extended-logging",
|
|
4975
|
+
"custom-redirect-urls",
|
|
4976
|
+
"webhook-notifications",
|
|
4977
|
+
"api-access-tokens",
|
|
4978
|
+
"advanced-analytics",
|
|
4979
|
+
"custom-token-context",
|
|
4980
|
+
"geolocation-tracking",
|
|
4981
|
+
"device-fingerprinting",
|
|
4982
|
+
"suspicious-login-alerts",
|
|
4983
|
+
"sso-integration",
|
|
4984
|
+
// SSO/SAML Integration
|
|
4985
|
+
"ldap-sync",
|
|
4986
|
+
// LDAP/AD Sync
|
|
4987
|
+
"audit-logs",
|
|
4988
|
+
// Vollständige Audit Logs
|
|
4989
|
+
"compliance-reports",
|
|
4990
|
+
// GDPR/SOC2 Reports
|
|
4991
|
+
"priority-support",
|
|
4992
|
+
// 24/7 Priority Support
|
|
4993
|
+
"custom-security-rules",
|
|
4994
|
+
// Custom Security Rules
|
|
4995
|
+
"multi-tenant",
|
|
4996
|
+
// Multi-Tenant Support
|
|
4997
|
+
"white-label"
|
|
4998
|
+
// White-Label Branding
|
|
4999
|
+
]
|
|
5000
|
+
},
|
|
5001
|
+
/**
|
|
5002
|
+
* Check if a feature is available for given license tier
|
|
5003
|
+
*/
|
|
5004
|
+
hasFeature(licenseData, featureName) {
|
|
5005
|
+
if (!licenseData) {
|
|
5044
5006
|
return this.free.features.includes(featureName);
|
|
5045
|
-
},
|
|
5046
|
-
/**
|
|
5047
|
-
* Get max allowed tokens for license tier
|
|
5048
|
-
*/
|
|
5049
|
-
getMaxTokens(licenseData) {
|
|
5050
|
-
if (!licenseData) return this.free.maxTokens;
|
|
5051
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
|
|
5052
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
|
|
5053
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
|
|
5054
|
-
return this.free.maxTokens;
|
|
5055
|
-
},
|
|
5056
|
-
/**
|
|
5057
|
-
* Get max allowed sessions for license tier
|
|
5058
|
-
*/
|
|
5059
|
-
getMaxSessions(licenseData) {
|
|
5060
|
-
if (!licenseData) return this.free.maxSessions;
|
|
5061
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
|
|
5062
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
|
|
5063
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
|
|
5064
|
-
return this.free.maxSessions;
|
|
5065
|
-
},
|
|
5066
|
-
/**
|
|
5067
|
-
* Get max allowed IP bans for license tier
|
|
5068
|
-
*/
|
|
5069
|
-
getMaxIPBans(licenseData) {
|
|
5070
|
-
if (!licenseData) return this.free.maxIPBans;
|
|
5071
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
|
|
5072
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
|
|
5073
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
|
|
5074
|
-
return this.free.maxIPBans;
|
|
5075
|
-
},
|
|
5076
|
-
/**
|
|
5077
|
-
* Get tier name from license data
|
|
5078
|
-
*/
|
|
5079
|
-
getTierName(licenseData) {
|
|
5080
|
-
if (!licenseData) return "free";
|
|
5081
|
-
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
|
|
5082
|
-
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
|
|
5083
|
-
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
|
|
5084
|
-
return "free";
|
|
5085
5007
|
}
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5008
|
+
let isEnterprise = false;
|
|
5009
|
+
let isAdvanced = false;
|
|
5010
|
+
let isPremium = false;
|
|
5011
|
+
if (licenseData.tier) {
|
|
5012
|
+
isEnterprise = licenseData.tier === "enterprise";
|
|
5013
|
+
isAdvanced = licenseData.tier === "advanced";
|
|
5014
|
+
isPremium = licenseData.tier === "premium";
|
|
5015
|
+
}
|
|
5016
|
+
if (licenseData.features) {
|
|
5017
|
+
isEnterprise = isEnterprise || licenseData.features.enterprise === true;
|
|
5018
|
+
isAdvanced = isAdvanced || licenseData.features.advanced === true;
|
|
5019
|
+
isPremium = isPremium || licenseData.features.premium === true;
|
|
5020
|
+
}
|
|
5021
|
+
if (licenseData.featureEnterprise === true) {
|
|
5022
|
+
isEnterprise = true;
|
|
5023
|
+
}
|
|
5024
|
+
if (licenseData.featureAdvanced === true) {
|
|
5025
|
+
isAdvanced = true;
|
|
5026
|
+
}
|
|
5027
|
+
if (licenseData.featurePremium === true) {
|
|
5028
|
+
isPremium = true;
|
|
5029
|
+
}
|
|
5030
|
+
if (isEnterprise && this.enterprise.features.includes(featureName)) {
|
|
5031
|
+
return true;
|
|
5032
|
+
}
|
|
5033
|
+
if (isAdvanced && this.advanced.features.includes(featureName)) {
|
|
5034
|
+
return true;
|
|
5035
|
+
}
|
|
5036
|
+
if (isPremium && this.premium.features.includes(featureName)) {
|
|
5037
|
+
return true;
|
|
5038
|
+
}
|
|
5039
|
+
return this.free.features.includes(featureName);
|
|
5040
|
+
},
|
|
5041
|
+
/**
|
|
5042
|
+
* Get max allowed tokens for license tier
|
|
5043
|
+
*/
|
|
5044
|
+
getMaxTokens(licenseData) {
|
|
5045
|
+
if (!licenseData) return this.free.maxTokens;
|
|
5046
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxTokens;
|
|
5047
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxTokens;
|
|
5048
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxTokens;
|
|
5049
|
+
return this.free.maxTokens;
|
|
5050
|
+
},
|
|
5051
|
+
/**
|
|
5052
|
+
* Get max allowed sessions for license tier
|
|
5053
|
+
*/
|
|
5054
|
+
getMaxSessions(licenseData) {
|
|
5055
|
+
if (!licenseData) return this.free.maxSessions;
|
|
5056
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxSessions;
|
|
5057
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxSessions;
|
|
5058
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxSessions;
|
|
5059
|
+
return this.free.maxSessions;
|
|
5060
|
+
},
|
|
5061
|
+
/**
|
|
5062
|
+
* Get max allowed IP bans for license tier
|
|
5063
|
+
*/
|
|
5064
|
+
getMaxIPBans(licenseData) {
|
|
5065
|
+
if (!licenseData) return this.free.maxIPBans;
|
|
5066
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return this.enterprise.maxIPBans;
|
|
5067
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return this.advanced.maxIPBans;
|
|
5068
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return this.premium.maxIPBans;
|
|
5069
|
+
return this.free.maxIPBans;
|
|
5070
|
+
},
|
|
5071
|
+
/**
|
|
5072
|
+
* Get tier name from license data
|
|
5073
|
+
*/
|
|
5074
|
+
getTierName(licenseData) {
|
|
5075
|
+
if (!licenseData) return "free";
|
|
5076
|
+
if (licenseData.featureEnterprise === true || licenseData.features?.enterprise === true) return "enterprise";
|
|
5077
|
+
if (licenseData.featureAdvanced === true || licenseData.features?.advanced === true) return "advanced";
|
|
5078
|
+
if (licenseData.featurePremium === true || licenseData.features?.premium === true) return "premium";
|
|
5079
|
+
return "free";
|
|
5080
|
+
}
|
|
5081
|
+
};
|
|
5089
5082
|
const crypto$1 = require$$0__default.default;
|
|
5090
5083
|
const os = require$$1__default$3.default;
|
|
5084
|
+
const features = features$1;
|
|
5091
5085
|
const LICENSE_SERVER_URL = "https://magicapi.fitlex.me";
|
|
5092
5086
|
const envTimeout = Number(process.env.MAGIC_LICENSE_TIMEOUT_MS);
|
|
5093
5087
|
const DEFAULT_FETCH_TIMEOUT_MS = Number.isFinite(envTimeout) && envTimeout > 0 ? envTimeout : 12e3;
|
|
@@ -5469,14 +5463,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5469
5463
|
*/
|
|
5470
5464
|
async hasFeature(featureName) {
|
|
5471
5465
|
try {
|
|
5472
|
-
const features2 = requireFeatures();
|
|
5473
5466
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5474
5467
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5475
5468
|
if (!licenseKey) {
|
|
5476
|
-
return
|
|
5469
|
+
return features.hasFeature(null, featureName);
|
|
5477
5470
|
}
|
|
5478
5471
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5479
|
-
return
|
|
5472
|
+
return features.hasFeature(licenseData, featureName);
|
|
5480
5473
|
} catch (error) {
|
|
5481
5474
|
strapi2.log.error("Error checking feature:", error);
|
|
5482
5475
|
return false;
|
|
@@ -5488,14 +5481,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5488
5481
|
*/
|
|
5489
5482
|
async getMaxTokens() {
|
|
5490
5483
|
try {
|
|
5491
|
-
const features2 = requireFeatures();
|
|
5492
5484
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5493
5485
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5494
5486
|
if (!licenseKey) {
|
|
5495
|
-
return
|
|
5487
|
+
return features.getMaxTokens(null);
|
|
5496
5488
|
}
|
|
5497
5489
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5498
|
-
return
|
|
5490
|
+
return features.getMaxTokens(licenseData);
|
|
5499
5491
|
} catch (error) {
|
|
5500
5492
|
strapi2.log.error("Error getting max tokens:", error);
|
|
5501
5493
|
return features.free.maxTokens;
|
|
@@ -5507,14 +5499,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5507
5499
|
*/
|
|
5508
5500
|
async getMaxSessions() {
|
|
5509
5501
|
try {
|
|
5510
|
-
const features2 = requireFeatures();
|
|
5511
5502
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5512
5503
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5513
5504
|
if (!licenseKey) {
|
|
5514
|
-
return
|
|
5505
|
+
return features.getMaxSessions(null);
|
|
5515
5506
|
}
|
|
5516
5507
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5517
|
-
return
|
|
5508
|
+
return features.getMaxSessions(licenseData);
|
|
5518
5509
|
} catch (error) {
|
|
5519
5510
|
strapi2.log.error("Error getting max sessions:", error);
|
|
5520
5511
|
return features.free.maxSessions;
|
|
@@ -5526,14 +5517,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5526
5517
|
*/
|
|
5527
5518
|
async getMaxIPBans() {
|
|
5528
5519
|
try {
|
|
5529
|
-
const features2 = requireFeatures();
|
|
5530
5520
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5531
5521
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5532
5522
|
if (!licenseKey) {
|
|
5533
|
-
return
|
|
5523
|
+
return features.getMaxIPBans(null);
|
|
5534
5524
|
}
|
|
5535
5525
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5536
|
-
return
|
|
5526
|
+
return features.getMaxIPBans(licenseData);
|
|
5537
5527
|
} catch (error) {
|
|
5538
5528
|
strapi2.log.error("Error getting max IP bans:", error);
|
|
5539
5529
|
return features.free.maxIPBans;
|
|
@@ -5545,14 +5535,13 @@ var licenseGuard$1 = ({ strapi: strapi2 }) => ({
|
|
|
5545
5535
|
*/
|
|
5546
5536
|
async getAvailableOTPTypes() {
|
|
5547
5537
|
try {
|
|
5548
|
-
const features2 = requireFeatures();
|
|
5549
5538
|
const pluginStore = strapi2.store({ type: "plugin", name: "magic-link" });
|
|
5550
5539
|
const licenseKey = await pluginStore.get({ key: "licenseKey" });
|
|
5551
5540
|
if (!licenseKey) {
|
|
5552
|
-
return
|
|
5541
|
+
return features.getAvailableOTPTypes(null);
|
|
5553
5542
|
}
|
|
5554
5543
|
const licenseData = await this.getLicenseByKey(licenseKey);
|
|
5555
|
-
return
|
|
5544
|
+
return features.getAvailableOTPTypes(licenseData);
|
|
5556
5545
|
} catch (error) {
|
|
5557
5546
|
strapi2.log.error("Error getting available OTP types:", error);
|
|
5558
5547
|
return [];
|