strapi-plugin-magic-mail 2.2.4 → 2.2.5

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 (70) hide show
  1. package/dist/server/index.js +1 -1
  2. package/dist/server/index.mjs +1 -1
  3. package/package.json +1 -3
  4. package/admin/jsconfig.json +0 -10
  5. package/admin/src/components/AddAccountModal.jsx +0 -1943
  6. package/admin/src/components/Initializer.jsx +0 -14
  7. package/admin/src/components/LicenseGuard.jsx +0 -475
  8. package/admin/src/components/PluginIcon.jsx +0 -5
  9. package/admin/src/hooks/useAuthRefresh.js +0 -44
  10. package/admin/src/hooks/useLicense.js +0 -158
  11. package/admin/src/index.js +0 -87
  12. package/admin/src/pages/Analytics.jsx +0 -762
  13. package/admin/src/pages/App.jsx +0 -111
  14. package/admin/src/pages/EmailDesigner/EditorPage.jsx +0 -1424
  15. package/admin/src/pages/EmailDesigner/TemplateList.jsx +0 -1807
  16. package/admin/src/pages/HomePage.jsx +0 -1170
  17. package/admin/src/pages/LicensePage.jsx +0 -430
  18. package/admin/src/pages/RoutingRules.jsx +0 -1141
  19. package/admin/src/pages/Settings.jsx +0 -603
  20. package/admin/src/pluginId.js +0 -3
  21. package/admin/src/translations/de.json +0 -71
  22. package/admin/src/translations/en.json +0 -70
  23. package/admin/src/translations/es.json +0 -71
  24. package/admin/src/translations/fr.json +0 -71
  25. package/admin/src/translations/pt.json +0 -71
  26. package/admin/src/utils/fetchWithRetry.js +0 -123
  27. package/admin/src/utils/getTranslation.js +0 -5
  28. package/admin/src/utils/theme.js +0 -85
  29. package/server/jsconfig.json +0 -10
  30. package/server/src/bootstrap.js +0 -157
  31. package/server/src/config/features.js +0 -260
  32. package/server/src/config/index.js +0 -9
  33. package/server/src/content-types/email-account/schema.json +0 -93
  34. package/server/src/content-types/email-event/index.js +0 -8
  35. package/server/src/content-types/email-event/schema.json +0 -57
  36. package/server/src/content-types/email-link/index.js +0 -8
  37. package/server/src/content-types/email-link/schema.json +0 -49
  38. package/server/src/content-types/email-log/index.js +0 -8
  39. package/server/src/content-types/email-log/schema.json +0 -106
  40. package/server/src/content-types/email-template/schema.json +0 -74
  41. package/server/src/content-types/email-template-version/schema.json +0 -60
  42. package/server/src/content-types/index.js +0 -33
  43. package/server/src/content-types/routing-rule/schema.json +0 -59
  44. package/server/src/controllers/accounts.js +0 -229
  45. package/server/src/controllers/analytics.js +0 -361
  46. package/server/src/controllers/controller.js +0 -26
  47. package/server/src/controllers/email-designer.js +0 -474
  48. package/server/src/controllers/index.js +0 -21
  49. package/server/src/controllers/license.js +0 -269
  50. package/server/src/controllers/oauth.js +0 -474
  51. package/server/src/controllers/routing-rules.js +0 -129
  52. package/server/src/controllers/test.js +0 -301
  53. package/server/src/destroy.js +0 -27
  54. package/server/src/index.js +0 -25
  55. package/server/src/middlewares/index.js +0 -3
  56. package/server/src/policies/index.js +0 -3
  57. package/server/src/register.js +0 -5
  58. package/server/src/routes/admin.js +0 -469
  59. package/server/src/routes/content-api.js +0 -37
  60. package/server/src/routes/index.js +0 -9
  61. package/server/src/services/account-manager.js +0 -329
  62. package/server/src/services/analytics.js +0 -512
  63. package/server/src/services/email-designer.js +0 -717
  64. package/server/src/services/email-router.js +0 -1446
  65. package/server/src/services/index.js +0 -17
  66. package/server/src/services/license-guard.js +0 -423
  67. package/server/src/services/oauth.js +0 -515
  68. package/server/src/services/service.js +0 -7
  69. package/server/src/utils/encryption.js +0 -81
  70. package/server/src/utils/logger.js +0 -84
