strapi-plugin-magic-sessionmanager 4.2.4 → 4.2.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.
Files changed (62) hide show
  1. package/README.md +0 -2
  2. package/dist/server/index.js +1 -1
  3. package/dist/server/index.mjs +1 -1
  4. package/package.json +1 -3
  5. package/admin/jsconfig.json +0 -10
  6. package/admin/src/components/Initializer.jsx +0 -11
  7. package/admin/src/components/LicenseGuard.jsx +0 -591
  8. package/admin/src/components/OnlineUsersWidget.jsx +0 -212
  9. package/admin/src/components/PluginIcon.jsx +0 -8
  10. package/admin/src/components/SessionDetailModal.jsx +0 -449
  11. package/admin/src/components/SessionInfoCard.jsx +0 -151
  12. package/admin/src/components/SessionInfoPanel.jsx +0 -385
  13. package/admin/src/components/index.jsx +0 -5
  14. package/admin/src/hooks/useLicense.js +0 -103
  15. package/admin/src/index.js +0 -149
  16. package/admin/src/pages/ActiveSessions.jsx +0 -12
  17. package/admin/src/pages/Analytics.jsx +0 -735
  18. package/admin/src/pages/App.jsx +0 -12
  19. package/admin/src/pages/HomePage.jsx +0 -1212
  20. package/admin/src/pages/License.jsx +0 -603
  21. package/admin/src/pages/Settings.jsx +0 -1646
  22. package/admin/src/pages/SettingsNew.jsx +0 -1204
  23. package/admin/src/pages/UpgradePage.jsx +0 -448
  24. package/admin/src/pages/index.jsx +0 -3
  25. package/admin/src/pluginId.js +0 -4
  26. package/admin/src/translations/de.json +0 -299
  27. package/admin/src/translations/en.json +0 -299
  28. package/admin/src/translations/es.json +0 -287
  29. package/admin/src/translations/fr.json +0 -287
  30. package/admin/src/translations/pt.json +0 -287
  31. package/admin/src/utils/getTranslation.js +0 -5
  32. package/admin/src/utils/index.js +0 -2
  33. package/admin/src/utils/parseUserAgent.js +0 -79
  34. package/admin/src/utils/theme.js +0 -85
  35. package/server/jsconfig.json +0 -10
  36. package/server/src/bootstrap.js +0 -492
  37. package/server/src/config/index.js +0 -23
  38. package/server/src/content-types/index.js +0 -9
  39. package/server/src/content-types/session/schema.json +0 -84
  40. package/server/src/controllers/controller.js +0 -11
  41. package/server/src/controllers/index.js +0 -11
  42. package/server/src/controllers/license.js +0 -266
  43. package/server/src/controllers/session.js +0 -433
  44. package/server/src/controllers/settings.js +0 -122
  45. package/server/src/destroy.js +0 -22
  46. package/server/src/index.js +0 -23
  47. package/server/src/middlewares/index.js +0 -5
  48. package/server/src/middlewares/last-seen.js +0 -62
  49. package/server/src/policies/index.js +0 -3
  50. package/server/src/register.js +0 -36
  51. package/server/src/routes/admin.js +0 -149
  52. package/server/src/routes/content-api.js +0 -60
  53. package/server/src/routes/index.js +0 -9
  54. package/server/src/services/geolocation.js +0 -182
  55. package/server/src/services/index.js +0 -13
  56. package/server/src/services/license-guard.js +0 -316
  57. package/server/src/services/notifications.js +0 -319
  58. package/server/src/services/service.js +0 -7
  59. package/server/src/services/session.js +0 -393
  60. package/server/src/utils/encryption.js +0 -121
  61. package/server/src/utils/getClientIp.js +0 -118
  62. package/server/src/utils/logger.js +0 -84
