@strapi/admin 5.41.1 → 5.42.1

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 (52) hide show
  1. package/dist/admin/admin/src/StrapiApp.js +1 -0
  2. package/dist/admin/admin/src/StrapiApp.js.map +1 -1
  3. package/dist/admin/admin/src/StrapiApp.mjs +1 -0
  4. package/dist/admin/admin/src/StrapiApp.mjs.map +1 -1
  5. package/dist/admin/admin/src/components/FormInputs/Time.js +6 -1
  6. package/dist/admin/admin/src/components/FormInputs/Time.js.map +1 -1
  7. package/dist/admin/admin/src/components/FormInputs/Time.mjs +6 -1
  8. package/dist/admin/admin/src/components/FormInputs/Time.mjs.map +1 -1
  9. package/dist/admin/admin/src/features/Auth.js +16 -1
  10. package/dist/admin/admin/src/features/Auth.js.map +1 -1
  11. package/dist/admin/admin/src/features/Auth.mjs +16 -1
  12. package/dist/admin/admin/src/features/Auth.mjs.map +1 -1
  13. package/dist/admin/admin/src/features/Widgets.js +1 -1
  14. package/dist/admin/admin/src/features/Widgets.js.map +1 -1
  15. package/dist/admin/admin/src/features/Widgets.mjs +1 -1
  16. package/dist/admin/admin/src/features/Widgets.mjs.map +1 -1
  17. package/dist/admin/admin/src/pages/ProfilePage.js +2 -2
  18. package/dist/admin/admin/src/pages/ProfilePage.js.map +1 -1
  19. package/dist/admin/admin/src/pages/ProfilePage.mjs +2 -2
  20. package/dist/admin/admin/src/pages/ProfilePage.mjs.map +1 -1
  21. package/dist/admin/admin/src/pages/Settings/pages/Roles/utils/forms.js +1 -1
  22. package/dist/admin/admin/src/pages/Settings/pages/Roles/utils/forms.js.map +1 -1
  23. package/dist/admin/admin/src/pages/Settings/pages/Roles/utils/forms.mjs +1 -1
  24. package/dist/admin/admin/src/pages/Settings/pages/Roles/utils/forms.mjs.map +1 -1
  25. package/dist/admin/admin/src/pages/Settings/pages/TransferTokens/ListView.js +1 -1
  26. package/dist/admin/admin/src/pages/Settings/pages/TransferTokens/ListView.js.map +1 -1
  27. package/dist/admin/admin/src/pages/Settings/pages/TransferTokens/ListView.mjs +1 -1
  28. package/dist/admin/admin/src/pages/Settings/pages/TransferTokens/ListView.mjs.map +1 -1
  29. package/dist/admin/admin/src/translations/fi.json.js +890 -0
  30. package/dist/admin/admin/src/translations/fi.json.js.map +1 -0
  31. package/dist/admin/admin/src/translations/fi.json.mjs +868 -0
  32. package/dist/admin/admin/src/translations/fi.json.mjs.map +1 -0
  33. package/dist/admin/admin/src/translations/languageNativeNames.js +2 -1
  34. package/dist/admin/admin/src/translations/languageNativeNames.js.map +1 -1
  35. package/dist/admin/admin/src/translations/languageNativeNames.mjs +2 -1
  36. package/dist/admin/admin/src/translations/languageNativeNames.mjs.map +1 -1
  37. package/dist/admin/admin/src/translations/pl.json.js +411 -37
  38. package/dist/admin/admin/src/translations/pl.json.js.map +1 -1
  39. package/dist/admin/admin/src/translations/pl.json.mjs +408 -38
  40. package/dist/admin/admin/src/translations/pl.json.mjs.map +1 -1
  41. package/dist/admin/src/pages/Settings/pages/Roles/utils/forms.d.ts +1 -1
  42. package/dist/admin/src/translations/languageNativeNames.d.ts +1 -0
  43. package/dist/ee/server/src/audit-logs/services/lifecycles.d.ts +1 -1
  44. package/dist/server/ee/server/src/audit-logs/services/lifecycles.js +1 -1
  45. package/dist/server/ee/server/src/audit-logs/services/lifecycles.js.map +1 -1
  46. package/dist/server/ee/server/src/audit-logs/services/lifecycles.mjs +1 -1
  47. package/dist/server/ee/server/src/audit-logs/services/lifecycles.mjs.map +1 -1
  48. package/dist/server/ee/server/src/index.js +1 -1
  49. package/dist/server/ee/server/src/index.js.map +1 -1
  50. package/dist/server/ee/server/src/index.mjs +1 -1
  51. package/dist/server/ee/server/src/index.mjs.map +1 -1
  52. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"pl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -21,7 +21,7 @@ interface PropertyForm {
21
21
  properties: PropertyChildForm;
22
22
  }
23
23
  /**
24
- * Creates the default for for a content type
24
+ * Creates the default for a content type
25
25
  */
26
26
  declare const createDefaultCTForm: ({ subjects, actions }: ContentPermission, conditions: Condition[], initialPermissions?: Permission[]) => Form;
27
27
  export { createDefaultConditionsForm, createDefaultForm, createDefaultCTForm };
@@ -36,4 +36,5 @@ export declare const languageNativeNames: {
36
36
  readonly zh: "中文 (繁體)";
37
37
  readonly sa: "संस्कृत";
38
38
  readonly hi: "हिन्दी";
39
+ readonly fi: "Suomi";
39
40
  };
@@ -1,7 +1,7 @@
1
1
  import type { Core } from '@strapi/types';
2
2
  /**
3
3
  * @description
4
- * Manages the the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
4
+ * Manages the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
5
5
  */