@@ -1,469 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- type: 'admin',
5
- routes: [
6
- // Account Management
7
- {
8
- method: 'GET',
9
- path: '/accounts',
10
- handler: 'accounts.getAll',
11
- config: {
12
- policies: ['admin::isAuthenticatedAdmin'],
13
- description: 'Get all email accounts',
14
- },
15
- },
16
- {
17
- method: 'GET',
18
- path: '/accounts/:accountId',
19
- handler: 'accounts.getOne',
20
- config: {
21
- policies: ['admin::isAuthenticatedAdmin'],
22
- description: 'Get single email account with decrypted config',
23
- },
24
- },
25
- {
26
- method: 'POST',
27
- path: '/accounts',
28
- handler: 'accounts.create',
29
- config: {
30
- policies: [],
31
- auth: false,
32
- description: 'Create email account',
33
- },
34
- },
35
- {
36
- method: 'PUT',
37
- path: '/accounts/:accountId',
38
- handler: 'accounts.update',
39
- config: {
40
- policies: ['admin::isAuthenticatedAdmin'],
41
- description: 'Update email account',
42
- },
43
- },
44
- {
45
- method: 'POST',
46
- path: '/accounts/:accountId/test',
47
- handler: 'accounts.test',
48
- config: {
49
- policies: ['admin::isAuthenticatedAdmin'],
50
- description: 'Test email account',
51
- },
52
- },
53
- {
54
- method: 'POST',
55
- path: '/test-strapi-service',
56
- handler: 'accounts.testStrapiService',
57
- config: {
58
- policies: ['admin::isAuthenticatedAdmin'],
59
- description: 'Test Strapi Email Service integration (MagicMail intercept)',
60
- },
61
- },
62
- {
63
- method: 'DELETE',
64
- path: '/accounts/:accountId',
65
- handler: 'accounts.delete',
66
- config: {
67
- policies: ['admin::isAuthenticatedAdmin'],
68
- description: 'Delete email account',
69
- },
70
- },
71
- // Routing Rules
72
- {
73
- method: 'GET',
74
- path: '/routing-rules',
75
- handler: 'routingRules.getAll',
76
- config: {
77
- policies: ['admin::isAuthenticatedAdmin'],
78
- description: 'Get all routing rules',
79
- },
80
- },
81
- {
82
- method: 'GET',
83
- path: '/routing-rules/:ruleId',
84
- handler: 'routingRules.getOne',
85
- config: {
86
- policies: ['admin::isAuthenticatedAdmin'],
87
- description: 'Get single routing rule',
88
- },
89
- },
90
- {
91
- method: 'POST',
92
- path: '/routing-rules',
93
- handler: 'routingRules.create',
94
- config: {
95
- policies: ['admin::isAuthenticatedAdmin'],
96
- description: 'Create routing rule',
97
- },
98
- },
99
- {
100
- method: 'PUT',
101
- path: '/routing-rules/:ruleId',
102
- handler: 'routingRules.update',
103
- config: {
104
- policies: ['admin::isAuthenticatedAdmin'],
105
- description: 'Update routing rule',
106
- },
107
- },
108
- {
109
- method: 'DELETE',
110
- path: '/routing-rules/:ruleId',
111
- handler: 'routingRules.delete',
112
- config: {
113
- policies: ['admin::isAuthenticatedAdmin'],
114
- description: 'Delete routing rule',
115
- },
116
- },
117
- // OAuth Routes - Gmail
118
- {
119
- method: 'GET',
120
- path: '/oauth/gmail/auth',
121
- handler: 'oauth.gmailAuth',
122
- config: {
123
- policies: [],
124
- description: 'Initiate Gmail OAuth flow',
125
- },
126
- },
127
- {
128
- method: 'GET',
129
- path: '/oauth/gmail/callback',
130
- handler: 'oauth.gmailCallback',
131
- config: {
132
- auth: false, // Public callback
133
- description: 'Gmail OAuth callback',
134
- },
135
- },
136
- // OAuth Routes - Microsoft
137
- {
138
- method: 'GET',
139
- path: '/oauth/microsoft/auth',
140
- handler: 'oauth.microsoftAuth',
141
- config: {
142
- policies: [],
143
- description: 'Initiate Microsoft OAuth flow',
144
- },
145
- },
146
- {
147
- method: 'GET',
148
- path: '/oauth/microsoft/callback',
149
- handler: 'oauth.microsoftCallback',
150
- config: {
151
- auth: false, // Public callback
152
- description: 'Microsoft OAuth callback',
153
- },
154
- },
155
- // OAuth Routes - Yahoo
156
- {
157
- method: 'GET',
158
- path: '/oauth/yahoo/auth',
159
- handler: 'oauth.yahooAuth',
160
- config: {
161
- policies: [],
162
- description: 'Initiate Yahoo OAuth flow',
163
- },
164
- },
165
- {
166
- method: 'GET',
167
- path: '/oauth/yahoo/callback',
168
- handler: 'oauth.yahooCallback',
169
- config: {
170
- auth: false, // Public callback
171
- description: 'Yahoo OAuth callback',
172
- },
173
- },
174
- // OAuth Routes - Generic
175
- {
176
- method: 'POST',
177
- path: '/oauth/create-account',
178
- handler: 'oauth.createOAuthAccount',
179
- config: {
180
- policies: ['admin::isAuthenticatedAdmin'],
181
- description: 'Create account from OAuth',
182
- },
183
- },
184
- // License Routes
185
- {
186
- method: 'GET',
187
- path: '/license/status',
188
- handler: 'license.getStatus',
189
- config: {
190
- policies: ['admin::isAuthenticatedAdmin'],
191
- description: 'Get license status',
192
- },
193
- },
194
- {
195
- method: 'POST',
196
- path: '/license/auto-create',
197
- handler: 'license.autoCreate',
198
- config: {
199
- policies: ['admin::isAuthenticatedAdmin'],
200
- description: 'Auto-create license with admin user data',
201
- },
202
- },
203
- {
204
- method: 'POST',
205
- path: '/license/store-key',
206
- handler: 'license.storeKey',
207
- config: {
208
- policies: ['admin::isAuthenticatedAdmin'],
209
- description: 'Store and validate existing license key',
210
- },
211
- },
212
- {
213
- method: 'GET',
214
- path: '/license/limits',
215
- handler: 'license.getLimits',
216
- config: {
217
- policies: [],
218
- description: 'Get license limits and available features',
219
- },
220
- },
221
- {
222
- method: 'GET',
223
- path: '/license/debug',
224
- handler: 'license.debugLicense',
225
- config: {
226
- policies: [],
227
- description: 'Debug license data',
228
- },
229
- },
230
- // Email Designer Routes
231
- {
232
- method: 'GET',
233
- path: '/designer/templates',
234
- handler: 'emailDesigner.findAll',
235
- config: {
236
- policies: ['admin::isAuthenticatedAdmin'],
237
- description: 'Get all email templates',
238
- },
239
- },
240
- {
241
- method: 'GET',
242
- path: '/designer/templates/:id',
243
- handler: 'emailDesigner.findOne',
244
- config: {
245
- policies: ['admin::isAuthenticatedAdmin'],
246
- description: 'Get email template by ID',
247
- },
248
- },
249
- {
250
- method: 'POST',
251
- path: '/designer/templates',
252
- handler: 'emailDesigner.create',
253
- config: {
254
- policies: ['admin::isAuthenticatedAdmin'],
255
- description: 'Create email template',
256
- },
257
- },
258
- {
259
- method: 'PUT',
260
- path: '/designer/templates/:id',
261
- handler: 'emailDesigner.update',
262
- config: {
263
- policies: ['admin::isAuthenticatedAdmin'],
264
- description: 'Update email template',
265
- },
266
- },
267
- {
268
- method: 'DELETE',
269
- path: '/designer/templates/:id',
270
- handler: 'emailDesigner.delete',
271
- config: {
272
- policies: ['admin::isAuthenticatedAdmin'],
273
- description: 'Delete email template',
274
- },
275
- },
276
- {
277
- method: 'GET',
278
- path: '/designer/templates/:id/versions',
279
- handler: 'emailDesigner.getVersions',
280
- config: {
281
- policies: ['admin::isAuthenticatedAdmin'],
282
- description: 'Get template versions',
283
- },
284
- },
285
- {
286
- method: 'POST',
287
- path: '/designer/templates/:id/versions/:versionId/restore',
288
- handler: 'emailDesigner.restoreVersion',
289
- config: {
290
- policies: ['admin::isAuthenticatedAdmin'],
291
- description: 'Restore template from version',
292
- },
293
- },
294
- {
295
- method: 'POST',
296
- path: '/designer/templates/:id/versions/:versionId/delete',
297
- handler: 'emailDesigner.deleteVersion',
298
- config: {
299
- policies: ['admin::isAuthenticatedAdmin'],
300
- description: 'Delete a single version',
301
- },
302
- },
303
- {
304
- method: 'POST',
305
- path: '/designer/templates/:id/versions/delete-all',
306
- handler: 'emailDesigner.deleteAllVersions',
307
- config: {
308
- policies: ['admin::isAuthenticatedAdmin'],
309
- description: 'Delete all versions for a template',
310
- },
311
- },
312
- {
313
- method: 'POST',
314
- path: '/designer/render/:templateReferenceId',
315
- handler: 'emailDesigner.renderTemplate',
316
- config: {
317
- policies: ['admin::isAuthenticatedAdmin'],
318
- description: 'Render template with data',
319
- },
320
- },
321
- {
322
- method: 'POST',
323
- path: '/designer/export',
324
- handler: 'emailDesigner.exportTemplates',
325
- config: {
326
- policies: ['admin::isAuthenticatedAdmin'],
327
- description: 'Export templates (ADVANCED+)',
328
- },
329
- },
330
- {
331
- method: 'POST',
332
- path: '/designer/import',
333
- handler: 'emailDesigner.importTemplates',
334
- config: {
335
- policies: ['admin::isAuthenticatedAdmin'],
336
- description: 'Import templates (ADVANCED+)',
337
- },
338
- },
339
- {
340
- method: 'GET',
341
- path: '/designer/stats',
342
- handler: 'emailDesigner.getStats',
343
- config: {
344
- policies: ['admin::isAuthenticatedAdmin'],
345
- description: 'Get template statistics',
346
- },
347
- },
348
- {
349
- method: 'GET',
350
- path: '/designer/core/:coreEmailType',
351
- handler: 'emailDesigner.getCoreTemplate',
352
- config: {
353
- policies: ['admin::isAuthenticatedAdmin'],
354
- description: 'Get core email template',
355
- },
356
- },
357
- {
358
- method: 'PUT',
359
- path: '/designer/core/:coreEmailType',
360
- handler: 'emailDesigner.updateCoreTemplate',
361
- config: {
362
- policies: ['admin::isAuthenticatedAdmin'],
363
- description: 'Update core email template',
364
- },
365
- },
366
- {
367
- method: 'GET',
368
- path: '/designer/templates/:id/download',
369
- handler: 'emailDesigner.download',
370
- config: {
371
- policies: ['admin::isAuthenticatedAdmin'],
372
- description: 'Download template as HTML or JSON',
373
- },
374
- },
375
- {
376
- method: 'POST',
377
- path: '/designer/templates/:id/duplicate',
378
- handler: 'emailDesigner.duplicate',
379
- config: {
380
- policies: ['admin::isAuthenticatedAdmin'],
381
- description: 'Duplicate template',
382
- },
383
- },
384
- {
385
- method: 'POST',
386
- path: '/designer/templates/:id/test-send',
387
- handler: 'emailDesigner.testSend',
388
- config: {
389
- policies: ['admin::isAuthenticatedAdmin'],
390
- description: 'Send test email for template',
391
- },
392
- },
393
- // Analytics & Tracking
394
- {
395
- method: 'GET',
396
- path: '/analytics/stats',
397
- handler: 'analytics.getStats',
398
- config: {
399
- policies: ['admin::isAuthenticatedAdmin'],
400
- description: 'Get analytics statistics',
401
- },
402
- },
403
- {
404
- method: 'GET',
405
- path: '/analytics/emails',
406
- handler: 'analytics.getEmailLogs',
407
- config: {
408
- policies: ['admin::isAuthenticatedAdmin'],
409
- description: 'Get email logs',
410
- },
411
- },
412
- {
413
- method: 'GET',
414
- path: '/analytics/emails/:emailId',
415
- handler: 'analytics.getEmailDetails',
416
- config: {
417
- policies: ['admin::isAuthenticatedAdmin'],
418
- description: 'Get email details',
419
- },
420
- },
421
- {
422
- method: 'GET',
423
- path: '/analytics/users/:userId',
424
- handler: 'analytics.getUserActivity',
425
- config: {
426
- policies: ['admin::isAuthenticatedAdmin'],
427
- description: 'Get user email activity',
428
- },
429
- },
430
- {
431
- method: 'GET',
432
- path: '/analytics/debug',
433
- handler: 'analytics.debug',
434
- config: {
435
- policies: ['admin::isAuthenticatedAdmin'],
436
- description: 'Debug analytics state',
437
- },
438
- },
439
- {
440
- method: 'DELETE',
441
- path: '/analytics/emails/:emailId',
442
- handler: 'analytics.deleteEmailLog',
443
- config: {
444
- policies: ['admin::isAuthenticatedAdmin'],
445
- description: 'Delete single email log',
446
- },
447
- },
448
- {
449
- method: 'DELETE',
450
- path: '/analytics/emails',
451
- handler: 'analytics.clearAllEmailLogs',
452
- config: {
453
- policies: ['admin::isAuthenticatedAdmin'],
454
- description: 'Clear all email logs',
455
- },
456
- },
457
- // Test Routes (Development)
458
- {
459
- method: 'POST',
460
- path: '/test/relations',
461
- handler: 'test.testRelations',
462
- config: {
463
- policies: ['admin::isAuthenticatedAdmin'],
464
- description: 'Test template-version relations',
465
- },
466
- },
467
- ],
468
- };
469
-
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- type: 'content-api',
5
- routes: [
6
- {
7
- method: 'POST',
8
- path: '/send',
9
- handler: 'controller.send',
10
- config: {
11
- auth: false, // Can be called from anywhere
12
- description: 'Send email via MagicMail router',
13
- },
14
- },
15
- // Public tracking endpoints (no auth required!)
16
- {
17
- method: 'GET',
18
- path: '/track/open/:emailId/:recipientHash',
19
- handler: 'analytics.trackOpen',
20
- config: {
21
- policies: [],
22
- auth: false,
23
- description: 'Track email open (tracking pixel)',
24
- },
25
- },
26
- {
27
- method: 'GET',
28
- path: '/track/click/:emailId/:linkHash/:recipientHash',
29
- handler: 'analytics.trackClick',
30
- config: {
31
- policies: [],
32
- auth: false,
33
- description: 'Track link click and redirect',
34
- },
35
- },
36
- ],
37
- };
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- const admin = require('./admin');
4
- const contentApi = require('./content-api');
5
-
6
- module.exports = {
7
- admin,
8
- 'content-api': contentApi,
9
- };