@@ -1,149 +0,0 @@
1
- import pluginPkg from '../../package.json';
2
- import pluginId from './pluginId';
3
- import Initializer from './components/Initializer';
4
- import PluginIcon from './components/PluginIcon';
5
- import SessionInfoPanel from './components/SessionInfoPanel';
6
-
7
- // Manual fallback for prefixPluginTranslations if helper-plugin is not available
8
- const prefixPluginTranslations = (data, pluginId) => {
9
- const prefixed = {};
10
- Object.keys(data).forEach((key) => {
11
- prefixed[`${pluginId}.${key}`] = data[key];
12
- });
13
- return prefixed;
14
- };
15
-
16
- const name = pluginPkg.strapi.name;
17
-
18
- export default {
19
- register(app) {
20
- app.addMenuLink({
21
- to: `/plugins/${pluginId}`,
22
- icon: PluginIcon,
23
- intlLabel: {
24
- id: `${pluginId}.plugin.name`,
25
- defaultMessage: pluginPkg.strapi.displayName,
26
- },
27
- Component: () => import('./pages/App'),
28
- });
29
-
30
- app.createSettingSection(
31
- {
32
- intlLabel: { id: `${pluginId}.settings.section`, defaultMessage: 'Sessions' },
33
- id: pluginId,
34
- to: `/settings/${pluginId}`,
35
- },
36
- [
37
- {
38
- intlLabel: {
39
- id: `${pluginId}.settings.upgrade`,
40
- defaultMessage: 'Upgrade',
41
- },
42
- id: 'upgrade',
43
- to: `/settings/${pluginId}/upgrade`,
44
- Component: () => import('./pages/UpgradePage'),
45
- },
46
- {
47
- intlLabel: {
48
- id: `${pluginId}.settings.general`,
49
- defaultMessage: 'General',
50
- },
51
- id: 'general',
52
- to: `/settings/${pluginId}/general`,
53
- Component: () => import('./pages/Settings'),
54
- },
55
- {
56
- intlLabel: {
57
- id: `${pluginId}.settings.analytics`,
58
- defaultMessage: 'Analytics',
59
- },
60
- id: 'analytics',
61
- to: `/settings/${pluginId}/analytics`,
62
- Component: () => import('./pages/Analytics'),
63
- },
64
- {
65
- intlLabel: {
66
- id: `${pluginId}.settings.license`,
67
- defaultMessage: 'License',
68
- },
69
- id: 'license',
70
- to: `/settings/${pluginId}/license`,
71
- Component: () => import('./pages/License'),
72
- },
73
- ]
74
- );
75
-
76
- app.registerPlugin({
77
- id: pluginId,
78
- initializer: Initializer,
79
- isReady: true,
80
- name,
81
- });
82
-
83
- // Register Online Users Widget for Homepage (Strapi v5.13+)
84
- if ('widgets' in app) {
85
- app.widgets.register({
86
- icon: PluginIcon,
87
- title: {
88
- id: `${pluginId}.widget.online-users.title`,
89
- defaultMessage: 'Online Users',
90
- },
91
- component: async () => {
92
- const component = await import('./components/OnlineUsersWidget');
93
- return component.default;
94
- },
95
- id: 'online-users-widget',
96
- pluginId: pluginId,
97
- });
98
- console.log(`[${pluginId}] [SUCCESS] Online Users Widget registered`);
99
- }
100
- },
101
-
102
- bootstrap(app) {
103
- console.log(`[${pluginId}] Bootstrapping plugin...`);
104
-
105
- // Inject Session Info Panel into Content Manager edit view
106
- try {
107
- const contentManagerPlugin = app.getPlugin('content-manager');
108
- if (contentManagerPlugin && contentManagerPlugin.apis) {
109
- console.log(`[${pluginId}] Injecting SessionInfoPanel into edit view sidebar...`);
110
- contentManagerPlugin.apis.addEditViewSidePanel([SessionInfoPanel]);
111
- console.log(`[${pluginId}] [SUCCESS] SessionInfoPanel injected successfully`);
112
- } else {
113
- console.warn(`[${pluginId}] Content Manager plugin or APIs not available`);
114
- }
115
- } catch (error) {
116
- console.error(`[${pluginId}] Error injecting SessionInfoPanel:`, error);
117
- }
118
- },
119
-
120
- async registerTrads({ locales }) {
121
- const importedTrads = {
122
- en: () => import('./translations/en.json'),
123
- de: () => import('./translations/de.json'),
124
- es: () => import('./translations/es.json'),
125
- fr: () => import('./translations/fr.json'),
126
- pt: () => import('./translations/pt.json'),
127
- };
128
-
129
- const translatedLanguages = Object.keys(importedTrads).filter((lang) =>
130
- locales.includes(lang)
131
- );
132
-
133
- const translations = await Promise.all(
134
- translatedLanguages.map((language) =>
135
- importedTrads[language]()
136
- .then(({ default: data }) => ({
137
- data: prefixPluginTranslations(data, pluginId),
138
- locale: language,
139
- }))
140
- .catch(() => ({
141
- data: {},
142
- locale: language,
143
- }))
144
- )
145
- );
146
-
147
- return Promise.resolve(translations);
148
- },
149
- };
@@ -1,12 +0,0 @@
1
- import { Box } from '@strapi/design-system';
2
-
3
- const ActiveSessions = () => {
4
- return (
5
- <Box padding={8}>
6
- <h2>Active Sessions</h2>
7
- <p>This page displays all currently active user sessions in your Strapi instance.</p>
8
- </Box>
9
- );
10
- };
11
-
12
- export default ActiveSessions;