{"version":3,"file":"index.mjs","sources":["../../../server/src/history/index.ts"],"sourcesContent":["import type { Plugin } from '@strapi/types';\nimport { controllers } from './controllers';\nimport { services } from './services';\nimport { routes } from './routes';\nimport { getService } from './utils';\nimport { historyVersion } from './models/history-version';\n\n/**\n * Check once if the feature is enabled before loading it,\n * so that we can assume it is enabled in the other files.\n */\nconst getFeature = (): Partial => {\n if (strapi.ee.features.isEnabled('cms-content-history')) {\n return {\n register({ strapi }) {\n strapi.get('models').add(historyVersion);\n },\n bootstrap({ strapi }) {\n // Start recording history and saving history versions\n getService(strapi, 'lifecycles').bootstrap();\n },\n destroy({ strapi }) {\n getService(strapi, 'lifecycles').destroy();\n },\n controllers,\n services,\n routes,\n };\n }\n\n /**\n * Keep registering the model to avoid losing the data if the feature is disabled,\n * or if the license expires.\n */\n return {\n register({ strapi }) {\n strapi.get('models').add(historyVersion);\n },\n };\n};\n\nexport default getFeature();\n"],"names":["getFeature","strapi","ee","features","isEnabled","register","get","add","historyVersion","bootstrap","getService","destroy","controllers","services","routes"],"mappings":";;;;;;AAOA;;;AAGC,IACD,MAAMA,UAAAA,GAAa,IAAA;AACjB,IAAA,IAAIC,OAAOC,EAAE,CAACC,QAAQ,CAACC,SAAS,CAAC,qBAAA,CAAA,EAAwB;QACvD,OAAO;YACLC,QAAAA,CAAAA,CAAS,EAAEJ,MAAAA,EAAAA,OAAM,EAAE,EAAA;AACjBA,gBAAAA,OAAAA,CAAOK,GAAG,CAAC,QAAA,CAAA,CAAUC,GAAG,CAACC,cAAAA,CAAAA;AAC3B,YAAA,CAAA;YACAC,SAAAA,CAAAA,CAAU,EAAER,MAAAA,EAAAA,OAAM,EAAE,EAAA;;gBAElBS,UAAAA,CAAWT,OAAAA,EAAQ,cAAcQ,SAAS,EAAA;AAC5C,YAAA,CAAA;YACAE,OAAAA,CAAAA,CAAQ,EAAEV,MAAAA,EAAAA,OAAM,EAAE,EAAA;gBAChBS,UAAAA,CAAWT,OAAAA,EAAQ,cAAcU,OAAO,EAAA;AAC1C,YAAA,CAAA;AACAC,YAAAA,WAAAA;AACAC,YAAAA,QAAAA;AACAC,YAAAA;AACF,SAAA;AACF,IAAA;AAEA;;;AAGC,MACD,OAAO;QACLT,QAAAA,CAAAA,CAAS,EAAEJ,MAAAA,EAAAA,OAAM,EAAE,EAAA;AACjBA,YAAAA,OAAAA,CAAOK,GAAG,CAAC,QAAA,CAAA,CAAUC,GAAG,CAACC,cAAAA,CAAAA;AAC3B,QAAA;AACF,KAAA;AACF,CAAA;AAEA,cAAeR,UAAAA,EAAAA;;;;"}