6
6
  declare const createAuditLogsLifecycleService: (strapi: Core.Strapi) => {
7
7
  register(): Promise<any>;
@@ -56,7 +56,7 @@ const getRetentionDays = (strapi)=>{
56
56
  };
57
57
  /**
58
58
  * @description
59
- * Manages the the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
59
+ * Manages the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
60
60
  */ const createAuditLogsLifecycleService = (strapi)=>{
61
61
  // Manage internal service state privately
62
62
  const state = {};
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycles.js","sources":["../../../../../../../ee/server/src/audit-logs/services/lifecycles.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst DEFAULT_RETENTION_DAYS = 90;\n\nconst defaultEvents = [\n 'entry.create',\n 'entry.update',\n 'entry.delete',\n 'entry.publish',\n 'entry.unpublish',\n 'media.create',\n 'media.update',\n 'media.delete',\n 'media-folder.create',\n 'media-folder.update',\n 'media-folder.delete',\n 'user.create',\n 'user.update',\n 'user.delete',\n 'admin.auth.success',\n 'admin.logout',\n 'content-type.create',\n 'content-type.update',\n 'content-type.delete',\n 'component.create',\n 'component.update',\n 'component.delete',\n 'role.create',\n 'role.update',\n 'role.delete',\n 'permission.create',\n 'permission.update',\n 'permission.delete',\n];\n\nconst getEventMap = (defaultEvents: any) => {\n const getDefaultPayload = (...args: any) => args[0];\n\n // Use the default payload for all default events\n return defaultEvents.reduce((acc: any, event: any) => {\n acc[event] = getDefaultPayload;\n return acc;\n }, {} as any);\n};\n\nconst getRetentionDays = (strapi: Core.Strapi) => {\n const featureConfig = strapi.ee.features.get('audit-logs');\n const licenseRetentionDays =\n typeof featureConfig === 'object' && featureConfig?.options?.retentionDays;\n const userRetentionDays = strapi.config.get('admin.auditLogs.retentionDays');\n\n // For enterprise plans, use 90 days by default, but allow users to override it\n if (licenseRetentionDays == null) {\n return userRetentionDays ?? DEFAULT_RETENTION_DAYS;\n }\n\n // Allow users to override the license retention days, but not to increase it\n if (userRetentionDays && userRetentionDays <= licenseRetentionDays) {\n return userRetentionDays;\n }\n\n // User didn't provide a retention days value, use the license one\n return licenseRetentionDays;\n};\n\n/**\n * @description\n * Manages the the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')\n */\nconst createAuditLogsLifecycleService = (strapi: Core.Strapi) => {\n // Manage internal service state privately\n const state = {} as any;\n const auditLogsService = strapi.get('audit-logs');\n\n // NOTE: providers should be able to replace getEventMap to add or remove events\n const eventMap = getEventMap(defaultEvents);\n\n const processEvent = (name: string, ...args: any) => {\n const requestState = strapi.requestContext.get()?.state;\n\n // Ignore events with auth strategies different from admin\n const isUsingAdminAuth = requestState?.route.info.type === 'admin';\n const user = requestState?.user;\n if (!isUsingAdminAuth || !user) {\n return null;\n }\n\n const getPayload = eventMap[name];\n\n // Ignore the event if it's not in the map\n if (!getPayload) {\n return null;\n }\n\n // Ignore some events based on payload\n // TODO: What does this ignore in upload? Why would we want to ignore anything?\n const ignoredUids = ['plugin::upload.file', 'plugin::upload.folder'];\n if (ignoredUids.includes(args[0]?.uid)) {\n return null;\n }\n\n return {\n action: name,\n date: new Date().toISOString(),\n payload: getPayload(...args) || {},\n userId: user.id,\n };\n };\n\n const handleEvent = async (name: string, ...args: any) => {\n const processedEvent = processEvent(name, ...args);\n\n if (processedEvent) {\n await auditLogsService.saveEvent(processedEvent);\n }\n };\n\n return {\n async register() {\n // Handle license being enabled\n if (!state.eeEnableUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeEnableUnsubscribe = strapi.eventHub.on('ee.enable', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being updated\n if (!state.eeUpdateUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeUpdateUnsubscribe = strapi.eventHub.on('ee.update', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being disabled\n // @ts-expect-error- update event hub to receive callback argument\n state.eeDisableUnsubscribe = strapi.eventHub.on('ee.disable', () => {\n // Turn off service when the license gets disabled\n // Only ee.enable and ee.update listeners remain active to recreate the service\n this.destroy();\n });\n\n // Check current state of license\n if (!strapi.ee.features.isEnabled('audit-logs')) {\n return this;\n }\n\n // Start saving events\n state.eventHubUnsubscribe = strapi.eventHub.subscribe(handleEvent);\n\n // Manage audit logs auto deletion\n const retentionDays = getRetentionDays(strapi);\n\n strapi.cron.add({\n deleteExpiredAuditLogs: {\n task: async () => {\n const expirationDate = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);\n await auditLogsService.deleteExpiredEvents(expirationDate);\n },\n options: '0 0 * * *',\n },\n });\n\n return this;\n },\n\n unsubscribe() {\n if (state.eeDisableUnsubscribe) {\n state.eeDisableUnsubscribe();\n }\n\n if (state.eventHubUnsubscribe) {\n state.eventHubUnsubscribe();\n }\n\n strapi.cron.remove('deleteExpiredAuditLogs');\n\n return this;\n },\n\n destroy() {\n return this.unsubscribe();\n },\n };\n};\n\nexport { createAuditLogsLifecycleService };\n"],"names":["DEFAULT_RETENTION_DAYS","defaultEvents","getEventMap","getDefaultPayload","args","reduce","acc","event","getRetentionDays","strapi","featureConfig","ee","features","get","licenseRetentionDays","options","retentionDays","userRetentionDays","config","createAuditLogsLifecycleService","state","auditLogsService","eventMap","processEvent","name","requestState","requestContext","isUsingAdminAuth","route","info","type","user","getPayload","ignoredUids","includes","uid","action","date","Date","toISOString","payload","userId","id","handleEvent","processedEvent","saveEvent","register","eeEnableUnsubscribe","eventHub","on","destroy","eeUpdateUnsubscribe","eeDisableUnsubscribe","isEnabled","eventHubUnsubscribe","subscribe","cron","add","deleteExpiredAuditLogs","task","expirationDate","now","deleteExpiredEvents","unsubscribe","remove"],"mappings":";;AAEA,MAAMA,sBAAAA,GAAyB,EAAA;AAE/B,MAAMC,aAAAA,GAAgB;AACpB,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,eAAA;AACA,IAAA,iBAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,oBAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,kBAAA;AACA,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AA,GAAK,IAAA,CAAA;wBAC5E,MAAMK,gBAAAA,CAAiByC,mBAAmB,CAACF,cAAAA,CAAAA;AAC7C,oBAAA,CAAA;oBACA7C,OAAAA,EAAS;AACX;AACF,aAAA,CAAA;AAEA,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEAgD,QAAAA,WAAAA,CAAAA,GAAAA;YACE,IAAI3C,KAAAA,CAAMgC,oBAAoB,EAAE;AAC9BhC,gBAAAA,KAAAA,CAAMgC,oBAAoB,EAAA;AAC5B,YAAA;YAEA,IAAIhC,KAAAA,CAAMkC,mBAAmB,EAAE;AAC7BlC,gBAAAA,KAAAA,CAAMkC,mBAAmB,EAAA;AAC3B,YAAA;YAEA7C,MAAAA,CAAO+C,IAAI,CAACQ,MAAM,CAAC,wBAAA,CAAA;AAEnB,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEAd,QAAAA,OAAAA,CAAAA,GAAAA;YACE,OAAO,IAAI,CAACa,WAAW,EAAA;AACzB,QAAA;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"lifecycles.js","sources":["../../../../../../../ee/server/src/audit-logs/services/lifecycles.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst DEFAULT_RETENTION_DAYS = 90;\n\nconst defaultEvents = [\n 'entry.create',\n 'entry.update',\n 'entry.delete',\n 'entry.publish',\n 'entry.unpublish',\n 'media.create',\n 'media.update',\n 'media.delete',\n 'media-folder.create',\n 'media-folder.update',\n 'media-folder.delete',\n 'user.create',\n 'user.update',\n 'user.delete',\n 'admin.auth.success',\n 'admin.logout',\n 'content-type.create',\n 'content-type.update',\n 'content-type.delete',\n 'component.create',\n 'component.update',\n 'component.delete',\n 'role.create',\n 'role.update',\n 'role.delete',\n 'permission.create',\n 'permission.update',\n 'permission.delete',\n];\n\nconst getEventMap = (defaultEvents: any) => {\n const getDefaultPayload = (...args: any) => args[0];\n\n // Use the default payload for all default events\n return defaultEvents.reduce((acc: any, event: any) => {\n acc[event] = getDefaultPayload;\n return acc;\n }, {} as any);\n};\n\nconst getRetentionDays = (strapi: Core.Strapi) => {\n const featureConfig = strapi.ee.features.get('audit-logs');\n const licenseRetentionDays =\n typeof featureConfig === 'object' && featureConfig?.options?.retentionDays;\n const userRetentionDays = strapi.config.get('admin.auditLogs.retentionDays');\n\n // For enterprise plans, use 90 days by default, but allow users to override it\n if (licenseRetentionDays == null) {\n return userRetentionDays ?? DEFAULT_RETENTION_DAYS;\n }\n\n // Allow users to override the license retention days, but not to increase it\n if (userRetentionDays && userRetentionDays <= licenseRetentionDays) {\n return userRetentionDays;\n }\n\n // User didn't provide a retention days value, use the license one\n return licenseRetentionDays;\n};\n\n/**\n * @description\n * Manages the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')\n */\nconst createAuditLogsLifecycleService = (strapi: Core.Strapi) => {\n // Manage internal service state privately\n const state = {} as any;\n const auditLogsService = strapi.get('audit-logs');\n\n // NOTE: providers should be able to replace getEventMap to add or remove events\n const eventMap = getEventMap(defaultEvents);\n\n const processEvent = (name: string, ...args: any) => {\n const requestState = strapi.requestContext.get()?.state;\n\n // Ignore events with auth strategies different from admin\n const isUsingAdminAuth = requestState?.route.info.type === 'admin';\n const user = requestState?.user;\n if (!isUsingAdminAuth || !user) {\n return null;\n }\n\n const getPayload = eventMap[name];\n\n // Ignore the event if it's not in the map\n if (!getPayload) {\n return null;\n }\n\n // Ignore some events based on payload\n // TODO: What does this ignore in upload? Why would we want to ignore anything?\n const ignoredUids = ['plugin::upload.file', 'plugin::upload.folder'];\n if (ignoredUids.includes(args[0]?.uid)) {\n return null;\n }\n\n return {\n action: name,\n date: new Date().toISOString(),\n payload: getPayload(...args) || {},\n userId: user.id,\n };\n };\n\n const handleEvent = async (name: string, ...args: any) => {\n const processedEvent = processEvent(name, ...args);\n\n if (processedEvent) {\n await auditLogsService.saveEvent(processedEvent);\n }\n };\n\n return {\n async register() {\n // Handle license being enabled\n if (!state.eeEnableUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeEnableUnsubscribe = strapi.eventHub.on('ee.enable', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being updated\n if (!state.eeUpdateUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeUpdateUnsubscribe = strapi.eventHub.on('ee.update', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being disabled\n // @ts-expect-error- update event hub to receive callback argument\n state.eeDisableUnsubscribe = strapi.eventHub.on('ee.disable', () => {\n // Turn off service when the license gets disabled\n // Only ee.enable and ee.update listeners remain active to recreate the service\n this.destroy();\n });\n\n // Check current state of license\n if (!strapi.ee.features.isEnabled('audit-logs')) {\n return this;\n }\n\n // Start saving events\n state.eventHubUnsubscribe = strapi.eventHub.subscribe(handleEvent);\n\n // Manage audit logs auto deletion\n const retentionDays = getRetentionDays(strapi);\n\n strapi.cron.add({\n deleteExpiredAuditLogs: {\n task: async () => {\n const expirationDate = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);\n await auditLogsService.deleteExpiredEvents(expirationDate);\n },\n options: '0 0 * * *',\n },\n });\n\n return this;\n },\n\n unsubscribe() {\n if (state.eeDisableUnsubscribe) {\n state.eeDisableUnsubscribe();\n }\n\n if (state.eventHubUnsubscribe) {\n state.eventHubUnsubscribe();\n }\n\n strapi.cron.remove('deleteExpiredAuditLogs');\n\n return this;\n },\n\n destroy() {\n return this.unsubscribe();\n },\n };\n};\n\nexport { createAuditLogsLifecycleService };\n"],"names":["DEFAULT_RETENTION_DAYS","defaultEvents","getEventMap","getDefaultPayload","args","reduce","acc","event","getRetentionDays","strapi","featureConfig","ee","features","get","licenseRetentionDays","options","retentionDays","userRetentionDays","config","createAuditLogsLifecycleService","state","auditLogsService","eventMap","processEvent","name","requestState","requestContext","isUsingAdminAuth","route","info","type","user","getPayload","ignoredUids","includes","uid","action","date","Date","toISOString","payload","userId","id","handleEvent","processedEvent","saveEvent","register","eeEnableUnsubscribe","eventHub","on","destroy","eeUpdateUnsubscribe","eeDisableUnsubscribe","isEnabled","eventHubUnsubscribe","subscribe","cron","add","deleteExpiredAuditLogs","task","expirationDate","now","deleteExpiredEvents","unsubscribe","remove"],"mappings":";;AAEA,MAAMA,sBAAAA,GAAyB,EAAA;AAE/B,MAAMC,aAAAA,GAAgB;AACpB,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,eAAA;AACA,IAAA,iBAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,oBAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,kBAAA;AACA,IAAA,kBAAA;AACA,IAAA,kBAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA;AACD,CAAA;AAED,MAAMC,cAAc,CAACD,aAAAA,GAAAA;AACnB,IAAA,MAAME,oBAAoB,CAAC,GAAGC,IAAAA,GAAcA,IAAI,CAAC,CAAA,CAAE;;AAGnD,IAAA,OAAOH,aAAAA,CAAcI,MAAM,CAAC,CAACC,GAAAA,EAAUC,KAAAA,GAAAA;QACrCD,GAAG,CAACC,MAAM,GAAGJ,iBAAAA;QACb,OAAOG,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN,CAAA;AAEA,MAAME,mBAAmB,CAACC,MAAAA,GAAAA;AACxB,IAAA,MAAMC,gBAAgBD,MAAAA,CAAOE,EAAE,CAACC,QAAQ,CAACC,GAAG,CAAC,YAAA,CAAA;AAC7C,IAAA,MAAMC,oBAAAA,GACJ,OAAOJ,aAAAA,KAAkB,QAAA,IAAYA,eAAe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+54,7 @@ const getRetentionDays = (strapi)=>{
54
54
  };
55
55
  /**
56
56
  * @description
57
- * Manages the the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
57
+ * Manages the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')
58
58
  */ const createAuditLogsLifecycleService = (strapi)=>{
59
59
  // Manage internal service state privately
60
60
  const state = {};
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycles.mjs","sources":["../../../../../../../ee/server/src/audit-logs/services/lifecycles.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst DEFAULT_RETENTION_DAYS = 90;\n\nconst defaultEvents = [\n 'entry.create',\n 'entry.update',\n 'entry.delete',\n 'entry.publish',\n 'entry.unpublish',\n 'media.create',\n 'media.update',\n 'media.delete',\n 'media-folder.create',\n 'media-folder.update',\n 'media-folder.delete',\n 'user.create',\n 'user.update',\n 'user.delete',\n 'admin.auth.success',\n 'admin.logout',\n 'content-type.create',\n 'content-type.update',\n 'content-type.delete',\n 'component.create',\n 'component.update',\n 'component.delete',\n 'role.create',\n 'role.update',\n 'role.delete',\n 'permission.create',\n 'permission.update',\n 'permission.delete',\n];\n\nconst getEventMap = (defaultEvents: any) => {\n const getDefaultPayload = (...args: any) => args[0];\n\n // Use the default payload for all default events\n return defaultEvents.reduce((acc: any, event: any) => {\n acc[event] = getDefaultPayload;\n return acc;\n }, {} as any);\n};\n\nconst getRetentionDays = (strapi: Core.Strapi) => {\n const featureConfig = strapi.ee.features.get('audit-logs');\n const licenseRetentionDays =\n typeof featureConfig === 'object' && featureConfig?.options?.retentionDays;\n const userRetentionDays = strapi.config.get('admin.auditLogs.retentionDays');\n\n // For enterprise plans, use 90 days by default, but allow users to override it\n if (licenseRetentionDays == null) {\n return userRetentionDays ?? DEFAULT_RETENTION_DAYS;\n }\n\n // Allow users to override the license retention days, but not to increase it\n if (userRetentionDays && userRetentionDays <= licenseRetentionDays) {\n return userRetentionDays;\n }\n\n // User didn't provide a retention days value, use the license one\n return licenseRetentionDays;\n};\n\n/**\n * @description\n * Manages the the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')\n */\nconst createAuditLogsLifecycleService = (strapi: Core.Strapi) => {\n // Manage internal service state privately\n const state = {} as any;\n const auditLogsService = strapi.get('audit-logs');\n\n // NOTE: providers should be able to replace getEventMap to add or remove events\n const eventMap = getEventMap(defaultEvents);\n\n const processEvent = (name: string, ...args: any) => {\n const requestState = strapi.requestContext.get()?.state;\n\n // Ignore events with auth strategies different from admin\n const isUsingAdminAuth = requestState?.route.info.type === 'admin';\n const user = requestState?.user;\n if (!isUsingAdminAuth || !user) {\n return null;\n }\n\n const getPayload = eventMap[name];\n\n // Ignore the event if it's not in the map\n if (!getPayload) {\n return null;\n }\n\n // Ignore some events based on payload\n // TODO: What does this ignore in upload? Why would we want to ignore anything?\n const ignoredUids = ['plugin::upload.file', 'plugin::upload.folder'];\n if (ignoredUids.includes(args[0]?.uid)) {\n return null;\n }\n\n return {\n action: name,\n date: new Date().toISOString(),\n payload: getPayload(...args) || {},\n userId: user.id,\n };\n };\n\n const handleEvent = async (name: string, ...args: any) => {\n const processedEvent = processEvent(name, ...args);\n\n if (processedEvent) {\n await auditLogsService.saveEvent(processedEvent);\n }\n };\n\n return {\n async register() {\n // Handle license being enabled\n if (!state.eeEnableUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeEnableUnsubscribe = strapi.eventHub.on('ee.enable', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being updated\n if (!state.eeUpdateUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeUpdateUnsubscribe = strapi.eventHub.on('ee.update', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being disabled\n // @ts-expect-error- update event hub to receive callback argument\n state.eeDisableUnsubscribe = strapi.eventHub.on('ee.disable', () => {\n // Turn off service when the license gets disabled\n // Only ee.enable and ee.update listeners remain active to recreate the service\n this.destroy();\n });\n\n // Check current state of license\n if (!strapi.ee.features.isEnabled('audit-logs')) {\n return this;\n }\n\n // Start saving events\n state.eventHubUnsubscribe = strapi.eventHub.subscribe(handleEvent);\n\n // Manage audit logs auto deletion\n const retentionDays = getRetentionDays(strapi);\n\n strapi.cron.add({\n deleteExpiredAuditLogs: {\n task: async () => {\n const expirationDate = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);\n await auditLogsService.deleteExpiredEvents(expirationDate);\n },\n options: '0 0 * * *',\n },\n });\n\n return this;\n },\n\n unsubscribe() {\n if (state.eeDisableUnsubscribe) {\n state.eeDisableUnsubscribe();\n }\n\n if (state.eventHubUnsubscribe) {\n state.eventHubUnsubscribe();\n }\n\n strapi.cron.remove('deleteExpiredAuditLogs');\n\n return this;\n },\n\n destroy() {\n return this.unsubscribe();\n },\n };\n};\n\nexport { createAuditLogsLifecycleService };\n"],"names":["DEFAULT_RETENTION_DAYS","defaultEvents","getEventMap","getDefaultPayload","args","reduce","acc","event","getRetentionDays","strapi","featureConfig","ee","features","get","licenseRetentionDays","options","retentionDays","userRetentionDays","config","createAuditLogsLifecycleService","state","auditLogsService","eventMap","processEvent","name","requestState","requestContext","isUsingAdminAuth","route","info","type","user","getPayload","ignoredUids","includes","uid","action","date","Date","toISOString","payload","userId","id","handleEvent","processedEvent","saveEvent","register","eeEnableUnsubscribe","eventHub","on","destroy","eeUpdateUnsubscribe","eeDisableUnsubscribe","isEnabled","eventHubUnsubscribe","subscribe","cron","add","deleteExpiredAuditLogs","task","expirationDate","now","deleteExpiredEvents","unsubscribe","remove"],"mappings":"AAEA,MAAMA,sBAAAA,GAAyB,EAAA;AAE/B,MAAMC,aAAAA,GAAgB;AACpB,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,eAAA;AACA,IAAA,iBAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA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AC;gBACdC,sBAAAA,EAAwB;oBACtBC,IAAAA,EAAM,UAAA;wBACJ,MAAMC,cAAAA,GAAiB,IAAItB,IAAAA,CAAKA,IAAAA,CAAKuB,GAAG,EAAA,GAAK7C,aAAAA,GAAgB,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,IAAA,CAAA;wBAC5E,MAAMK,gBAAAA,CAAiByC,mBAAmB,CAACF,cAAAA,CAAAA;AAC7C,oBAAA,CAAA;oBACA7C,OAAAA,EAAS;AACX;AACF,aAAA,CAAA;AAEA,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEAgD,QAAAA,WAAAA,CAAAA,GAAAA;YACE,IAAI3C,KAAAA,CAAMgC,oBAAoB,EAAE;AAC9BhC,gBAAAA,KAAAA,CAAMgC,oBAAoB,EAAA;AAC5B,YAAA;YAEA,IAAIhC,KAAAA,CAAMkC,mBAAmB,EAAE;AAC7BlC,gBAAAA,KAAAA,CAAMkC,mBAAmB,EAAA;AAC3B,YAAA;YAEA7C,MAAAA,CAAO+C,IAAI,CAACQ,MAAM,CAAC,wBAAA,CAAA;AAEnB,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEAd,QAAAA,OAAAA,CAAAA,GAAAA;YACE,OAAO,IAAI,CAACa,WAAW,EAAA;AACzB,QAAA;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"lifecycles.mjs","sources":["../../../../../../../ee/server/src/audit-logs/services/lifecycles.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nconst DEFAULT_RETENTION_DAYS = 90;\n\nconst defaultEvents = [\n 'entry.create',\n 'entry.update',\n 'entry.delete',\n 'entry.publish',\n 'entry.unpublish',\n 'media.create',\n 'media.update',\n 'media.delete',\n 'media-folder.create',\n 'media-folder.update',\n 'media-folder.delete',\n 'user.create',\n 'user.update',\n 'user.delete',\n 'admin.auth.success',\n 'admin.logout',\n 'content-type.create',\n 'content-type.update',\n 'content-type.delete',\n 'component.create',\n 'component.update',\n 'component.delete',\n 'role.create',\n 'role.update',\n 'role.delete',\n 'permission.create',\n 'permission.update',\n 'permission.delete',\n];\n\nconst getEventMap = (defaultEvents: any) => {\n const getDefaultPayload = (...args: any) => args[0];\n\n // Use the default payload for all default events\n return defaultEvents.reduce((acc: any, event: any) => {\n acc[event] = getDefaultPayload;\n return acc;\n }, {} as any);\n};\n\nconst getRetentionDays = (strapi: Core.Strapi) => {\n const featureConfig = strapi.ee.features.get('audit-logs');\n const licenseRetentionDays =\n typeof featureConfig === 'object' && featureConfig?.options?.retentionDays;\n const userRetentionDays = strapi.config.get('admin.auditLogs.retentionDays');\n\n // For enterprise plans, use 90 days by default, but allow users to override it\n if (licenseRetentionDays == null) {\n return userRetentionDays ?? DEFAULT_RETENTION_DAYS;\n }\n\n // Allow users to override the license retention days, but not to increase it\n if (userRetentionDays && userRetentionDays <= licenseRetentionDays) {\n return userRetentionDays;\n }\n\n // User didn't provide a retention days value, use the license one\n return licenseRetentionDays;\n};\n\n/**\n * @description\n * Manages the lifecycle of audit logs. Accessible via strapi.get('audit-logs-lifecycles')\n */\nconst createAuditLogsLifecycleService = (strapi: Core.Strapi) => {\n // Manage internal service state privately\n const state = {} as any;\n const auditLogsService = strapi.get('audit-logs');\n\n // NOTE: providers should be able to replace getEventMap to add or remove events\n const eventMap = getEventMap(defaultEvents);\n\n const processEvent = (name: string, ...args: any) => {\n const requestState = strapi.requestContext.get()?.state;\n\n // Ignore events with auth strategies different from admin\n const isUsingAdminAuth = requestState?.route.info.type === 'admin';\n const user = requestState?.user;\n if (!isUsingAdminAuth || !user) {\n return null;\n }\n\n const getPayload = eventMap[name];\n\n // Ignore the event if it's not in the map\n if (!getPayload) {\n return null;\n }\n\n // Ignore some events based on payload\n // TODO: What does this ignore in upload? Why would we want to ignore anything?\n const ignoredUids = ['plugin::upload.file', 'plugin::upload.folder'];\n if (ignoredUids.includes(args[0]?.uid)) {\n return null;\n }\n\n return {\n action: name,\n date: new Date().toISOString(),\n payload: getPayload(...args) || {},\n userId: user.id,\n };\n };\n\n const handleEvent = async (name: string, ...args: any) => {\n const processedEvent = processEvent(name, ...args);\n\n if (processedEvent) {\n await auditLogsService.saveEvent(processedEvent);\n }\n };\n\n return {\n async register() {\n // Handle license being enabled\n if (!state.eeEnableUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeEnableUnsubscribe = strapi.eventHub.on('ee.enable', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being updated\n if (!state.eeUpdateUnsubscribe) {\n // @ts-expect-error- update event hub to receive callback argument\n state.eeUpdateUnsubscribe = strapi.eventHub.on('ee.update', () => {\n // Recreate the service to use the new license info\n this.destroy();\n this.register();\n });\n }\n\n // Handle license being disabled\n // @ts-expect-error- update event hub to receive callback argument\n state.eeDisableUnsubscribe = strapi.eventHub.on('ee.disable', () => {\n // Turn off service when the license gets disabled\n // Only ee.enable and ee.update listeners remain active to recreate the service\n this.destroy();\n });\n\n // Check current state of license\n if (!strapi.ee.features.isEnabled('audit-logs')) {\n return this;\n }\n\n // Start saving events\n state.eventHubUnsubscribe = strapi.eventHub.subscribe(handleEvent);\n\n // Manage audit logs auto deletion\n const retentionDays = getRetentionDays(strapi);\n\n strapi.cron.add({\n deleteExpiredAuditLogs: {\n task: async () => {\n const expirationDate = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);\n await auditLogsService.deleteExpiredEvents(expirationDate);\n },\n options: '0 0 * * *',\n },\n });\n\n return this;\n },\n\n unsubscribe() {\n if (state.eeDisableUnsubscribe) {\n state.eeDisableUnsubscribe();\n }\n\n if (state.eventHubUnsubscribe) {\n state.eventHubUnsubscribe();\n }\n\n strapi.cron.remove('deleteExpiredAuditLogs');\n\n return this;\n },\n\n destroy() {\n return this.unsubscribe();\n },\n };\n};\n\nexport { createAuditLogsLifecycleService };\n"],"names":["DEFAULT_RETENTION_DAYS","defaultEvents","getEventMap","getDefaultPayload","args","reduce","acc","event","getRetentionDays","strapi","featureConfig","ee","features","get","licenseRetentionDays","options","retentionDays","userRetentionDays","config","createAuditLogsLifecycleService","state","auditLogsService","eventMap","processEvent","name","requestState","requestContext","isUsingAdminAuth","route","info","type","user","getPayload","ignoredUids","includes","uid","action","date","Date","toISOString","payload","userId","id","handleEvent","processedEvent","saveEvent","register","eeEnableUnsubscribe","eventHub","on","destroy","eeUpdateUnsubscribe","eeDisableUnsubscribe","isEnabled","eventHubUnsubscribe","subscribe","cron","add","deleteExpiredAuditLogs","task","expirationDate","now","deleteExpiredEvents","unsubscribe","remove"],"mappings":"AAEA,MAAMA,sBAAAA,GAAyB,EAAA;AAE/B,MAAMC,aAAAA,GAAgB;AACpB,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,eAAA;AACA,IAAA,iBAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,oBAAA;AACA,IAAA,cAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,qBAAA;AACA,IAAA,kBAAA;AACA,IAAA,kBAAA;AACA,IAAA,kBAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA;AACD,CAAA;AAED,MAAMC,cAAc,CAACD,aAAAA,GAAAA;AACnB,IAAA,MAAME,oBAAoB,CAAC,GAAGC,IAAAA,GAAcA,IAAI,CAAC,CAAA,CAAE;;AAGnD,IAAA,OAAOH,aAAAA,CAAcI,MAAM,CAAC,CAACC,GAAAA,EAAUC,KAAAA,GAAAA;QACrCD,GAAG,CAACC,MAAM,GAAGJ,iBAAAA;QACb,OAAOG,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN,CAAA;AAEA,MAAME,mBAAmB,CAACC,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MAAM,CAAC,wBAAA,CAAA;AAEnB,YAAA,OAAO,IAAI;AACb,QAAA,CAAA;AAEAd,QAAAA,OAAAA,CAAAA,GAAAA;YACE,OAAO,IAAI,CAACa,WAAW,EAAA;AACzB,QAAA;AACF,KAAA;AACF;;;;"}
@@ -53,7 +53,7 @@ const getAdminEE = ()=>{
53
53
  } : {}
54
54
  },
55
55
  async register ({ strapi: strapi1 }) {
56
- // Run the the default registration
56
+ // Run the default registration
57
57
  await eeAdmin.register({
58
58
  strapi: strapi1
59
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../ee/server/src/index.ts"],"sourcesContent":["import register from './register';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport adminContentTypes from './content-types';\nimport services from './services';\nimport controllers from './controllers';\nimport routes from './routes';\nimport auditLogsRoutes from './audit-logs/routes/audit-logs';\nimport auditLogsController from './audit-logs/controllers/audit-logs';\nimport { createAuditLogsService } from './audit-logs/services/audit-logs';\nimport { createAuditLogsLifecycleService } from './audit-logs/services/lifecycles';\nimport { auditLog } from './audit-logs/content-types/audit-log';\nimport aiRoutes from './ai/routes/ai';\nimport aiController from './ai/controllers/ai';\nimport type { Core } from '@strapi/types';\nimport { createAIContainer } from './ai/containers/ai';\n\nconst getAdminEE = () => {\n const eeAdmin = {\n register,\n bootstrap,\n destroy,\n contentTypes: {\n // Always register the audit-log content type to prevent data loss\n 'audit-log': auditLog,\n ...adminContentTypes,\n },\n services,\n controllers,\n routes,\n };\n\n const isAIEnabled =\n strapi.config.get('admin.ai.enabled', true) && strapi.ee.features.isEnabled('cms-ai');\n\n const isAuditLogsEnabled =\n strapi.config.get('admin.auditLogs.enabled', true) &&\n strapi.ee.features.isEnabled('audit-logs');\n return {\n ...eeAdmin,\n controllers: {\n ...eeAdmin.controllers,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsController } : {}),\n ...(isAIEnabled ? { ai: aiController } : {}),\n },\n routes: {\n ...eeAdmin.routes,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsRoutes } : {}),\n ...(isAIEnabled ? { ai: aiRoutes } : {}),\n },\n async register({ strapi }: { strapi: Core.Strapi }) {\n // Run the the default registration\n await eeAdmin.register({ strapi });\n\n // Register internal ai service\n if (isAIEnabled) {\n strapi.add('ai', createAIContainer({ strapi }));\n }\n\n if (isAuditLogsEnabled) {\n // Register an internal audit logs service\n strapi.add('audit-logs', createAuditLogsService(strapi));\n // Register an internal audit logs lifecycle service\n const auditLogsLifecycle = createAuditLogsLifecycleService(strapi);\n strapi.add('audit-logs-lifecycle', auditLogsLifecycle);\n\n await auditLogsLifecycle.register();\n }\n },\n async destroy({ strapi }: { strapi: Core.Strapi }) {\n if (isAuditLogsEnabled) {\n strapi.get('audit-logs-lifecycle').destroy();\n }\n await eeAdmin.destroy({ strapi });\n },\n };\n};\n\nexport default getAdminEE;\n"],"names":["getAdminEE","eeAdmin","register","bootstrap","destroy","contentTypes","auditLog","adminContentTypes","services","controllers","routes","isAIEnabled","strapi","config","get","ee","features","isEnabled","isAuditLogsEnabled","auditLogsController","ai","aiController","auditLogsRoutes","aiRoutes","add","createAIContainer","createAuditLogsService","auditLogsLifecycle","createAuditLogsLifecycleService"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAMA,UAAAA,GAAa,IAAA;AACjB,IAAA,MAAMC,OAAAA,GAAU;AACdC,QAAAA,QAAAA;AACAC,QAAAA,SAAAA;AACAC,QAAAA,OAAAA;QACAC,YAAAA,EAAc;;YAEZ,WAAA,EAAaC,iBAAAA;AACb,YAAA,GAAGC;AACL,SAAA;AACAC,kBAAAA,OAAAA;AACAC,qBAAAA,OAAAA;AACAC,gBAAAA;AACF,KAAA;AAEA,IAAA,MAAMC,WAAAA,GACJC,MAAAA,CAAOC,MAAM,CAACC,GAAG,CAAC,kBAAA,EAAoB,IAAA,CAAA,IAASF,MAAAA,CAAOG,EAAE,CAACC,QAAQ,CAACC,SAAS,CAAC,QAAA,CAAA;AAE9E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A,MAAMA,mBAAmBzB,QAAQ,EAAA;AACnC,YAAA;AACF,QAAA,CAAA;AACA,QAAA,MAAME,OAAAA,CAAAA,CAAQ,EAAEQ,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AAC/C,YAAA,IAAIM,kBAAAA,EAAoB;gBACtBN,OAAAA,CAAOE,GAAG,CAAC,sBAAA,CAAA,CAAwBV,OAAO,EAAA;AAC5C,YAAA;YACA,MAAMH,OAAAA,CAAQG,OAAO,CAAC;gBAAEQ,MAAAA,EAAAA;AAAO,aAAA,CAAA;AACjC,QAAA;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../ee/server/src/index.ts"],"sourcesContent":["import register from './register';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport adminContentTypes from './content-types';\nimport services from './services';\nimport controllers from './controllers';\nimport routes from './routes';\nimport auditLogsRoutes from './audit-logs/routes/audit-logs';\nimport auditLogsController from './audit-logs/controllers/audit-logs';\nimport { createAuditLogsService } from './audit-logs/services/audit-logs';\nimport { createAuditLogsLifecycleService } from './audit-logs/services/lifecycles';\nimport { auditLog } from './audit-logs/content-types/audit-log';\nimport aiRoutes from './ai/routes/ai';\nimport aiController from './ai/controllers/ai';\nimport type { Core } from '@strapi/types';\nimport { createAIContainer } from './ai/containers/ai';\n\nconst getAdminEE = () => {\n const eeAdmin = {\n register,\n bootstrap,\n destroy,\n contentTypes: {\n // Always register the audit-log content type to prevent data loss\n 'audit-log': auditLog,\n ...adminContentTypes,\n },\n services,\n controllers,\n routes,\n };\n\n const isAIEnabled =\n strapi.config.get('admin.ai.enabled', true) && strapi.ee.features.isEnabled('cms-ai');\n\n const isAuditLogsEnabled =\n strapi.config.get('admin.auditLogs.enabled', true) &&\n strapi.ee.features.isEnabled('audit-logs');\n return {\n ...eeAdmin,\n controllers: {\n ...eeAdmin.controllers,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsController } : {}),\n ...(isAIEnabled ? { ai: aiController } : {}),\n },\n routes: {\n ...eeAdmin.routes,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsRoutes } : {}),\n ...(isAIEnabled ? { ai: aiRoutes } : {}),\n },\n async register({ strapi }: { strapi: Core.Strapi }) {\n // Run the default registration\n await eeAdmin.register({ strapi });\n\n // Register internal ai service\n if (isAIEnabled) {\n strapi.add('ai', createAIContainer({ strapi }));\n }\n\n if (isAuditLogsEnabled) {\n // Register an internal audit logs service\n strapi.add('audit-logs', createAuditLogsService(strapi));\n // Register an internal audit logs lifecycle service\n const auditLogsLifecycle = createAuditLogsLifecycleService(strapi);\n strapi.add('audit-logs-lifecycle', auditLogsLifecycle);\n\n await auditLogsLifecycle.register();\n }\n },\n async destroy({ strapi }: { strapi: Core.Strapi }) {\n if (isAuditLogsEnabled) {\n strapi.get('audit-logs-lifecycle').destroy();\n }\n await eeAdmin.destroy({ strapi });\n },\n };\n};\n\nexport default getAdminEE;\n"],"names":["getAdminEE","eeAdmin","register","bootstrap","destroy","contentTypes","auditLog","adminContentTypes","services","controllers","routes","isAIEnabled","strapi","config","get","ee","features","isEnabled","isAuditLogsEnabled","auditLogsController","ai","aiController","auditLogsRoutes","aiRoutes","add","createAIContainer","createAuditLogsService","auditLogsLifecycle","createAuditLogsLifecycleService"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAMA,UAAAA,GAAa,IAAA;AACjB,IAAA,MAAMC,OAAAA,GAAU;AACdC,QAAAA,QAAAA;AACAC,QAAAA,SAAAA;AACAC,QAAAA,OAAAA;QACAC,YAAAA,EAAc;;YAEZ,WAAA,EAAaC,iBAAAA;AACb,YAAA,GAAGC;AACL,SAAA;AACAC,kBAAAA,OAAAA;AACAC,qBAAAA,OAAAA;AACAC,gBAAAA;AACF,KAAA;AAEA,IAAA,MAAMC,WAAAA,GACJC,MAAAA,CAAOC,MAAM,CAACC,GAAG,CAAC,kBAAA,EAAoB,IAAA,CAAA,IAASF,MAAAA,CAAOG,EAAE,CAACC,QAAQ,CAACC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BG,kBAAAA,CAAAA;AAEnC,gBAAA,MAAMA,mBAAmBzB,QAAQ,EAAA;AACnC,YAAA;AACF,QAAA,CAAA;AACA,QAAA,MAAME,OAAAA,CAAAA,CAAQ,EAAEQ,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AAC/C,YAAA,IAAIM,kBAAAA,EAAoB;gBACtBN,OAAAA,CAAOE,GAAG,CAAC,sBAAA,CAAA,CAAwBV,OAAO,EAAA;AAC5C,YAAA;YACA,MAAMH,OAAAA,CAAQG,OAAO,CAAC;gBAAEQ,MAAAA,EAAAA;AAAO,aAAA,CAAA;AACjC,QAAA;AACF,KAAA;AACF;;;;"}
@@ -51,7 +51,7 @@ const getAdminEE = ()=>{
51
51
  } : {}
52
52
  },
53
53
  async register ({ strapi: strapi1 }) {
54
- // Run the the default registration
54
+ // Run the default registration
55
55
  await eeAdmin.register({
56
56
  strapi: strapi1
57
57
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../ee/server/src/index.ts"],"sourcesContent":["import register from './register';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport adminContentTypes from './content-types';\nimport services from './services';\nimport controllers from './controllers';\nimport routes from './routes';\nimport auditLogsRoutes from './audit-logs/routes/audit-logs';\nimport auditLogsController from './audit-logs/controllers/audit-logs';\nimport { createAuditLogsService } from './audit-logs/services/audit-logs';\nimport { createAuditLogsLifecycleService } from './audit-logs/services/lifecycles';\nimport { auditLog } from './audit-logs/content-types/audit-log';\nimport aiRoutes from './ai/routes/ai';\nimport aiController from './ai/controllers/ai';\nimport type { Core } from '@strapi/types';\nimport { createAIContainer } from './ai/containers/ai';\n\nconst getAdminEE = () => {\n const eeAdmin = {\n register,\n bootstrap,\n destroy,\n contentTypes: {\n // Always register the audit-log content type to prevent data loss\n 'audit-log': auditLog,\n ...adminContentTypes,\n },\n services,\n controllers,\n routes,\n };\n\n const isAIEnabled =\n strapi.config.get('admin.ai.enabled', true) && strapi.ee.features.isEnabled('cms-ai');\n\n const isAuditLogsEnabled =\n strapi.config.get('admin.auditLogs.enabled', true) &&\n strapi.ee.features.isEnabled('audit-logs');\n return {\n ...eeAdmin,\n controllers: {\n ...eeAdmin.controllers,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsController } : {}),\n ...(isAIEnabled ? { ai: aiController } : {}),\n },\n routes: {\n ...eeAdmin.routes,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsRoutes } : {}),\n ...(isAIEnabled ? { ai: aiRoutes } : {}),\n },\n async register({ strapi }: { strapi: Core.Strapi }) {\n // Run the the default registration\n await eeAdmin.register({ strapi });\n\n // Register internal ai service\n if (isAIEnabled) {\n strapi.add('ai', createAIContainer({ strapi }));\n }\n\n if (isAuditLogsEnabled) {\n // Register an internal audit logs service\n strapi.add('audit-logs', createAuditLogsService(strapi));\n // Register an internal audit logs lifecycle service\n const auditLogsLifecycle = createAuditLogsLifecycleService(strapi);\n strapi.add('audit-logs-lifecycle', auditLogsLifecycle);\n\n await auditLogsLifecycle.register();\n }\n },\n async destroy({ strapi }: { strapi: Core.Strapi }) {\n if (isAuditLogsEnabled) {\n strapi.get('audit-logs-lifecycle').destroy();\n }\n await eeAdmin.destroy({ strapi });\n },\n };\n};\n\nexport default getAdminEE;\n"],"names":["getAdminEE","eeAdmin","register","bootstrap","destroy","contentTypes","auditLog","adminContentTypes","services","controllers","routes","isAIEnabled","strapi","config","get","ee","features","isEnabled","isAuditLogsEnabled","auditLogsController","ai","aiController","auditLogsRoutes","aiRoutes","add","createAIContainer","createAuditLogsService","auditLogsLifecycle","createAuditLogsLifecycleService"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,UAAAA,GAAa,IAAA;AACjB,IAAA,MAAMC,OAAAA,GAAU;AACdC,QAAAA,QAAAA;AACAC,QAAAA,SAAAA;AACAC,QAAAA,OAAAA;QACAC,YAAAA,EAAc;;YAEZ,WAAA,EAAaC,QAAAA;AACb,YAAA,GAAGC;AACL,SAAA;AACAC,QA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BAEtBN,OAAAA,CAAOY,GAAG,CAAC,YAAA,EAAcE,sBAAAA,CAAuBd,OAAAA,CAAAA,CAAAA;;AAEhD,gBAAA,MAAMe,qBAAqBC,+BAAAA,CAAgChB,OAAAA,CAAAA;gBAC3DA,OAAAA,CAAOY,GAAG,CAAC,sBAAA,EAAwBG,kBAAAA,CAAAA;AAEnC,gBAAA,MAAMA,mBAAmBzB,QAAQ,EAAA;AACnC,YAAA;AACF,QAAA,CAAA;AACA,QAAA,MAAME,OAAAA,CAAAA,CAAQ,EAAEQ,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AAC/C,YAAA,IAAIM,kBAAAA,EAAoB;gBACtBN,OAAAA,CAAOE,GAAG,CAAC,sBAAA,CAAA,CAAwBV,OAAO,EAAA;AAC5C,YAAA;YACA,MAAMH,OAAAA,CAAQG,OAAO,CAAC;gBAAEQ,MAAAA,EAAAA;AAAO,aAAA,CAAA;AACjC,QAAA;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../ee/server/src/index.ts"],"sourcesContent":["import register from './register';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport adminContentTypes from './content-types';\nimport services from './services';\nimport controllers from './controllers';\nimport routes from './routes';\nimport auditLogsRoutes from './audit-logs/routes/audit-logs';\nimport auditLogsController from './audit-logs/controllers/audit-logs';\nimport { createAuditLogsService } from './audit-logs/services/audit-logs';\nimport { createAuditLogsLifecycleService } from './audit-logs/services/lifecycles';\nimport { auditLog } from './audit-logs/content-types/audit-log';\nimport aiRoutes from './ai/routes/ai';\nimport aiController from './ai/controllers/ai';\nimport type { Core } from '@strapi/types';\nimport { createAIContainer } from './ai/containers/ai';\n\nconst getAdminEE = () => {\n const eeAdmin = {\n register,\n bootstrap,\n destroy,\n contentTypes: {\n // Always register the audit-log content type to prevent data loss\n 'audit-log': auditLog,\n ...adminContentTypes,\n },\n services,\n controllers,\n routes,\n };\n\n const isAIEnabled =\n strapi.config.get('admin.ai.enabled', true) && strapi.ee.features.isEnabled('cms-ai');\n\n const isAuditLogsEnabled =\n strapi.config.get('admin.auditLogs.enabled', true) &&\n strapi.ee.features.isEnabled('audit-logs');\n return {\n ...eeAdmin,\n controllers: {\n ...eeAdmin.controllers,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsController } : {}),\n ...(isAIEnabled ? { ai: aiController } : {}),\n },\n routes: {\n ...eeAdmin.routes,\n ...(isAuditLogsEnabled ? { 'audit-logs': auditLogsRoutes } : {}),\n ...(isAIEnabled ? { ai: aiRoutes } : {}),\n },\n async register({ strapi }: { strapi: Core.Strapi }) {\n // Run the default registration\n await eeAdmin.register({ strapi });\n\n // Register internal ai service\n if (isAIEnabled) {\n strapi.add('ai', createAIContainer({ strapi }));\n }\n\n if (isAuditLogsEnabled) {\n // Register an internal audit logs service\n strapi.add('audit-logs', createAuditLogsService(strapi));\n // Register an internal audit logs lifecycle service\n const auditLogsLifecycle = createAuditLogsLifecycleService(strapi);\n strapi.add('audit-logs-lifecycle', auditLogsLifecycle);\n\n await auditLogsLifecycle.register();\n }\n },\n async destroy({ strapi }: { strapi: Core.Strapi }) {\n if (isAuditLogsEnabled) {\n strapi.get('audit-logs-lifecycle').destroy();\n }\n await eeAdmin.destroy({ strapi });\n },\n };\n};\n\nexport default getAdminEE;\n"],"names":["getAdminEE","eeAdmin","register","bootstrap","destroy","contentTypes","auditLog","adminContentTypes","services","controllers","routes","isAIEnabled","strapi","config","get","ee","features","isEnabled","isAuditLogsEnabled","auditLogsController","ai","aiController","auditLogsRoutes","aiRoutes","add","createAIContainer","createAuditLogsService","auditLogsLifecycle","createAuditLogsLifecycleService"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,UAAAA,GAAa,IAAA;AACjB,IAAA,MAAMC,OAAAA,GAAU;AACdC,QAAAA,QAAAA;AACAC,QAAAA,SAAAA;AACAC,QAAAA,OAAAA;QACAC,YAAAA,EAAc;;YAEZ,WAAA,EAAaC,QAAAA;AACb,YAAA,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,IAAIM,kBAAAA,EAAoB;;gBAEtBN,OAAAA,CAAOY,GAAG,CAAC,YAAA,EAAcE,sBAAAA,CAAuBd,OAAAA,CAAAA,CAAAA;;AAEhD,gBAAA,MAAMe,qBAAqBC,+BAAAA,CAAgChB,OAAAA,CAAAA;gBAC3DA,OAAAA,CAAOY,GAAG,CAAC,sBAAA,EAAwBG,kBAAAA,CAAAA;AAEnC,gBAAA,MAAMA,mBAAmBzB,QAAQ,EAAA;AACnC,YAAA;AACF,QAAA,CAAA;AACA,QAAA,MAAME,OAAAA,CAAAA,CAAQ,EAAEQ,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AAC/C,YAAA,IAAIM,kBAAAA,EAAoB;gBACtBN,OAAAA,CAAOE,GAAG,CAAC,sBAAA,CAAA,CAAwBV,OAAO,EAAA;AAC5C,YAAA;YACA,MAAMH,OAAAA,CAAQG,OAAO,CAAC;gBAAEQ,MAAAA,EAAAA;AAAO,aAAA,CAAA;AACjC,QAAA;AACF,KAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/admin",
3
- "version": "5.41.1",
3
+ "version": "5.42.1",
4
4
  "description": "Strapi Admin",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -91,14 +91,14 @@
91
91
  "@reduxjs/toolkit": "1.9.7",
92
92
  "@strapi/design-system": "2.2.0",
93
93
  "@strapi/icons": "2.2.0",
94
- "@strapi/permissions": "5.41.1",
95
- "@strapi/types": "5.41.1",
96
- "@strapi/typescript-utils": "5.41.1",
97
- "@strapi/utils": "5.41.1",
94
+ "@strapi/permissions": "5.42.1",
95
+ "@strapi/types": "5.42.1",
96
+ "@strapi/typescript-utils": "5.42.1",
97
+ "@strapi/utils": "5.42.1",
98
98
  "@testing-library/dom": "10.4.1",
99
99
  "@testing-library/react": "16.3.0",
100
100
  "@testing-library/user-event": "14.6.1",
101
- "axios": "1.13.5",
101
+ "axios": "1.15.0",
102
102
  "bcryptjs": "2.4.3",
103
103
  "boxen": "5.1.2",
104
104
  "chalk": "^4.1.2",
@@ -122,7 +122,7 @@
122
122
  "koa-passport": "6.0.0",
123
123
  "koa-static": "5.0.0",
124
124
  "koa2-ratelimit": "^1.1.3",
125
- "lodash": "4.17.23",
125
+ "lodash": "4.18.1",
126
126
  "motion": "12.23.24",
127
127
  "ora": "5.4.1",
128
128
  "p-map": "4.0.0",
@@ -150,8 +150,8 @@
150
150
  "zod": "3.25.67"
151
151
  },
152
152
  "devDependencies": {
153
- "@strapi/admin-test-utils": "5.41.1",
154
- "@strapi/data-transfer": "5.41.1",
153
+ "@strapi/admin-test-utils": "5.42.1",
154
+ "@strapi/data-transfer": "5.42.1",
155
155
  "@types/codemirror5": "npm:@types/codemirror@^5.60.15",
156
156
  "@types/fs-extra": "11.0.4",
157
157
  "@types/invariant": "2.2.36",