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