strapi-plugin-magic-sessionmanager 4.6.4 → 4.7.0
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 +12 -0
- package/README.md +15 -8
- package/dist/admin/{Analytics-BJlc-yE3.js → Analytics-Cw6R2xZn.js} +5 -1
- package/dist/admin/{Analytics-B5IR0Awr.mjs → Analytics-Dq8PuDhs.mjs} +5 -1
- package/dist/admin/{App-BEniJePD.mjs → App-BIFTc3mk.mjs} +1 -1
- package/dist/admin/{App-DisCm99X.js → App-DLR2M3FT.js} +1 -1
- package/dist/admin/{License-DqDBPjZH.js → License-BZtjgFol.js} +1 -1
- package/dist/admin/{License-BjP7GvCt.mjs → License-W_NPUWIn.mjs} +1 -1
- package/dist/admin/{OnlineUsersWidget-Cm9O0Fjb.mjs → OnlineUsersWidget-BIbmzgLP.mjs} +1 -1
- package/dist/admin/{OnlineUsersWidget-DXdeGmfV.js → OnlineUsersWidget-CAdR0MfU.js} +1 -1
- package/dist/admin/{Settings-CnO501iu.mjs → Settings-BNu9EAuS.mjs} +10 -5
- package/dist/admin/{Settings-DoLec2MD.js → Settings-DWaflQdm.js} +10 -5
- package/dist/admin/{de-6rIvkYOp.mjs → de-4pAz-Ihh.mjs} +4 -3
- package/dist/admin/{de-DjP2WJ_V.js → de-jU7AaYIc.js} +4 -3
- package/dist/admin/{en-8hiv31Dv.mjs → en-BI_aBNXG.mjs} +4 -3
- package/dist/admin/{en-0pesBbOT.js → en-Tjp9AEhR.js} +4 -3
- package/dist/admin/{es-DdBRpF7F.js → es-BCgwFZPL.js} +4 -3
- package/dist/admin/{es-LRQ148f5.mjs → es-Bp4Uzf5h.mjs} +4 -3
- package/dist/admin/{fr-CKhx_qil.mjs → fr-B69qIjq2.mjs} +4 -3
- package/dist/admin/{fr-DJ6DbeDy.js → fr-Di5zo4wy.js} +4 -3
- package/dist/admin/{index-DJHhzin_.js → index-CBS3aqCW.js} +10 -10
- package/dist/admin/{index-CpMDG2XI.mjs → index-eSND7TDx.mjs} +10 -10
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/{pt-D0SMoAmo.js → pt-DlGYOi6D.js} +4 -3
- package/dist/admin/{pt-DXizUvcj.mjs → pt-Drc-di4D.mjs} +4 -3
- package/dist/server/index.js +151 -49
- package/dist/server/index.mjs +151 -49
- package/package.json +7 -7
- package/scripts/geoip-updater.cjs +39 -4
- package/scripts/update-geoip-db.mjs +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.7.0",
|
|
3
3
|
"keywords": [
|
|
4
4
|
"strapi",
|
|
5
5
|
"plugin",
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
"@semantic-release/changelog": "^6.0.3",
|
|
64
64
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
65
65
|
"@semantic-release/git": "^10.0.1",
|
|
66
|
-
"@semantic-release/github": "^12.0.
|
|
66
|
+
"@semantic-release/github": "^12.0.9",
|
|
67
67
|
"@semantic-release/npm": "^13.1.5",
|
|
68
68
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
69
|
-
"@strapi/design-system": "^2.2.
|
|
70
|
-
"@strapi/icons": "^2.2.
|
|
69
|
+
"@strapi/design-system": "^2.2.2",
|
|
70
|
+
"@strapi/icons": "^2.2.2",
|
|
71
71
|
"@strapi/sdk-plugin": "^6.1.1",
|
|
72
|
-
"@strapi/strapi": "^5.
|
|
72
|
+
"@strapi/strapi": "^5.50.1",
|
|
73
73
|
"esbuild": "^0.28.1",
|
|
74
|
-
"prettier": "^3.
|
|
74
|
+
"prettier": "^3.9.5",
|
|
75
75
|
"react": "^18.3.1",
|
|
76
76
|
"react-dom": "^18.3.1",
|
|
77
77
|
"react-intl": "^7.1.14",
|
|
78
78
|
"react-router-dom": "^6.30.4",
|
|
79
79
|
"semantic-release": "^25.0.5",
|
|
80
|
-
"styled-components": "^6.4.
|
|
80
|
+
"styled-components": "^6.4.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@strapi/design-system": "^2.0.0",
|
|
@@ -8,9 +8,33 @@ const { promisify } = require('node:util');
|
|
|
8
8
|
|
|
9
9
|
const gunzip = promisify(zlib.gunzip);
|
|
10
10
|
|
|
11
|
-
const DEFAULT_EDITION_ID = 'GeoLite2-
|
|
12
|
-
const DEFAULT_MMDB_NAME =
|
|
11
|
+
const DEFAULT_EDITION_ID = 'GeoLite2-City';
|
|
12
|
+
const DEFAULT_MMDB_NAME = `${DEFAULT_EDITION_ID}.mmdb`;
|
|
13
13
|
const DEFAULT_OUTPUT_PATH = path.resolve(process.cwd(), 'data', DEFAULT_MMDB_NAME);
|
|
14
|
+
const SUPPORTED_EDITION_IDS = new Set([
|
|
15
|
+
'GeoLite2-City',
|
|
16
|
+
'GeoLite2-Country',
|
|
17
|
+
'GeoIP2-City',
|
|
18
|
+
'GeoIP2-Country',
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
function normalizeEditionId(value, fallback = DEFAULT_EDITION_ID) {
|
|
22
|
+
return SUPPORTED_EDITION_IDS.has(value) ? value : fallback;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function inferEditionIdFromPath(filePath) {
|
|
26
|
+
if (typeof filePath !== 'string' || filePath.trim() === '') return '';
|
|
27
|
+
|
|
28
|
+
const basename = path.basename(filePath.trim());
|
|
29
|
+
if (/GeoIP2-City\.mmdb$/i.test(basename)) return 'GeoIP2-City';
|
|
30
|
+
if (/GeoIP2-Country\.mmdb$/i.test(basename)) return 'GeoIP2-Country';
|
|
31
|
+
if (/GeoLite2-City\.mmdb$/i.test(basename)) return 'GeoLite2-City';
|
|
32
|
+
if (/GeoLite2-Country\.mmdb$/i.test(basename)) return 'GeoLite2-Country';
|
|
33
|
+
if (/city/i.test(basename)) return 'GeoLite2-City';
|
|
34
|
+
if (/country/i.test(basename)) return 'GeoLite2-Country';
|
|
35
|
+
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
14
38
|
|
|
15
39
|
function buildDownloadUrl(editionId = DEFAULT_EDITION_ID) {
|
|
16
40
|
return `https://download.maxmind.com/geoip/databases/${encodeURIComponent(editionId)}/download?suffix=tar.gz`;
|
|
@@ -22,8 +46,18 @@ function buildBasicAuthHeader(accountId, licenseKey) {
|
|
|
22
46
|
|
|
23
47
|
function resolveConfig(env = process.env, argv = process.argv.slice(2), overrides = {}) {
|
|
24
48
|
const force = argv.includes('--force') || overrides.force === true;
|
|
25
|
-
const
|
|
26
|
-
|
|
49
|
+
const configuredOutputPath =
|
|
50
|
+
overrides.outputPath ||
|
|
51
|
+
env.MAGIC_SESSIONMANAGER_GEOIP_DATABASE ||
|
|
52
|
+
env.GEOIP_DATABASE_PATH ||
|
|
53
|
+
'';
|
|
54
|
+
const editionId = normalizeEditionId(
|
|
55
|
+
overrides.editionId ||
|
|
56
|
+
env.MAXMIND_EDITION_ID ||
|
|
57
|
+
inferEditionIdFromPath(configuredOutputPath) ||
|
|
58
|
+
DEFAULT_EDITION_ID
|
|
59
|
+
);
|
|
60
|
+
const outputPath = configuredOutputPath || path.resolve(process.cwd(), 'data', `${editionId}.mmdb`);
|
|
27
61
|
|
|
28
62
|
return {
|
|
29
63
|
accountId: overrides.accountId || env.MAXMIND_ACCOUNT_ID || env.MAXMIND_USER_ID || '',
|
|
@@ -213,6 +247,7 @@ module.exports = {
|
|
|
213
247
|
buildDownloadUrl,
|
|
214
248
|
extractMmdbFromTarGz,
|
|
215
249
|
fileExists,
|
|
250
|
+
inferEditionIdFromPath,
|
|
216
251
|
needsDownload,
|
|
217
252
|
readMetadata,
|
|
218
253
|
resolveConfig,
|
|
@@ -13,6 +13,7 @@ export const buildBasicAuthHeader = updater.buildBasicAuthHeader;
|
|
|
13
13
|
export const buildDownloadUrl = updater.buildDownloadUrl;
|
|
14
14
|
export const extractMmdbFromTarGz = updater.extractMmdbFromTarGz;
|
|
15
15
|
export const fileExists = updater.fileExists;
|
|
16
|
+
export const inferEditionIdFromPath = updater.inferEditionIdFromPath;
|
|
16
17
|
export const needsDownload = updater.needsDownload;
|
|
17
18
|
export const readMetadata = updater.readMetadata;
|
|
18
19
|
export const resolveConfig = updater.resolveConfig;
|