@strapi/review-workflows 5.37.1 → 5.38.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/dist/admin/assets/balloon.png.js.map +1 -1
- package/dist/admin/assets/balloon.png.mjs.map +1 -1
- package/dist/admin/assets/purchase-page-illustration-dark.jpg.js.map +1 -1
- package/dist/admin/assets/purchase-page-illustration-dark.jpg.mjs.map +1 -1
- package/dist/admin/assets/purchase-page-illustration-light.jpg.js.map +1 -1
- package/dist/admin/assets/purchase-page-illustration-light.jpg.mjs.map +1 -1
- package/dist/admin/components/LimitsModal.js.map +1 -1
- package/dist/admin/components/LimitsModal.mjs +1 -1
- package/dist/admin/components/LimitsModal.mjs.map +1 -1
- package/dist/admin/components/Widgets.js.map +1 -1
- package/dist/admin/components/Widgets.mjs +1 -1
- package/dist/admin/components/Widgets.mjs.map +1 -1
- package/dist/admin/constants.js.map +1 -1
- package/dist/admin/constants.mjs.map +1 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/modules/hooks.js.map +1 -1
- package/dist/admin/modules/hooks.mjs.map +1 -1
- package/dist/admin/router.js.map +1 -1
- package/dist/admin/router.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/components/TableColumns.js.map +1 -1
- package/dist/admin/routes/content-manager/model/components/TableColumns.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/constants.js.map +1 -1
- package/dist/admin/routes/content-manager/model/constants.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/Header.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/Header.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/Panel.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/Panel.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.mjs +1 -1
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.mjs.map +1 -1
- package/dist/admin/routes/purchase-review-workflows.js.map +1 -1
- package/dist/admin/routes/purchase-review-workflows.mjs.map +1 -1
- package/dist/admin/routes/settings/components/AddStage.js.map +1 -1
- package/dist/admin/routes/settings/components/AddStage.mjs +1 -1
- package/dist/admin/routes/settings/components/AddStage.mjs.map +1 -1
- package/dist/admin/routes/settings/components/Layout.js.map +1 -1
- package/dist/admin/routes/settings/components/Layout.mjs +1 -1
- package/dist/admin/routes/settings/components/Layout.mjs.map +1 -1
- package/dist/admin/routes/settings/components/StageDragPreview.js.map +1 -1
- package/dist/admin/routes/settings/components/StageDragPreview.mjs.map +1 -1
- package/dist/admin/routes/settings/components/Stages.js.map +1 -1
- package/dist/admin/routes/settings/components/Stages.mjs +1 -1
- package/dist/admin/routes/settings/components/Stages.mjs.map +1 -1
- package/dist/admin/routes/settings/components/WorkflowAttributes.js.map +1 -1
- package/dist/admin/routes/settings/components/WorkflowAttributes.mjs +1 -1
- package/dist/admin/routes/settings/components/WorkflowAttributes.mjs.map +1 -1
- package/dist/admin/routes/settings/constants.js.map +1 -1
- package/dist/admin/routes/settings/constants.mjs.map +1 -1
- package/dist/admin/routes/settings/hooks/useDragAndDrop.js +1 -3
- package/dist/admin/routes/settings/hooks/useDragAndDrop.js.map +1 -1
- package/dist/admin/routes/settings/hooks/useDragAndDrop.mjs +1 -3
- package/dist/admin/routes/settings/hooks/useDragAndDrop.mjs.map +1 -1
- package/dist/admin/routes/settings/hooks/useKeyboardDragAndDrop.js.map +1 -1
- package/dist/admin/routes/settings/hooks/useKeyboardDragAndDrop.mjs.map +1 -1
- package/dist/admin/routes/settings/hooks/useReviewWorkflows.js.map +1 -1
- package/dist/admin/routes/settings/hooks/useReviewWorkflows.mjs.map +1 -1
- package/dist/admin/routes/settings/id.js.map +1 -1
- package/dist/admin/routes/settings/id.mjs +1 -1
- package/dist/admin/routes/settings/id.mjs.map +1 -1
- package/dist/admin/routes/settings/index.js.map +1 -1
- package/dist/admin/routes/settings/index.mjs +2 -2
- package/dist/admin/routes/settings/index.mjs.map +1 -1
- package/dist/admin/services/admin.js.map +1 -1
- package/dist/admin/services/admin.mjs.map +1 -1
- package/dist/admin/services/api.js.map +1 -1
- package/dist/admin/services/api.mjs.map +1 -1
- package/dist/admin/services/content-manager.js.map +1 -1
- package/dist/admin/services/content-manager.mjs.map +1 -1
- package/dist/admin/services/settings.js.map +1 -1
- package/dist/admin/services/settings.mjs.map +1 -1
- package/dist/admin/src/routes/content-manager/model/components/TableColumns.d.ts +3 -2
- package/dist/admin/utils/api.js.map +1 -1
- package/dist/admin/utils/api.mjs.map +1 -1
- package/dist/admin/utils/cm-hooks.js.map +1 -1
- package/dist/admin/utils/cm-hooks.mjs.map +1 -1
- package/dist/admin/utils/colors.js.map +1 -1
- package/dist/admin/utils/colors.mjs.map +1 -1
- package/dist/admin/utils/translations.js.map +1 -1
- package/dist/admin/utils/translations.mjs.map +1 -1
- package/dist/admin/utils/users.js.map +1 -1
- package/dist/admin/utils/users.mjs.map +1 -1
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/server/bootstrap.mjs.map +1 -1
- package/dist/server/config/actions.js.map +1 -1
- package/dist/server/config/actions.mjs.map +1 -1
- package/dist/server/constants/webhook-events.js.map +1 -1
- package/dist/server/constants/webhook-events.mjs.map +1 -1
- package/dist/server/constants/workflows.js.map +1 -1
- package/dist/server/constants/workflows.mjs.map +1 -1
- package/dist/server/content-types/index.js +4 -4
- package/dist/server/content-types/index.js.map +1 -1
- package/dist/server/content-types/index.mjs.map +1 -1
- package/dist/server/content-types/workflow/index.js.map +1 -1
- package/dist/server/content-types/workflow/index.mjs.map +1 -1
- package/dist/server/content-types/workflow-stage/index.js.map +1 -1
- package/dist/server/content-types/workflow-stage/index.mjs.map +1 -1
- package/dist/server/controllers/assignees.js.map +1 -1
- package/dist/server/controllers/assignees.mjs.map +1 -1
- package/dist/server/controllers/index.js.map +1 -1
- package/dist/server/controllers/index.mjs.map +1 -1
- package/dist/server/controllers/stages.js.map +1 -1
- package/dist/server/controllers/stages.mjs.map +1 -1
- package/dist/server/controllers/workflows.js.map +1 -1
- package/dist/server/controllers/workflows.mjs +1 -1
- package/dist/server/controllers/workflows.mjs.map +1 -1
- package/dist/server/destroy.js.map +1 -1
- package/dist/server/destroy.mjs.map +1 -1
- package/dist/server/homepage/controllers/homepage.js.map +1 -1
- package/dist/server/homepage/controllers/homepage.mjs.map +1 -1
- package/dist/server/homepage/controllers/index.js.map +1 -1
- package/dist/server/homepage/controllers/index.mjs.map +1 -1
- package/dist/server/homepage/index.js.map +1 -1
- package/dist/server/homepage/index.mjs.map +1 -1
- package/dist/server/homepage/routes/homepage.js.map +1 -1
- package/dist/server/homepage/routes/homepage.mjs.map +1 -1
- package/dist/server/homepage/routes/index.js.map +1 -1
- package/dist/server/homepage/routes/index.mjs.map +1 -1
- package/dist/server/homepage/services/homepage.js.map +1 -1
- package/dist/server/homepage/services/homepage.mjs.map +1 -1
- package/dist/server/homepage/services/index.js.map +1 -1
- package/dist/server/homepage/services/index.mjs.map +1 -1
- package/dist/server/index.js +9 -9
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/middlewares/review-workflows.js.map +1 -1
- package/dist/server/middlewares/review-workflows.mjs.map +1 -1
- package/dist/server/migrations/handle-deleted-ct-in-workflows.js.map +1 -1
- package/dist/server/migrations/handle-deleted-ct-in-workflows.mjs.map +1 -1
- package/dist/server/migrations/multiple-workflows.js.map +1 -1
- package/dist/server/migrations/multiple-workflows.mjs +1 -1
- package/dist/server/migrations/multiple-workflows.mjs.map +1 -1
- package/dist/server/migrations/set-stages-default-color.js.map +1 -1
- package/dist/server/migrations/set-stages-default-color.mjs.map +1 -1
- package/dist/server/migrations/set-stages-roles.js.map +1 -1
- package/dist/server/migrations/set-stages-roles.mjs.map +1 -1
- package/dist/server/migrations/set-workflow-default-name.js.map +1 -1
- package/dist/server/migrations/set-workflow-default-name.mjs.map +1 -1
- package/dist/server/migrations/shorten-stage-attribute.js.map +1 -1
- package/dist/server/migrations/shorten-stage-attribute.mjs.map +1 -1
- package/dist/server/register.js.map +1 -1
- package/dist/server/register.mjs +1 -1
- package/dist/server/register.mjs.map +1 -1
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/routes/index.mjs.map +1 -1
- package/dist/server/routes/review-workflows.js.map +1 -1
- package/dist/server/routes/review-workflows.mjs.map +1 -1
- package/dist/server/routes/utils.js.map +1 -1
- package/dist/server/routes/utils.mjs.map +1 -1
- package/dist/server/services/assignees.js.map +1 -1
- package/dist/server/services/assignees.mjs.map +1 -1
- package/dist/server/services/document-service-middleware.js.map +1 -1
- package/dist/server/services/document-service-middleware.mjs.map +1 -1
- package/dist/server/services/index.js +4 -4
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/index.mjs.map +1 -1
- package/dist/server/services/metrics/index.js.map +1 -1
- package/dist/server/services/metrics/index.mjs.map +1 -1
- package/dist/server/services/metrics/weekly-metrics.js.map +1 -1
- package/dist/server/services/metrics/weekly-metrics.mjs +1 -1
- package/dist/server/services/metrics/weekly-metrics.mjs.map +1 -1
- package/dist/server/services/stage-permissions.js.map +1 -1
- package/dist/server/services/stage-permissions.mjs +1 -1
- package/dist/server/services/stage-permissions.mjs.map +1 -1
- package/dist/server/services/stages.js.map +1 -1
- package/dist/server/services/stages.mjs +2 -2
- package/dist/server/services/stages.mjs.map +1 -1
- package/dist/server/services/validation.js.map +1 -1
- package/dist/server/services/validation.mjs +1 -1
- package/dist/server/services/validation.mjs.map +1 -1
- package/dist/server/services/workflow-content-types.js.map +1 -1
- package/dist/server/services/workflow-content-types.mjs.map +1 -1
- package/dist/server/services/workflows.js.map +1 -1
- package/dist/server/services/workflows.mjs +1 -1
- package/dist/server/services/workflows.mjs.map +1 -1
- package/dist/server/utils/index.js.map +1 -1
- package/dist/server/utils/index.mjs.map +1 -1
- package/dist/server/utils/review-workflows.js.map +1 -1
- package/dist/server/utils/review-workflows.mjs +1 -1
- package/dist/server/utils/review-workflows.mjs.map +1 -1
- package/dist/server/validation/review-workflows.js.map +1 -1
- package/dist/server/validation/review-workflows.mjs.map +1 -1
- package/package.json +7 -7
package/dist/server/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var register = require('./register.js');
|
|
4
|
-
var index$
|
|
4
|
+
var index$4 = require('./content-types/index.js');
|
|
5
5
|
var bootstrap = require('./bootstrap.js');
|
|
6
6
|
var destroy = require('./destroy.js');
|
|
7
|
-
var index$
|
|
8
|
-
var index$
|
|
9
|
-
var index$
|
|
7
|
+
var index$1 = require('./routes/index.js');
|
|
8
|
+
var index$3 = require('./services/index.js');
|
|
9
|
+
var index$2 = require('./controllers/index.js');
|
|
10
10
|
|
|
11
11
|
const getPlugin = ()=>{
|
|
12
12
|
if (strapi.ee.features.isEnabled('review-workflows')) {
|
|
@@ -14,16 +14,16 @@ const getPlugin = ()=>{
|
|
|
14
14
|
register,
|
|
15
15
|
bootstrap,
|
|
16
16
|
destroy,
|
|
17
|
-
contentTypes: index$
|
|
18
|
-
services: index$
|
|
19
|
-
controllers: index$
|
|
20
|
-
routes: index$
|
|
17
|
+
contentTypes: index$4,
|
|
18
|
+
services: index$3,
|
|
19
|
+
controllers: index$2,
|
|
20
|
+
routes: index$1
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
return {
|
|
24
24
|
// Always return contentTypes to avoid losing data when the feature is disabled
|
|
25
25
|
// or downgrading the license
|
|
26
|
-
contentTypes: index$
|
|
26
|
+
contentTypes: index$4
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
var index = getPlugin();
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../server/src/index.ts"],"sourcesContent":["import register from './register';\nimport contentTypes from './content-types';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport routes from './routes';\nimport services from './services';\nimport controllers from './controllers';\n\nconst getPlugin = () => {\n if (strapi.ee.features.isEnabled('review-workflows')) {\n return {\n register,\n bootstrap,\n destroy,\n contentTypes,\n services,\n controllers,\n routes,\n };\n }\n\n return {\n // Always return contentTypes to avoid losing data when the feature is disabled\n // or downgrading the license\n contentTypes,\n };\n};\n\nexport default getPlugin();\n"],"names":["getPlugin","strapi","ee","features","isEnabled","register","bootstrap","destroy","contentTypes","services","controllers","routes"],"mappings":";;;;;;;;;;AAQA,MAAMA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../server/src/index.ts"],"sourcesContent":["import register from './register';\nimport contentTypes from './content-types';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport routes from './routes';\nimport services from './services';\nimport controllers from './controllers';\n\nconst getPlugin = () => {\n if (strapi.ee.features.isEnabled('review-workflows')) {\n return {\n register,\n bootstrap,\n destroy,\n contentTypes,\n services,\n controllers,\n routes,\n };\n }\n\n return {\n // Always return contentTypes to avoid losing data when the feature is disabled\n // or downgrading the license\n contentTypes,\n };\n};\n\nexport default getPlugin();\n"],"names":["getPlugin","strapi","ee","features","isEnabled","register","bootstrap","destroy","contentTypes","services","controllers","routes"],"mappings":";;;;;;;;;;AAQA,MAAMA,SAAAA,GAAY,IAAA;AAChB,IAAA,IAAIC,OAAOC,EAAE,CAACC,QAAQ,CAACC,SAAS,CAAC,kBAAA,CAAA,EAAqB;QACpD,OAAO;AACLC,YAAAA,QAAAA;AACAC,YAAAA,SAAAA;AACAC,YAAAA,OAAAA;AACAC,0BAAAA,OAAAA;AACAC,sBAAAA,OAAAA;AACAC,yBAAAA,OAAAA;AACAC,oBAAAA;AACF,SAAA;AACF,IAAA;IAEA,OAAO;;;AAGLH,sBAAAA;AACF,KAAA;AACF,CAAA;AAEA,YAAeR,SAAAA,EAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import register from './register';\nimport contentTypes from './content-types';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport routes from './routes';\nimport services from './services';\nimport controllers from './controllers';\n\nconst getPlugin = () => {\n if (strapi.ee.features.isEnabled('review-workflows')) {\n return {\n register,\n bootstrap,\n destroy,\n contentTypes,\n services,\n controllers,\n routes,\n };\n }\n\n return {\n // Always return contentTypes to avoid losing data when the feature is disabled\n // or downgrading the license\n contentTypes,\n };\n};\n\nexport default getPlugin();\n"],"names":["getPlugin","strapi","ee","features","isEnabled","register","bootstrap","destroy","contentTypes","services","controllers","routes"],"mappings":";;;;;;;;AAQA,MAAMA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import register from './register';\nimport contentTypes from './content-types';\nimport bootstrap from './bootstrap';\nimport destroy from './destroy';\nimport routes from './routes';\nimport services from './services';\nimport controllers from './controllers';\n\nconst getPlugin = () => {\n if (strapi.ee.features.isEnabled('review-workflows')) {\n return {\n register,\n bootstrap,\n destroy,\n contentTypes,\n services,\n controllers,\n routes,\n };\n }\n\n return {\n // Always return contentTypes to avoid losing data when the feature is disabled\n // or downgrading the license\n contentTypes,\n };\n};\n\nexport default getPlugin();\n"],"names":["getPlugin","strapi","ee","features","isEnabled","register","bootstrap","destroy","contentTypes","services","controllers","routes"],"mappings":";;;;;;;;AAQA,MAAMA,SAAAA,GAAY,IAAA;AAChB,IAAA,IAAIC,OAAOC,EAAE,CAACC,QAAQ,CAACC,SAAS,CAAC,kBAAA,CAAA,EAAqB;QACpD,OAAO;AACLC,YAAAA,QAAAA;AACAC,YAAAA,SAAAA;AACAC,YAAAA,OAAAA;AACAC,YAAAA,YAAAA;AACAC,YAAAA,QAAAA;AACAC,YAAAA,WAAAA;AACAC,YAAAA;AACF,SAAA;AACF,IAAA;IAEA,OAAO;;;AAGLH,QAAAA;AACF,KAAA;AACF,CAAA;AAEA,YAAeR,SAAAA,EAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflows.js","sources":["../../../server/src/middlewares/review-workflows.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { set } from 'lodash/fp';\n\n/**\n * A Strapi middleware function that adds support for review workflows.\n *\n * Why is it needed ?\n * For now, the admin panel cannot have anything but top-level attributes in the content-type for options.\n * But we need the CE part to be agnostics from Review Workflow (which is an EE feature).\n * CE handle the `options` object, that's why we move the reviewWorkflows boolean to the options object.\n *\n * @param {object} strapi - The Strapi instance.\n */\nexport function contentTypeMiddleware(strapi: Core.Strapi) {\n /**\n * A middleware function that moves the `reviewWorkflows` attribute from the top level of\n * the request body to the `options` object within the request body.\n *\n * @param {object} ctx - The Koa context object.\n */\n const moveReviewWorkflowOption = (ctx: Context) => {\n // Move reviewWorkflows to options.reviewWorkflows\n const { reviewWorkflows, ...contentType } = ctx.request.body.contentType;\n\n if (typeof reviewWorkflows === 'boolean') {\n ctx.request.body.contentType = set('options.reviewWorkflows', reviewWorkflows, contentType);\n }\n };\n strapi.server.router.use('/content-type-builder/content-types/:uid?', (ctx, next) => {\n if (ctx.method === 'PUT' || ctx.method === 'POST') {\n moveReviewWorkflowOption(ctx);\n }\n return next();\n });\n}\n\nexport default {\n contentTypeMiddleware,\n};\n"],"names":["contentTypeMiddleware","strapi","moveReviewWorkflowOption","ctx","reviewWorkflows","contentType","request","body","set","server","router","use","next","method"],"mappings":";;;;;;AAKA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsBC,MAAmB,EAAA;AACvD;;;;;MAMA,MAAMC,2BAA2B,CAACC,GAAAA,GAAAA;;QAEhC,MAAM,EAAEC,eAAe,EAAE,GAAGC,WAAAA,EAAa,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW;QAExE,IAAI,OAAOD,oBAAoB,
|
|
1
|
+
{"version":3,"file":"review-workflows.js","sources":["../../../server/src/middlewares/review-workflows.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { set } from 'lodash/fp';\n\n/**\n * A Strapi middleware function that adds support for review workflows.\n *\n * Why is it needed ?\n * For now, the admin panel cannot have anything but top-level attributes in the content-type for options.\n * But we need the CE part to be agnostics from Review Workflow (which is an EE feature).\n * CE handle the `options` object, that's why we move the reviewWorkflows boolean to the options object.\n *\n * @param {object} strapi - The Strapi instance.\n */\nexport function contentTypeMiddleware(strapi: Core.Strapi) {\n /**\n * A middleware function that moves the `reviewWorkflows` attribute from the top level of\n * the request body to the `options` object within the request body.\n *\n * @param {object} ctx - The Koa context object.\n */\n const moveReviewWorkflowOption = (ctx: Context) => {\n // Move reviewWorkflows to options.reviewWorkflows\n const { reviewWorkflows, ...contentType } = ctx.request.body.contentType;\n\n if (typeof reviewWorkflows === 'boolean') {\n ctx.request.body.contentType = set('options.reviewWorkflows', reviewWorkflows, contentType);\n }\n };\n strapi.server.router.use('/content-type-builder/content-types/:uid?', (ctx, next) => {\n if (ctx.method === 'PUT' || ctx.method === 'POST') {\n moveReviewWorkflowOption(ctx);\n }\n return next();\n });\n}\n\nexport default {\n contentTypeMiddleware,\n};\n"],"names":["contentTypeMiddleware","strapi","moveReviewWorkflowOption","ctx","reviewWorkflows","contentType","request","body","set","server","router","use","next","method"],"mappings":";;;;;;AAKA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsBC,MAAmB,EAAA;AACvD;;;;;MAMA,MAAMC,2BAA2B,CAACC,GAAAA,GAAAA;;QAEhC,MAAM,EAAEC,eAAe,EAAE,GAAGC,WAAAA,EAAa,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW;QAExE,IAAI,OAAOD,oBAAoB,SAAA,EAAW;YACxCD,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW,GAAGG,MAAAA,CAAI,2BAA2BJ,eAAAA,EAAiBC,WAAAA,CAAAA;AACjF,QAAA;AACF,IAAA,CAAA;IACAJ,MAAAA,CAAOQ,MAAM,CAACC,MAAM,CAACC,GAAG,CAAC,2CAAA,EAA6C,CAACR,GAAAA,EAAKS,IAAAA,GAAAA;AAC1E,QAAA,IAAIT,IAAIU,MAAM,KAAK,SAASV,GAAAA,CAAIU,MAAM,KAAK,MAAA,EAAQ;YACjDX,wBAAAA,CAAyBC,GAAAA,CAAAA;AAC3B,QAAA;QACA,OAAOS,IAAAA,EAAAA;AACT,IAAA,CAAA,CAAA;AACF;AAEA,iCAAe;AACbZ,IAAAA;AACF,CAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflows.mjs","sources":["../../../server/src/middlewares/review-workflows.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { set } from 'lodash/fp';\n\n/**\n * A Strapi middleware function that adds support for review workflows.\n *\n * Why is it needed ?\n * For now, the admin panel cannot have anything but top-level attributes in the content-type for options.\n * But we need the CE part to be agnostics from Review Workflow (which is an EE feature).\n * CE handle the `options` object, that's why we move the reviewWorkflows boolean to the options object.\n *\n * @param {object} strapi - The Strapi instance.\n */\nexport function contentTypeMiddleware(strapi: Core.Strapi) {\n /**\n * A middleware function that moves the `reviewWorkflows` attribute from the top level of\n * the request body to the `options` object within the request body.\n *\n * @param {object} ctx - The Koa context object.\n */\n const moveReviewWorkflowOption = (ctx: Context) => {\n // Move reviewWorkflows to options.reviewWorkflows\n const { reviewWorkflows, ...contentType } = ctx.request.body.contentType;\n\n if (typeof reviewWorkflows === 'boolean') {\n ctx.request.body.contentType = set('options.reviewWorkflows', reviewWorkflows, contentType);\n }\n };\n strapi.server.router.use('/content-type-builder/content-types/:uid?', (ctx, next) => {\n if (ctx.method === 'PUT' || ctx.method === 'POST') {\n moveReviewWorkflowOption(ctx);\n }\n return next();\n });\n}\n\nexport default {\n contentTypeMiddleware,\n};\n"],"names":["contentTypeMiddleware","strapi","moveReviewWorkflowOption","ctx","reviewWorkflows","contentType","request","body","set","server","router","use","next","method"],"mappings":";;AAKA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsBC,MAAmB,EAAA;AACvD;;;;;MAMA,MAAMC,2BAA2B,CAACC,GAAAA,GAAAA;;QAEhC,MAAM,EAAEC,eAAe,EAAE,GAAGC,WAAAA,EAAa,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW;QAExE,IAAI,OAAOD,oBAAoB,
|
|
1
|
+
{"version":3,"file":"review-workflows.mjs","sources":["../../../server/src/middlewares/review-workflows.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { set } from 'lodash/fp';\n\n/**\n * A Strapi middleware function that adds support for review workflows.\n *\n * Why is it needed ?\n * For now, the admin panel cannot have anything but top-level attributes in the content-type for options.\n * But we need the CE part to be agnostics from Review Workflow (which is an EE feature).\n * CE handle the `options` object, that's why we move the reviewWorkflows boolean to the options object.\n *\n * @param {object} strapi - The Strapi instance.\n */\nexport function contentTypeMiddleware(strapi: Core.Strapi) {\n /**\n * A middleware function that moves the `reviewWorkflows` attribute from the top level of\n * the request body to the `options` object within the request body.\n *\n * @param {object} ctx - The Koa context object.\n */\n const moveReviewWorkflowOption = (ctx: Context) => {\n // Move reviewWorkflows to options.reviewWorkflows\n const { reviewWorkflows, ...contentType } = ctx.request.body.contentType;\n\n if (typeof reviewWorkflows === 'boolean') {\n ctx.request.body.contentType = set('options.reviewWorkflows', reviewWorkflows, contentType);\n }\n };\n strapi.server.router.use('/content-type-builder/content-types/:uid?', (ctx, next) => {\n if (ctx.method === 'PUT' || ctx.method === 'POST') {\n moveReviewWorkflowOption(ctx);\n }\n return next();\n });\n}\n\nexport default {\n contentTypeMiddleware,\n};\n"],"names":["contentTypeMiddleware","strapi","moveReviewWorkflowOption","ctx","reviewWorkflows","contentType","request","body","set","server","router","use","next","method"],"mappings":";;AAKA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsBC,MAAmB,EAAA;AACvD;;;;;MAMA,MAAMC,2BAA2B,CAACC,GAAAA,GAAAA;;QAEhC,MAAM,EAAEC,eAAe,EAAE,GAAGC,WAAAA,EAAa,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW;QAExE,IAAI,OAAOD,oBAAoB,SAAA,EAAW;YACxCD,GAAAA,CAAIG,OAAO,CAACC,IAAI,CAACF,WAAW,GAAGG,GAAAA,CAAI,2BAA2BJ,eAAAA,EAAiBC,WAAAA,CAAAA;AACjF,QAAA;AACF,IAAA,CAAA;IACAJ,MAAAA,CAAOQ,MAAM,CAACC,MAAM,CAACC,GAAG,CAAC,2CAAA,EAA6C,CAACR,GAAAA,EAAKS,IAAAA,GAAAA;AAC1E,QAAA,IAAIT,IAAIU,MAAM,KAAK,SAASV,GAAAA,CAAIU,MAAM,KAAK,MAAA,EAAQ;YACjDX,wBAAAA,CAAyBC,GAAAA,CAAAA;AAC3B,QAAA;QACA,OAAOS,IAAAA,EAAAA;AACT,IAAA,CAAA,CAAA;AACF;AAEA,iCAAe;AACbZ,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-deleted-ct-in-workflows.js","sources":["../../../server/src/migrations/handle-deleted-ct-in-workflows.ts"],"sourcesContent":["import { difference, keys } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport { getWorkflowContentTypeFilter } from '../utils/review-workflows';\n\n/**\n * Remove CT references from workflows if the CT is deleted\n */\nasync function migrateDeletedCTInWorkflows({ oldContentTypes, contentTypes }: any) {\n const deletedContentTypes = difference(keys(oldContentTypes), keys(contentTypes)) ?? [];\n\n if (deletedContentTypes.length) {\n await async.map(deletedContentTypes, async (deletedContentTypeUID: unknown) => {\n const workflow = await strapi.db.query(WORKFLOW_MODEL_UID).findOne({\n select: ['id', 'contentTypes'],\n where: {\n contentTypes: getWorkflowContentTypeFilter({ strapi }, deletedContentTypeUID),\n },\n });\n\n if (workflow) {\n await strapi.db.query(WORKFLOW_MODEL_UID).update({\n where: { id: workflow.id },\n data: {\n contentTypes: workflow.contentTypes.filter(\n (contentTypeUID: unknown) => contentTypeUID !== deletedContentTypeUID\n ),\n },\n });\n }\n });\n }\n}\n\nexport default migrateDeletedCTInWorkflows;\n"],"names":["migrateDeletedCTInWorkflows","oldContentTypes","contentTypes","deletedContentTypes","difference","keys","length","async","map","deletedContentTypeUID","workflow","strapi","db","query","WORKFLOW_MODEL_UID","findOne","select","where","getWorkflowContentTypeFilter","update","id","data","filter","contentTypeUID"],"mappings":";;;;;;;AAKA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"handle-deleted-ct-in-workflows.js","sources":["../../../server/src/migrations/handle-deleted-ct-in-workflows.ts"],"sourcesContent":["import { difference, keys } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport { getWorkflowContentTypeFilter } from '../utils/review-workflows';\n\n/**\n * Remove CT references from workflows if the CT is deleted\n */\nasync function migrateDeletedCTInWorkflows({ oldContentTypes, contentTypes }: any) {\n const deletedContentTypes = difference(keys(oldContentTypes), keys(contentTypes)) ?? [];\n\n if (deletedContentTypes.length) {\n await async.map(deletedContentTypes, async (deletedContentTypeUID: unknown) => {\n const workflow = await strapi.db.query(WORKFLOW_MODEL_UID).findOne({\n select: ['id', 'contentTypes'],\n where: {\n contentTypes: getWorkflowContentTypeFilter({ strapi }, deletedContentTypeUID),\n },\n });\n\n if (workflow) {\n await strapi.db.query(WORKFLOW_MODEL_UID).update({\n where: { id: workflow.id },\n data: {\n contentTypes: workflow.contentTypes.filter(\n (contentTypeUID: unknown) => contentTypeUID !== deletedContentTypeUID\n ),\n },\n });\n }\n });\n }\n}\n\nexport default migrateDeletedCTInWorkflows;\n"],"names":["migrateDeletedCTInWorkflows","oldContentTypes","contentTypes","deletedContentTypes","difference","keys","length","async","map","deletedContentTypeUID","workflow","strapi","db","query","WORKFLOW_MODEL_UID","findOne","select","where","getWorkflowContentTypeFilter","update","id","data","filter","contentTypeUID"],"mappings":";;;;;;;AAKA;;AAEC,IACD,eAAeA,2BAAAA,CAA4B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AAC/E,IAAA,MAAMC,sBAAsBC,aAAAA,CAAWC,OAAAA,CAAKJ,eAAAA,CAAAA,EAAkBI,OAAAA,CAAKH,kBAAkB,EAAE;IAEvF,IAAIC,mBAAAA,CAAoBG,MAAM,EAAE;AAC9B,QAAA,MAAMC,WAAAA,CAAMC,GAAG,CAACL,mBAAAA,EAAqB,OAAOM,qBAAAA,GAAAA;YAC1C,MAAMC,QAAAA,GAAW,MAAMC,MAAAA,CAAOC,EAAE,CAACC,KAAK,CAACC,4BAAAA,CAAAA,CAAoBC,OAAO,CAAC;gBACjEC,MAAAA,EAAQ;AAAC,oBAAA,IAAA;AAAM,oBAAA;AAAe,iBAAA;gBAC9BC,KAAAA,EAAO;AACLf,oBAAAA,YAAAA,EAAcgB,4CAAAA,CAA6B;AAAEP,wBAAAA;qBAAO,EAAGF,qBAAAA;AACzD;AACF,aAAA,CAAA;AAEA,YAAA,IAAIC,QAAAA,EAAU;AACZ,gBAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACC,4BAAAA,CAAAA,CAAoBK,MAAM,CAAC;oBAC/CF,KAAAA,EAAO;AAAEG,wBAAAA,EAAAA,EAAIV,SAASU;AAAG,qBAAA;oBACzBC,IAAAA,EAAM;AACJnB,wBAAAA,YAAAA,EAAcQ,SAASR,YAAY,CAACoB,MAAM,CACxC,CAACC,iBAA4BA,cAAAA,KAAmBd,qBAAAA;AAEpD;AACF,iBAAA,CAAA;AACF,YAAA;AACF,QAAA,CAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-deleted-ct-in-workflows.mjs","sources":["../../../server/src/migrations/handle-deleted-ct-in-workflows.ts"],"sourcesContent":["import { difference, keys } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport { getWorkflowContentTypeFilter } from '../utils/review-workflows';\n\n/**\n * Remove CT references from workflows if the CT is deleted\n */\nasync function migrateDeletedCTInWorkflows({ oldContentTypes, contentTypes }: any) {\n const deletedContentTypes = difference(keys(oldContentTypes), keys(contentTypes)) ?? [];\n\n if (deletedContentTypes.length) {\n await async.map(deletedContentTypes, async (deletedContentTypeUID: unknown) => {\n const workflow = await strapi.db.query(WORKFLOW_MODEL_UID).findOne({\n select: ['id', 'contentTypes'],\n where: {\n contentTypes: getWorkflowContentTypeFilter({ strapi }, deletedContentTypeUID),\n },\n });\n\n if (workflow) {\n await strapi.db.query(WORKFLOW_MODEL_UID).update({\n where: { id: workflow.id },\n data: {\n contentTypes: workflow.contentTypes.filter(\n (contentTypeUID: unknown) => contentTypeUID !== deletedContentTypeUID\n ),\n },\n });\n }\n });\n }\n}\n\nexport default migrateDeletedCTInWorkflows;\n"],"names":["migrateDeletedCTInWorkflows","oldContentTypes","contentTypes","deletedContentTypes","difference","keys","length","async","map","deletedContentTypeUID","workflow","strapi","db","query","WORKFLOW_MODEL_UID","findOne","select","where","getWorkflowContentTypeFilter","update","id","data","filter","contentTypeUID"],"mappings":";;;;;AAKA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"handle-deleted-ct-in-workflows.mjs","sources":["../../../server/src/migrations/handle-deleted-ct-in-workflows.ts"],"sourcesContent":["import { difference, keys } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport { getWorkflowContentTypeFilter } from '../utils/review-workflows';\n\n/**\n * Remove CT references from workflows if the CT is deleted\n */\nasync function migrateDeletedCTInWorkflows({ oldContentTypes, contentTypes }: any) {\n const deletedContentTypes = difference(keys(oldContentTypes), keys(contentTypes)) ?? [];\n\n if (deletedContentTypes.length) {\n await async.map(deletedContentTypes, async (deletedContentTypeUID: unknown) => {\n const workflow = await strapi.db.query(WORKFLOW_MODEL_UID).findOne({\n select: ['id', 'contentTypes'],\n where: {\n contentTypes: getWorkflowContentTypeFilter({ strapi }, deletedContentTypeUID),\n },\n });\n\n if (workflow) {\n await strapi.db.query(WORKFLOW_MODEL_UID).update({\n where: { id: workflow.id },\n data: {\n contentTypes: workflow.contentTypes.filter(\n (contentTypeUID: unknown) => contentTypeUID !== deletedContentTypeUID\n ),\n },\n });\n }\n });\n }\n}\n\nexport default migrateDeletedCTInWorkflows;\n"],"names":["migrateDeletedCTInWorkflows","oldContentTypes","contentTypes","deletedContentTypes","difference","keys","length","async","map","deletedContentTypeUID","workflow","strapi","db","query","WORKFLOW_MODEL_UID","findOne","select","where","getWorkflowContentTypeFilter","update","id","data","filter","contentTypeUID"],"mappings":";;;;;AAKA;;AAEC,IACD,eAAeA,2BAAAA,CAA4B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AAC/E,IAAA,MAAMC,sBAAsBC,UAAAA,CAAWC,IAAAA,CAAKJ,eAAAA,CAAAA,EAAkBI,IAAAA,CAAKH,kBAAkB,EAAE;IAEvF,IAAIC,mBAAAA,CAAoBG,MAAM,EAAE;AAC9B,QAAA,MAAMC,KAAAA,CAAMC,GAAG,CAACL,mBAAAA,EAAqB,OAAOM,qBAAAA,GAAAA;YAC1C,MAAMC,QAAAA,GAAW,MAAMC,MAAAA,CAAOC,EAAE,CAACC,KAAK,CAACC,kBAAAA,CAAAA,CAAoBC,OAAO,CAAC;gBACjEC,MAAAA,EAAQ;AAAC,oBAAA,IAAA;AAAM,oBAAA;AAAe,iBAAA;gBAC9BC,KAAAA,EAAO;AACLf,oBAAAA,YAAAA,EAAcgB,4BAAAA,CAA6B;AAAEP,wBAAAA;qBAAO,EAAGF,qBAAAA;AACzD;AACF,aAAA,CAAA;AAEA,YAAA,IAAIC,QAAAA,EAAU;AACZ,gBAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACC,kBAAAA,CAAAA,CAAoBK,MAAM,CAAC;oBAC/CF,KAAAA,EAAO;AAAEG,wBAAAA,EAAAA,EAAIV,SAASU;AAAG,qBAAA;oBACzBC,IAAAA,EAAM;AACJnB,wBAAAA,YAAAA,EAAcQ,SAASR,YAAY,CAACoB,MAAM,CACxC,CAACC,iBAA4BA,cAAAA,KAAmBd,qBAAAA;AAEpD;AACF,iBAAA,CAAA;AACF,YAAA;AACF,QAAA,CAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiple-workflows.js","sources":["../../../server/src/migrations/multiple-workflows.ts"],"sourcesContent":["import { get, keys, pickBy, pipe } from 'lodash/fp';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\n\nasync function migrateWorkflowsContentTypes({ oldContentTypes, contentTypes }: any) {\n // Look for RW contentTypes attribute\n const hadContentTypes = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n const hasContentTypes = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n\n if (!hadContentTypes && hasContentTypes) {\n // Initialize contentTypes with an empty array and assign only to one\n // workflow the Content Types which were using Review Workflow before.\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({ data: { contentTypes: [] } });\n\n // Find Content Types which were using Review Workflow before\n const contentTypes = pipe([pickBy(get('options.reviewWorkflows')), keys])(oldContentTypes);\n\n if (contentTypes.length) {\n // Update only one workflow with the contentTypes\n // Before this release there was only one workflow, so this operation is safe.\n await strapi.db\n .query(WORKFLOW_MODEL_UID)\n .update({ where: { id: { $notNull: true } }, data: { contentTypes } });\n }\n }\n}\n\nexport default migrateWorkflowsContentTypes;\n"],"names":["migrateWorkflowsContentTypes","oldContentTypes","contentTypes","hadContentTypes","WORKFLOW_MODEL_UID","attributes","hasContentTypes","strapi","db","query","updateMany","data","pipe","pickBy","get","keys","length","update","where","id","$notNull"],"mappings":";;;;;AAGA,eAAeA,
|
|
1
|
+
{"version":3,"file":"multiple-workflows.js","sources":["../../../server/src/migrations/multiple-workflows.ts"],"sourcesContent":["import { get, keys, pickBy, pipe } from 'lodash/fp';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\n\nasync function migrateWorkflowsContentTypes({ oldContentTypes, contentTypes }: any) {\n // Look for RW contentTypes attribute\n const hadContentTypes = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n const hasContentTypes = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n\n if (!hadContentTypes && hasContentTypes) {\n // Initialize contentTypes with an empty array and assign only to one\n // workflow the Content Types which were using Review Workflow before.\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({ data: { contentTypes: [] } });\n\n // Find Content Types which were using Review Workflow before\n const contentTypes = pipe([pickBy(get('options.reviewWorkflows')), keys])(oldContentTypes);\n\n if (contentTypes.length) {\n // Update only one workflow with the contentTypes\n // Before this release there was only one workflow, so this operation is safe.\n await strapi.db\n .query(WORKFLOW_MODEL_UID)\n .update({ where: { id: { $notNull: true } }, data: { contentTypes } });\n }\n }\n}\n\nexport default migrateWorkflowsContentTypes;\n"],"names":["migrateWorkflowsContentTypes","oldContentTypes","contentTypes","hadContentTypes","WORKFLOW_MODEL_UID","attributes","hasContentTypes","strapi","db","query","updateMany","data","pipe","pickBy","get","keys","length","update","where","id","$notNull"],"mappings":";;;;;AAGA,eAAeA,4BAAAA,CAA6B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAEhF,IAAA,MAAMC,kBAAkB,CAAC,CAACF,kBAAkBG,4BAAAA,CAAmB,EAAEC,UAAAA,EAAYH,YAAAA;AAC7E,IAAA,MAAMI,kBAAkB,CAAC,CAACJ,eAAeE,4BAAAA,CAAmB,EAAEC,UAAAA,EAAYH,YAAAA;IAE1E,IAAI,CAACC,mBAAmBG,eAAAA,EAAiB;;;AAGvC,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACL,4BAAAA,CAAAA,CAAoBM,UAAU,CAAC;YAAEC,IAAAA,EAAM;AAAET,gBAAAA,YAAAA,EAAc;AAAG;AAAE,SAAA,CAAA;;AAGlF,QAAA,MAAMA,eAAeU,OAAAA,CAAK;AAACC,YAAAA,SAAAA,CAAOC,MAAAA,CAAI,yBAAA,CAAA,CAAA;AAA6BC,YAAAA;SAAK,CAAA,CAAEd,eAAAA,CAAAA;QAE1E,IAAIC,YAAAA,CAAac,MAAM,EAAE;;;AAGvB,YAAA,MAAMT,OAAOC,EAAE,CACZC,KAAK,CAACL,4BAAAA,CAAAA,CACNa,MAAM,CAAC;gBAAEC,KAAAA,EAAO;oBAAEC,EAAAA,EAAI;wBAAEC,QAAAA,EAAU;AAAK;AAAE,iBAAA;gBAAGT,IAAAA,EAAM;AAAET,oBAAAA;AAAa;AAAE,aAAA,CAAA;AACxE,QAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiple-workflows.mjs","sources":["../../../server/src/migrations/multiple-workflows.ts"],"sourcesContent":["import { get, keys, pickBy, pipe } from 'lodash/fp';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\n\nasync function migrateWorkflowsContentTypes({ oldContentTypes, contentTypes }: any) {\n // Look for RW contentTypes attribute\n const hadContentTypes = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n const hasContentTypes = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n\n if (!hadContentTypes && hasContentTypes) {\n // Initialize contentTypes with an empty array and assign only to one\n // workflow the Content Types which were using Review Workflow before.\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({ data: { contentTypes: [] } });\n\n // Find Content Types which were using Review Workflow before\n const contentTypes = pipe([pickBy(get('options.reviewWorkflows')), keys])(oldContentTypes);\n\n if (contentTypes.length) {\n // Update only one workflow with the contentTypes\n // Before this release there was only one workflow, so this operation is safe.\n await strapi.db\n .query(WORKFLOW_MODEL_UID)\n .update({ where: { id: { $notNull: true } }, data: { contentTypes } });\n }\n }\n}\n\nexport default migrateWorkflowsContentTypes;\n"],"names":["migrateWorkflowsContentTypes","oldContentTypes","contentTypes","hadContentTypes","WORKFLOW_MODEL_UID","attributes","hasContentTypes","strapi","db","query","updateMany","data","pipe","pickBy","get","keys","length","update","where","id","$notNull"],"mappings":";;;AAGA,eAAeA,
|
|
1
|
+
{"version":3,"file":"multiple-workflows.mjs","sources":["../../../server/src/migrations/multiple-workflows.ts"],"sourcesContent":["import { get, keys, pickBy, pipe } from 'lodash/fp';\nimport { WORKFLOW_MODEL_UID } from '../constants/workflows';\n\nasync function migrateWorkflowsContentTypes({ oldContentTypes, contentTypes }: any) {\n // Look for RW contentTypes attribute\n const hadContentTypes = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n const hasContentTypes = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.contentTypes;\n\n if (!hadContentTypes && hasContentTypes) {\n // Initialize contentTypes with an empty array and assign only to one\n // workflow the Content Types which were using Review Workflow before.\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({ data: { contentTypes: [] } });\n\n // Find Content Types which were using Review Workflow before\n const contentTypes = pipe([pickBy(get('options.reviewWorkflows')), keys])(oldContentTypes);\n\n if (contentTypes.length) {\n // Update only one workflow with the contentTypes\n // Before this release there was only one workflow, so this operation is safe.\n await strapi.db\n .query(WORKFLOW_MODEL_UID)\n .update({ where: { id: { $notNull: true } }, data: { contentTypes } });\n }\n }\n}\n\nexport default migrateWorkflowsContentTypes;\n"],"names":["migrateWorkflowsContentTypes","oldContentTypes","contentTypes","hadContentTypes","WORKFLOW_MODEL_UID","attributes","hasContentTypes","strapi","db","query","updateMany","data","pipe","pickBy","get","keys","length","update","where","id","$notNull"],"mappings":";;;AAGA,eAAeA,4BAAAA,CAA6B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAEhF,IAAA,MAAMC,kBAAkB,CAAC,CAACF,kBAAkBG,kBAAAA,CAAmB,EAAEC,UAAAA,EAAYH,YAAAA;AAC7E,IAAA,MAAMI,kBAAkB,CAAC,CAACJ,eAAeE,kBAAAA,CAAmB,EAAEC,UAAAA,EAAYH,YAAAA;IAE1E,IAAI,CAACC,mBAAmBG,eAAAA,EAAiB;;;AAGvC,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACL,kBAAAA,CAAAA,CAAoBM,UAAU,CAAC;YAAEC,IAAAA,EAAM;AAAET,gBAAAA,YAAAA,EAAc;AAAG;AAAE,SAAA,CAAA;;AAGlF,QAAA,MAAMA,eAAeU,IAAAA,CAAK;AAACC,YAAAA,MAAAA,CAAOC,GAAAA,CAAI,yBAAA,CAAA,CAAA;AAA6BC,YAAAA;SAAK,CAAA,CAAEd,eAAAA,CAAAA;QAE1E,IAAIC,YAAAA,CAAac,MAAM,EAAE;;;AAGvB,YAAA,MAAMT,OAAOC,EAAE,CACZC,KAAK,CAACL,kBAAAA,CAAAA,CACNa,MAAM,CAAC;gBAAEC,KAAAA,EAAO;oBAAEC,EAAAA,EAAI;wBAAEC,QAAAA,EAAU;AAAK;AAAE,iBAAA;gBAAGT,IAAAA,EAAM;AAAET,oBAAAA;AAAa;AAAE,aAAA,CAAA;AACxE,QAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-stages-default-color.js","sources":["../../../server/src/migrations/set-stages-default-color.ts"],"sourcesContent":["import { STAGE_DEFAULT_COLOR, STAGE_MODEL_UID } from '../constants/workflows';\n\n/**\n * Set the default color for stages if the color attribute was added\n */\nasync function migrateReviewWorkflowStagesColor({ oldContentTypes, contentTypes }: any) {\n // Look for CT's color attribute\n const hadColor = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n const hasColor = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n\n // Add the default stage color if color attribute was added\n if (!hadColor && hasColor) {\n await strapi.db.query(STAGE_MODEL_UID).updateMany({\n data: {\n color: STAGE_DEFAULT_COLOR,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowStagesColor;\n"],"names":["migrateReviewWorkflowStagesColor","oldContentTypes","contentTypes","hadColor","STAGE_MODEL_UID","attributes","color","hasColor","strapi","db","query","updateMany","data","STAGE_DEFAULT_COLOR"],"mappings":";;;;AAEA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-stages-default-color.js","sources":["../../../server/src/migrations/set-stages-default-color.ts"],"sourcesContent":["import { STAGE_DEFAULT_COLOR, STAGE_MODEL_UID } from '../constants/workflows';\n\n/**\n * Set the default color for stages if the color attribute was added\n */\nasync function migrateReviewWorkflowStagesColor({ oldContentTypes, contentTypes }: any) {\n // Look for CT's color attribute\n const hadColor = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n const hasColor = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n\n // Add the default stage color if color attribute was added\n if (!hadColor && hasColor) {\n await strapi.db.query(STAGE_MODEL_UID).updateMany({\n data: {\n color: STAGE_DEFAULT_COLOR,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowStagesColor;\n"],"names":["migrateReviewWorkflowStagesColor","oldContentTypes","contentTypes","hadColor","STAGE_MODEL_UID","attributes","color","hasColor","strapi","db","query","updateMany","data","STAGE_DEFAULT_COLOR"],"mappings":";;;;AAEA;;AAEC,IACD,eAAeA,gCAAAA,CAAiC,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAEpF,IAAA,MAAMC,WAAW,CAAC,CAACF,kBAAkBG,yBAAAA,CAAgB,EAAEC,UAAAA,EAAYC,KAAAA;AACnE,IAAA,MAAMC,WAAW,CAAC,CAACL,eAAeE,yBAAAA,CAAgB,EAAEC,UAAAA,EAAYC,KAAAA;;IAGhE,IAAI,CAACH,YAAYI,QAAAA,EAAU;AACzB,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACN,yBAAAA,CAAAA,CAAiBO,UAAU,CAAC;YAChDC,IAAAA,EAAM;gBACJN,KAAAA,EAAOO;AACT;AACF,SAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-stages-default-color.mjs","sources":["../../../server/src/migrations/set-stages-default-color.ts"],"sourcesContent":["import { STAGE_DEFAULT_COLOR, STAGE_MODEL_UID } from '../constants/workflows';\n\n/**\n * Set the default color for stages if the color attribute was added\n */\nasync function migrateReviewWorkflowStagesColor({ oldContentTypes, contentTypes }: any) {\n // Look for CT's color attribute\n const hadColor = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n const hasColor = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n\n // Add the default stage color if color attribute was added\n if (!hadColor && hasColor) {\n await strapi.db.query(STAGE_MODEL_UID).updateMany({\n data: {\n color: STAGE_DEFAULT_COLOR,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowStagesColor;\n"],"names":["migrateReviewWorkflowStagesColor","oldContentTypes","contentTypes","hadColor","STAGE_MODEL_UID","attributes","color","hasColor","strapi","db","query","updateMany","data","STAGE_DEFAULT_COLOR"],"mappings":";;AAEA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-stages-default-color.mjs","sources":["../../../server/src/migrations/set-stages-default-color.ts"],"sourcesContent":["import { STAGE_DEFAULT_COLOR, STAGE_MODEL_UID } from '../constants/workflows';\n\n/**\n * Set the default color for stages if the color attribute was added\n */\nasync function migrateReviewWorkflowStagesColor({ oldContentTypes, contentTypes }: any) {\n // Look for CT's color attribute\n const hadColor = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n const hasColor = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.color;\n\n // Add the default stage color if color attribute was added\n if (!hadColor && hasColor) {\n await strapi.db.query(STAGE_MODEL_UID).updateMany({\n data: {\n color: STAGE_DEFAULT_COLOR,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowStagesColor;\n"],"names":["migrateReviewWorkflowStagesColor","oldContentTypes","contentTypes","hadColor","STAGE_MODEL_UID","attributes","color","hasColor","strapi","db","query","updateMany","data","STAGE_DEFAULT_COLOR"],"mappings":";;AAEA;;AAEC,IACD,eAAeA,gCAAAA,CAAiC,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAEpF,IAAA,MAAMC,WAAW,CAAC,CAACF,kBAAkBG,eAAAA,CAAgB,EAAEC,UAAAA,EAAYC,KAAAA;AACnE,IAAA,MAAMC,WAAW,CAAC,CAACL,eAAeE,eAAAA,CAAgB,EAAEC,UAAAA,EAAYC,KAAAA;;IAGhE,IAAI,CAACH,YAAYI,QAAAA,EAAU;AACzB,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACN,eAAAA,CAAAA,CAAiBO,UAAU,CAAC;YAChDC,IAAAA,EAAM;gBACJN,KAAAA,EAAOO;AACT;AACF,SAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-stages-roles.js","sources":["../../../server/src/migrations/set-stages-roles.ts"],"sourcesContent":["import { STAGE_TRANSITION_UID, STAGE_MODEL_UID } from '../constants/workflows';\nimport { getService } from '../utils';\n\n/**\n * Migrate review workflow stages to have RBAC permissions for all roles.\n */\nasync function migrateReviewWorkflowStagesRoles({ oldContentTypes, contentTypes }: any) {\n const hadRolePermissions = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n const hasRolePermissions = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n\n // If the stage content type did not have permissions in the previous version\n // then we set the permissions of every stage to be every current role in the app.\n // This ensures consistent behaviour when upgrading to a strapi version with review workflows RBAC.\n if (!hadRolePermissions && hasRolePermissions) {\n const roleUID = 'admin::role';\n strapi.log.info(\n `Migrating all existing review workflow stages to have RBAC permissions for all ${roleUID}.`\n );\n\n const stagePermissionsService = getService('stage-permissions');\n\n const stages = await strapi.db.query(STAGE_MODEL_UID).findMany();\n const roles = await strapi.db.query(roleUID).findMany();\n\n // Collect the permissions to add and group them by stage id.\n const groupedPermissions = {} as any;\n roles\n .map((role) => role.id)\n .forEach((roleId) => {\n stages\n .map((stage) => stage.id)\n .forEach((stageId) => {\n if (!groupedPermissions[stageId]) {\n groupedPermissions[stageId] = [];\n }\n\n groupedPermissions[stageId].push({\n roleId,\n fromStage: stageId,\n action: STAGE_TRANSITION_UID,\n });\n });\n });\n\n for (const [stageId, permissions] of Object.entries(groupedPermissions)) {\n const numericalStageId = Number(stageId);\n\n if (Number.isNaN(numericalStageId)) {\n strapi.log.warn(\n `Unable to apply ${roleUID} migration for ${STAGE_MODEL_UID} with id ${stageId}. The stage does not have a numerical id.`\n );\n continue;\n }\n\n // Register the permissions for this stage\n const stagePermissions = await stagePermissionsService.registerMany(permissions);\n\n // Update the stage with its new permissions\n await strapi.db.query(STAGE_MODEL_UID).update({\n where: { id: numericalStageId },\n data: {\n permissions: stagePermissions.flat().map((permission: any) => permission.id),\n },\n });\n }\n }\n}\n\nexport default migrateReviewWorkflowStagesRoles;\n"],"names":["migrateReviewWorkflowStagesRoles","oldContentTypes","contentTypes","hadRolePermissions","STAGE_MODEL_UID","attributes","permissions","hasRolePermissions","roleUID","strapi","log","info","stagePermissionsService","getService","stages","db","query","findMany","roles","groupedPermissions","map","role","id","forEach","roleId","stage","stageId","push","fromStage","action","STAGE_TRANSITION_UID","Object","entries","numericalStageId","Number","isNaN","warn","stagePermissions","registerMany","update","where","data","flat","permission"],"mappings":";;;;;AAGA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-stages-roles.js","sources":["../../../server/src/migrations/set-stages-roles.ts"],"sourcesContent":["import { STAGE_TRANSITION_UID, STAGE_MODEL_UID } from '../constants/workflows';\nimport { getService } from '../utils';\n\n/**\n * Migrate review workflow stages to have RBAC permissions for all roles.\n */\nasync function migrateReviewWorkflowStagesRoles({ oldContentTypes, contentTypes }: any) {\n const hadRolePermissions = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n const hasRolePermissions = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n\n // If the stage content type did not have permissions in the previous version\n // then we set the permissions of every stage to be every current role in the app.\n // This ensures consistent behaviour when upgrading to a strapi version with review workflows RBAC.\n if (!hadRolePermissions && hasRolePermissions) {\n const roleUID = 'admin::role';\n strapi.log.info(\n `Migrating all existing review workflow stages to have RBAC permissions for all ${roleUID}.`\n );\n\n const stagePermissionsService = getService('stage-permissions');\n\n const stages = await strapi.db.query(STAGE_MODEL_UID).findMany();\n const roles = await strapi.db.query(roleUID).findMany();\n\n // Collect the permissions to add and group them by stage id.\n const groupedPermissions = {} as any;\n roles\n .map((role) => role.id)\n .forEach((roleId) => {\n stages\n .map((stage) => stage.id)\n .forEach((stageId) => {\n if (!groupedPermissions[stageId]) {\n groupedPermissions[stageId] = [];\n }\n\n groupedPermissions[stageId].push({\n roleId,\n fromStage: stageId,\n action: STAGE_TRANSITION_UID,\n });\n });\n });\n\n for (const [stageId, permissions] of Object.entries(groupedPermissions)) {\n const numericalStageId = Number(stageId);\n\n if (Number.isNaN(numericalStageId)) {\n strapi.log.warn(\n `Unable to apply ${roleUID} migration for ${STAGE_MODEL_UID} with id ${stageId}. The stage does not have a numerical id.`\n );\n continue;\n }\n\n // Register the permissions for this stage\n const stagePermissions = await stagePermissionsService.registerMany(permissions);\n\n // Update the stage with its new permissions\n await strapi.db.query(STAGE_MODEL_UID).update({\n where: { id: numericalStageId },\n data: {\n permissions: stagePermissions.flat().map((permission: any) => permission.id),\n },\n });\n }\n }\n}\n\nexport default migrateReviewWorkflowStagesRoles;\n"],"names":["migrateReviewWorkflowStagesRoles","oldContentTypes","contentTypes","hadRolePermissions","STAGE_MODEL_UID","attributes","permissions","hasRolePermissions","roleUID","strapi","log","info","stagePermissionsService","getService","stages","db","query","findMany","roles","groupedPermissions","map","role","id","forEach","roleId","stage","stageId","push","fromStage","action","STAGE_TRANSITION_UID","Object","entries","numericalStageId","Number","isNaN","warn","stagePermissions","registerMany","update","where","data","flat","permission"],"mappings":";;;;;AAGA;;AAEC,IACD,eAAeA,gCAAAA,CAAiC,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AACpF,IAAA,MAAMC,qBAAqB,CAAC,CAACF,kBAAkBG,yBAAAA,CAAgB,EAAEC,UAAAA,EAAYC,WAAAA;AAC7E,IAAA,MAAMC,qBAAqB,CAAC,CAACL,eAAeE,yBAAAA,CAAgB,EAAEC,UAAAA,EAAYC,WAAAA;;;;IAK1E,IAAI,CAACH,sBAAsBI,kBAAAA,EAAoB;AAC7C,QAAA,MAAMC,OAAAA,GAAU,aAAA;QAChBC,MAAAA,CAAOC,GAAG,CAACC,IAAI,CACb,CAAC,+EAA+E,EAAEH,OAAAA,CAAQ,CAAC,CAAC,CAAA;AAG9F,QAAA,MAAMI,0BAA0BC,gBAAAA,CAAW,mBAAA,CAAA;QAE3C,MAAMC,MAAAA,GAAS,MAAML,MAAAA,CAAOM,EAAE,CAACC,KAAK,CAACZ,2BAAiBa,QAAQ,EAAA;QAC9D,MAAMC,KAAAA,GAAQ,MAAMT,MAAAA,CAAOM,EAAE,CAACC,KAAK,CAACR,SAASS,QAAQ,EAAA;;AAGrD,QAAA,MAAME,qBAAqB,EAAC;QAC5BD,KAAAA,CACGE,GAAG,CAAC,CAACC,IAAAA,GAASA,KAAKC,EAAE,CAAA,CACrBC,OAAO,CAAC,CAACC,MAAAA,GAAAA;YACRV,MAAAA,CACGM,GAAG,CAAC,CAACK,KAAAA,GAAUA,MAAMH,EAAE,CAAA,CACvBC,OAAO,CAAC,CAACG,OAAAA,GAAAA;AACR,gBAAA,IAAI,CAACP,kBAAkB,CAACO,OAAAA,CAAQ,EAAE;oBAChCP,kBAAkB,CAACO,OAAAA,CAAQ,GAAG,EAAE;AAClC,gBAAA;AAEAP,gBAAAA,kBAAkB,CAACO,OAAAA,CAAQ,CAACC,IAAI,CAAC;AAC/BH,oBAAAA,MAAAA;oBACAI,SAAAA,EAAWF,OAAAA;oBACXG,MAAAA,EAAQC;AACV,iBAAA,CAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA;QAEF,KAAK,MAAM,CAACJ,OAAAA,EAASpB,WAAAA,CAAY,IAAIyB,MAAAA,CAAOC,OAAO,CAACb,kBAAAA,CAAAA,CAAqB;AACvE,YAAA,MAAMc,mBAAmBC,MAAAA,CAAOR,OAAAA,CAAAA;YAEhC,IAAIQ,MAAAA,CAAOC,KAAK,CAACF,gBAAAA,CAAAA,EAAmB;AAClCxB,gBAAAA,MAAAA,CAAOC,GAAG,CAAC0B,IAAI,CACb,CAAC,gBAAgB,EAAE5B,OAAAA,CAAQ,eAAe,EAAEJ,yBAAAA,CAAgB,SAAS,EAAEsB,OAAAA,CAAQ,yCAAyC,CAAC,CAAA;AAE3H,gBAAA;AACF,YAAA;;AAGA,YAAA,MAAMW,gBAAAA,GAAmB,MAAMzB,uBAAAA,CAAwB0B,YAAY,CAAChC,WAAAA,CAAAA;;AAGpE,YAAA,MAAMG,OAAOM,EAAE,CAACC,KAAK,CAACZ,yBAAAA,CAAAA,CAAiBmC,MAAM,CAAC;gBAC5CC,KAAAA,EAAO;oBAAElB,EAAAA,EAAIW;AAAiB,iBAAA;gBAC9BQ,IAAAA,EAAM;oBACJnC,WAAAA,EAAa+B,gBAAAA,CAAiBK,IAAI,EAAA,CAAGtB,GAAG,CAAC,CAACuB,UAAAA,GAAoBA,WAAWrB,EAAE;AAC7E;AACF,aAAA,CAAA;AACF,QAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-stages-roles.mjs","sources":["../../../server/src/migrations/set-stages-roles.ts"],"sourcesContent":["import { STAGE_TRANSITION_UID, STAGE_MODEL_UID } from '../constants/workflows';\nimport { getService } from '../utils';\n\n/**\n * Migrate review workflow stages to have RBAC permissions for all roles.\n */\nasync function migrateReviewWorkflowStagesRoles({ oldContentTypes, contentTypes }: any) {\n const hadRolePermissions = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n const hasRolePermissions = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n\n // If the stage content type did not have permissions in the previous version\n // then we set the permissions of every stage to be every current role in the app.\n // This ensures consistent behaviour when upgrading to a strapi version with review workflows RBAC.\n if (!hadRolePermissions && hasRolePermissions) {\n const roleUID = 'admin::role';\n strapi.log.info(\n `Migrating all existing review workflow stages to have RBAC permissions for all ${roleUID}.`\n );\n\n const stagePermissionsService = getService('stage-permissions');\n\n const stages = await strapi.db.query(STAGE_MODEL_UID).findMany();\n const roles = await strapi.db.query(roleUID).findMany();\n\n // Collect the permissions to add and group them by stage id.\n const groupedPermissions = {} as any;\n roles\n .map((role) => role.id)\n .forEach((roleId) => {\n stages\n .map((stage) => stage.id)\n .forEach((stageId) => {\n if (!groupedPermissions[stageId]) {\n groupedPermissions[stageId] = [];\n }\n\n groupedPermissions[stageId].push({\n roleId,\n fromStage: stageId,\n action: STAGE_TRANSITION_UID,\n });\n });\n });\n\n for (const [stageId, permissions] of Object.entries(groupedPermissions)) {\n const numericalStageId = Number(stageId);\n\n if (Number.isNaN(numericalStageId)) {\n strapi.log.warn(\n `Unable to apply ${roleUID} migration for ${STAGE_MODEL_UID} with id ${stageId}. The stage does not have a numerical id.`\n );\n continue;\n }\n\n // Register the permissions for this stage\n const stagePermissions = await stagePermissionsService.registerMany(permissions);\n\n // Update the stage with its new permissions\n await strapi.db.query(STAGE_MODEL_UID).update({\n where: { id: numericalStageId },\n data: {\n permissions: stagePermissions.flat().map((permission: any) => permission.id),\n },\n });\n }\n }\n}\n\nexport default migrateReviewWorkflowStagesRoles;\n"],"names":["migrateReviewWorkflowStagesRoles","oldContentTypes","contentTypes","hadRolePermissions","STAGE_MODEL_UID","attributes","permissions","hasRolePermissions","roleUID","strapi","log","info","stagePermissionsService","getService","stages","db","query","findMany","roles","groupedPermissions","map","role","id","forEach","roleId","stage","stageId","push","fromStage","action","STAGE_TRANSITION_UID","Object","entries","numericalStageId","Number","isNaN","warn","stagePermissions","registerMany","update","where","data","flat","permission"],"mappings":";;;AAGA;;AAEC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-stages-roles.mjs","sources":["../../../server/src/migrations/set-stages-roles.ts"],"sourcesContent":["import { STAGE_TRANSITION_UID, STAGE_MODEL_UID } from '../constants/workflows';\nimport { getService } from '../utils';\n\n/**\n * Migrate review workflow stages to have RBAC permissions for all roles.\n */\nasync function migrateReviewWorkflowStagesRoles({ oldContentTypes, contentTypes }: any) {\n const hadRolePermissions = !!oldContentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n const hasRolePermissions = !!contentTypes?.[STAGE_MODEL_UID]?.attributes?.permissions;\n\n // If the stage content type did not have permissions in the previous version\n // then we set the permissions of every stage to be every current role in the app.\n // This ensures consistent behaviour when upgrading to a strapi version with review workflows RBAC.\n if (!hadRolePermissions && hasRolePermissions) {\n const roleUID = 'admin::role';\n strapi.log.info(\n `Migrating all existing review workflow stages to have RBAC permissions for all ${roleUID}.`\n );\n\n const stagePermissionsService = getService('stage-permissions');\n\n const stages = await strapi.db.query(STAGE_MODEL_UID).findMany();\n const roles = await strapi.db.query(roleUID).findMany();\n\n // Collect the permissions to add and group them by stage id.\n const groupedPermissions = {} as any;\n roles\n .map((role) => role.id)\n .forEach((roleId) => {\n stages\n .map((stage) => stage.id)\n .forEach((stageId) => {\n if (!groupedPermissions[stageId]) {\n groupedPermissions[stageId] = [];\n }\n\n groupedPermissions[stageId].push({\n roleId,\n fromStage: stageId,\n action: STAGE_TRANSITION_UID,\n });\n });\n });\n\n for (const [stageId, permissions] of Object.entries(groupedPermissions)) {\n const numericalStageId = Number(stageId);\n\n if (Number.isNaN(numericalStageId)) {\n strapi.log.warn(\n `Unable to apply ${roleUID} migration for ${STAGE_MODEL_UID} with id ${stageId}. The stage does not have a numerical id.`\n );\n continue;\n }\n\n // Register the permissions for this stage\n const stagePermissions = await stagePermissionsService.registerMany(permissions);\n\n // Update the stage with its new permissions\n await strapi.db.query(STAGE_MODEL_UID).update({\n where: { id: numericalStageId },\n data: {\n permissions: stagePermissions.flat().map((permission: any) => permission.id),\n },\n });\n }\n }\n}\n\nexport default migrateReviewWorkflowStagesRoles;\n"],"names":["migrateReviewWorkflowStagesRoles","oldContentTypes","contentTypes","hadRolePermissions","STAGE_MODEL_UID","attributes","permissions","hasRolePermissions","roleUID","strapi","log","info","stagePermissionsService","getService","stages","db","query","findMany","roles","groupedPermissions","map","role","id","forEach","roleId","stage","stageId","push","fromStage","action","STAGE_TRANSITION_UID","Object","entries","numericalStageId","Number","isNaN","warn","stagePermissions","registerMany","update","where","data","flat","permission"],"mappings":";;;AAGA;;AAEC,IACD,eAAeA,gCAAAA,CAAiC,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AACpF,IAAA,MAAMC,qBAAqB,CAAC,CAACF,kBAAkBG,eAAAA,CAAgB,EAAEC,UAAAA,EAAYC,WAAAA;AAC7E,IAAA,MAAMC,qBAAqB,CAAC,CAACL,eAAeE,eAAAA,CAAgB,EAAEC,UAAAA,EAAYC,WAAAA;;;;IAK1E,IAAI,CAACH,sBAAsBI,kBAAAA,EAAoB;AAC7C,QAAA,MAAMC,OAAAA,GAAU,aAAA;QAChBC,MAAAA,CAAOC,GAAG,CAACC,IAAI,CACb,CAAC,+EAA+E,EAAEH,OAAAA,CAAQ,CAAC,CAAC,CAAA;AAG9F,QAAA,MAAMI,0BAA0BC,UAAAA,CAAW,mBAAA,CAAA;QAE3C,MAAMC,MAAAA,GAAS,MAAML,MAAAA,CAAOM,EAAE,CAACC,KAAK,CAACZ,iBAAiBa,QAAQ,EAAA;QAC9D,MAAMC,KAAAA,GAAQ,MAAMT,MAAAA,CAAOM,EAAE,CAACC,KAAK,CAACR,SAASS,QAAQ,EAAA;;AAGr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AAAiB,iBAAA;gBAC9BQ,IAAAA,EAAM;oBACJnC,WAAAA,EAAa+B,gBAAAA,CAAiBK,IAAI,EAAA,CAAGtB,GAAG,CAAC,CAACuB,UAAAA,GAAoBA,WAAWrB,EAAE;AAC7E;AACF,aAAA,CAAA;AACF,QAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-workflow-default-name.js","sources":["../../../server/src/migrations/set-workflow-default-name.ts"],"sourcesContent":["import { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport defaultWorkflow from '../constants/default-workflow.json';\n\n/**\n * Multiple workflows introduced the ability to name a workflow.\n * This migration adds the default workflow name if the name attribute was added.\n */\nasync function migrateReviewWorkflowName({ oldContentTypes, contentTypes }: any) {\n // Look for RW name attribute\n const hadName = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n const hasName = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n\n // Add the default workflow name if name attribute was added\n if (!hadName && hasName) {\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({\n where: {\n name: { $null: true },\n },\n data: {\n name: defaultWorkflow.name,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowName;\n"],"names":["migrateReviewWorkflowName","oldContentTypes","contentTypes","hadName","WORKFLOW_MODEL_UID","attributes","name","hasName","strapi","db","query","updateMany","where","$null","data","defaultWorkflow"],"mappings":";;;;;AAGA;;;AAGC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-workflow-default-name.js","sources":["../../../server/src/migrations/set-workflow-default-name.ts"],"sourcesContent":["import { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport defaultWorkflow from '../constants/default-workflow.json';\n\n/**\n * Multiple workflows introduced the ability to name a workflow.\n * This migration adds the default workflow name if the name attribute was added.\n */\nasync function migrateReviewWorkflowName({ oldContentTypes, contentTypes }: any) {\n // Look for RW name attribute\n const hadName = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n const hasName = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n\n // Add the default workflow name if name attribute was added\n if (!hadName && hasName) {\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({\n where: {\n name: { $null: true },\n },\n data: {\n name: defaultWorkflow.name,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowName;\n"],"names":["migrateReviewWorkflowName","oldContentTypes","contentTypes","hadName","WORKFLOW_MODEL_UID","attributes","name","hasName","strapi","db","query","updateMany","where","$null","data","defaultWorkflow"],"mappings":";;;;;AAGA;;;AAGC,IACD,eAAeA,yBAAAA,CAA0B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAE7E,IAAA,MAAMC,UAAU,CAAC,CAACF,kBAAkBG,4BAAAA,CAAmB,EAAEC,UAAAA,EAAYC,IAAAA;AACrE,IAAA,MAAMC,UAAU,CAAC,CAACL,eAAeE,4BAAAA,CAAmB,EAAEC,UAAAA,EAAYC,IAAAA;;IAGlE,IAAI,CAACH,WAAWI,OAAAA,EAAS;AACvB,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACN,4BAAAA,CAAAA,CAAoBO,UAAU,CAAC;YACnDC,KAAAA,EAAO;gBACLN,IAAAA,EAAM;oBAAEO,KAAAA,EAAO;AAAK;AACtB,aAAA;YACAC,IAAAA,EAAM;AACJR,gBAAAA,IAAAA,EAAMS,wBAAgBT;AACxB;AACF,SAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-workflow-default-name.mjs","sources":["../../../server/src/migrations/set-workflow-default-name.ts"],"sourcesContent":["import { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport defaultWorkflow from '../constants/default-workflow.json';\n\n/**\n * Multiple workflows introduced the ability to name a workflow.\n * This migration adds the default workflow name if the name attribute was added.\n */\nasync function migrateReviewWorkflowName({ oldContentTypes, contentTypes }: any) {\n // Look for RW name attribute\n const hadName = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n const hasName = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n\n // Add the default workflow name if name attribute was added\n if (!hadName && hasName) {\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({\n where: {\n name: { $null: true },\n },\n data: {\n name: defaultWorkflow.name,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowName;\n"],"names":["migrateReviewWorkflowName","oldContentTypes","contentTypes","hadName","WORKFLOW_MODEL_UID","attributes","name","hasName","strapi","db","query","updateMany","where","$null","data","defaultWorkflow"],"mappings":";;;AAGA;;;AAGC,IACD,eAAeA,
|
|
1
|
+
{"version":3,"file":"set-workflow-default-name.mjs","sources":["../../../server/src/migrations/set-workflow-default-name.ts"],"sourcesContent":["import { WORKFLOW_MODEL_UID } from '../constants/workflows';\nimport defaultWorkflow from '../constants/default-workflow.json';\n\n/**\n * Multiple workflows introduced the ability to name a workflow.\n * This migration adds the default workflow name if the name attribute was added.\n */\nasync function migrateReviewWorkflowName({ oldContentTypes, contentTypes }: any) {\n // Look for RW name attribute\n const hadName = !!oldContentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n const hasName = !!contentTypes?.[WORKFLOW_MODEL_UID]?.attributes?.name;\n\n // Add the default workflow name if name attribute was added\n if (!hadName && hasName) {\n await strapi.db.query(WORKFLOW_MODEL_UID).updateMany({\n where: {\n name: { $null: true },\n },\n data: {\n name: defaultWorkflow.name,\n },\n });\n }\n}\n\nexport default migrateReviewWorkflowName;\n"],"names":["migrateReviewWorkflowName","oldContentTypes","contentTypes","hadName","WORKFLOW_MODEL_UID","attributes","name","hasName","strapi","db","query","updateMany","where","$null","data","defaultWorkflow"],"mappings":";;;AAGA;;;AAGC,IACD,eAAeA,yBAAAA,CAA0B,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;;AAE7E,IAAA,MAAMC,UAAU,CAAC,CAACF,kBAAkBG,kBAAAA,CAAmB,EAAEC,UAAAA,EAAYC,IAAAA;AACrE,IAAA,MAAMC,UAAU,CAAC,CAACL,eAAeE,kBAAAA,CAAmB,EAAEC,UAAAA,EAAYC,IAAAA;;IAGlE,IAAI,CAACH,WAAWI,OAAAA,EAAS;AACvB,QAAA,MAAMC,OAAOC,EAAE,CAACC,KAAK,CAACN,kBAAAA,CAAAA,CAAoBO,UAAU,CAAC;YACnDC,KAAAA,EAAO;gBACLN,IAAAA,EAAM;oBAAEO,KAAAA,EAAO;AAAK;AACtB,aAAA;YACAC,IAAAA,EAAM;AACJR,gBAAAA,IAAAA,EAAMS,gBAAgBT;AACxB;AACF,SAAA,CAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shorten-stage-attribute.js","sources":["../../../server/src/migrations/shorten-stage-attribute.ts"],"sourcesContent":["import semver from 'semver';\nimport { getOr } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { STAGE_MODEL_UID } from '../constants/workflows';\n\nfunction checkVersionThreshold(\n startVersion: string,\n currentVersion: string,\n thresholdVersion: string\n) {\n return semver.gte(currentVersion, thresholdVersion) && semver.lt(startVersion, thresholdVersion);\n}\n\n/**\n * Shorten strapi stage name\n */\nasync function migrateStageAttribute({ oldContentTypes, contentTypes }: any) {\n const getRWVersion = getOr('0.0.0', `${STAGE_MODEL_UID}.options.version`);\n const oldRWVersion = getRWVersion(oldContentTypes);\n const currentRWVersion = getRWVersion(contentTypes);\n\n const migrationNeeded = checkVersionThreshold(oldRWVersion, currentRWVersion, '1.1.0');\n\n // TODO: Find tables with something else than `findTables` function\n // if (migrationNeeded) {\n // const oldAttributeTableName = 'strapi_review_workflows_stage';\n // const newAttributeTableName = 'strapi_stage';\n // // const tables = await findTables({ strapi }, new RegExp(oldAttributeTableName));\n\n // await async.map(tables, async (tableName: string) => {\n // const newTableName = tableName.replace(oldAttributeTableName, newAttributeTableName);\n // const alreadyHasNextTable = await strapi.db.connection.schema.hasTable(newTableName);\n\n // // The table can be already created but empty. In order to rename the old one, we need to drop the previously created empty one.\n // if (alreadyHasNextTable) {\n // const dataInTable = await strapi.db.connection(newTableName).select().limit(1);\n // if (!dataInTable.length) {\n // await strapi.db.connection.schema.dropTable(newTableName);\n // }\n // }\n\n // try {\n // await strapi.db.connection.schema.renameTable(tableName, newTableName);\n // } catch (e: any) {\n // strapi.log.warn(\n // `An error occurred during the migration of ${tableName} table to ${newTableName}.\\nIf ${newTableName} already exists, migration can't be done automatically.`\n // );\n // strapi.log.warn(e.message);\n // }\n // });\n // }\n}\n\nexport default migrateStageAttribute;\n"],"names":["checkVersionThreshold","startVersion","currentVersion","thresholdVersion","semver","gte","lt","migrateStageAttribute","oldContentTypes","contentTypes","getRWVersion","getOr","STAGE_MODEL_UID","oldRWVersion","currentRWVersion"],"mappings":";;;;;;AAKA,SAASA,
|
|
1
|
+
{"version":3,"file":"shorten-stage-attribute.js","sources":["../../../server/src/migrations/shorten-stage-attribute.ts"],"sourcesContent":["import semver from 'semver';\nimport { getOr } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { STAGE_MODEL_UID } from '../constants/workflows';\n\nfunction checkVersionThreshold(\n startVersion: string,\n currentVersion: string,\n thresholdVersion: string\n) {\n return semver.gte(currentVersion, thresholdVersion) && semver.lt(startVersion, thresholdVersion);\n}\n\n/**\n * Shorten strapi stage name\n */\nasync function migrateStageAttribute({ oldContentTypes, contentTypes }: any) {\n const getRWVersion = getOr('0.0.0', `${STAGE_MODEL_UID}.options.version`);\n const oldRWVersion = getRWVersion(oldContentTypes);\n const currentRWVersion = getRWVersion(contentTypes);\n\n const migrationNeeded = checkVersionThreshold(oldRWVersion, currentRWVersion, '1.1.0');\n\n // TODO: Find tables with something else than `findTables` function\n // if (migrationNeeded) {\n // const oldAttributeTableName = 'strapi_review_workflows_stage';\n // const newAttributeTableName = 'strapi_stage';\n // // const tables = await findTables({ strapi }, new RegExp(oldAttributeTableName));\n\n // await async.map(tables, async (tableName: string) => {\n // const newTableName = tableName.replace(oldAttributeTableName, newAttributeTableName);\n // const alreadyHasNextTable = await strapi.db.connection.schema.hasTable(newTableName);\n\n // // The table can be already created but empty. In order to rename the old one, we need to drop the previously created empty one.\n // if (alreadyHasNextTable) {\n // const dataInTable = await strapi.db.connection(newTableName).select().limit(1);\n // if (!dataInTable.length) {\n // await strapi.db.connection.schema.dropTable(newTableName);\n // }\n // }\n\n // try {\n // await strapi.db.connection.schema.renameTable(tableName, newTableName);\n // } catch (e: any) {\n // strapi.log.warn(\n // `An error occurred during the migration of ${tableName} table to ${newTableName}.\\nIf ${newTableName} already exists, migration can't be done automatically.`\n // );\n // strapi.log.warn(e.message);\n // }\n // });\n // }\n}\n\nexport default migrateStageAttribute;\n"],"names":["checkVersionThreshold","startVersion","currentVersion","thresholdVersion","semver","gte","lt","migrateStageAttribute","oldContentTypes","contentTypes","getRWVersion","getOr","STAGE_MODEL_UID","oldRWVersion","currentRWVersion"],"mappings":";;;;;;AAKA,SAASA,qBAAAA,CACPC,YAAoB,EACpBC,cAAsB,EACtBC,gBAAwB,EAAA;IAExB,OAAOC,MAAAA,CAAOC,GAAG,CAACH,cAAAA,EAAgBC,qBAAqBC,MAAAA,CAAOE,EAAE,CAACL,YAAAA,EAAcE,gBAAAA,CAAAA;AACjF;AAEA;;AAEC,IACD,eAAeI,qBAAAA,CAAsB,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AACzE,IAAA,MAAMC,eAAeC,QAAAA,CAAM,OAAA,EAAS,CAAA,EAAGC,yBAAAA,CAAgB,gBAAgB,CAAC,CAAA;AACxE,IAAA,MAAMC,eAAeH,YAAAA,CAAaF,eAAAA,CAAAA;AAClC,IAAA,MAAMM,mBAAmBJ,YAAAA,CAAaD,YAAAA,CAAAA;IAEdT,qBAAAA,CAAsBa,YAAAA,EAAcC,gBAAAA,EAAkB,OAAA;AAE9E;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shorten-stage-attribute.mjs","sources":["../../../server/src/migrations/shorten-stage-attribute.ts"],"sourcesContent":["import semver from 'semver';\nimport { getOr } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { STAGE_MODEL_UID } from '../constants/workflows';\n\nfunction checkVersionThreshold(\n startVersion: string,\n currentVersion: string,\n thresholdVersion: string\n) {\n return semver.gte(currentVersion, thresholdVersion) && semver.lt(startVersion, thresholdVersion);\n}\n\n/**\n * Shorten strapi stage name\n */\nasync function migrateStageAttribute({ oldContentTypes, contentTypes }: any) {\n const getRWVersion = getOr('0.0.0', `${STAGE_MODEL_UID}.options.version`);\n const oldRWVersion = getRWVersion(oldContentTypes);\n const currentRWVersion = getRWVersion(contentTypes);\n\n const migrationNeeded = checkVersionThreshold(oldRWVersion, currentRWVersion, '1.1.0');\n\n // TODO: Find tables with something else than `findTables` function\n // if (migrationNeeded) {\n // const oldAttributeTableName = 'strapi_review_workflows_stage';\n // const newAttributeTableName = 'strapi_stage';\n // // const tables = await findTables({ strapi }, new RegExp(oldAttributeTableName));\n\n // await async.map(tables, async (tableName: string) => {\n // const newTableName = tableName.replace(oldAttributeTableName, newAttributeTableName);\n // const alreadyHasNextTable = await strapi.db.connection.schema.hasTable(newTableName);\n\n // // The table can be already created but empty. In order to rename the old one, we need to drop the previously created empty one.\n // if (alreadyHasNextTable) {\n // const dataInTable = await strapi.db.connection(newTableName).select().limit(1);\n // if (!dataInTable.length) {\n // await strapi.db.connection.schema.dropTable(newTableName);\n // }\n // }\n\n // try {\n // await strapi.db.connection.schema.renameTable(tableName, newTableName);\n // } catch (e: any) {\n // strapi.log.warn(\n // `An error occurred during the migration of ${tableName} table to ${newTableName}.\\nIf ${newTableName} already exists, migration can't be done automatically.`\n // );\n // strapi.log.warn(e.message);\n // }\n // });\n // }\n}\n\nexport default migrateStageAttribute;\n"],"names":["checkVersionThreshold","startVersion","currentVersion","thresholdVersion","semver","gte","lt","migrateStageAttribute","oldContentTypes","contentTypes","getRWVersion","getOr","STAGE_MODEL_UID","oldRWVersion","currentRWVersion"],"mappings":";;;;AAKA,SAASA,
|
|
1
|
+
{"version":3,"file":"shorten-stage-attribute.mjs","sources":["../../../server/src/migrations/shorten-stage-attribute.ts"],"sourcesContent":["import semver from 'semver';\nimport { getOr } from 'lodash/fp';\nimport { async } from '@strapi/utils';\nimport { STAGE_MODEL_UID } from '../constants/workflows';\n\nfunction checkVersionThreshold(\n startVersion: string,\n currentVersion: string,\n thresholdVersion: string\n) {\n return semver.gte(currentVersion, thresholdVersion) && semver.lt(startVersion, thresholdVersion);\n}\n\n/**\n * Shorten strapi stage name\n */\nasync function migrateStageAttribute({ oldContentTypes, contentTypes }: any) {\n const getRWVersion = getOr('0.0.0', `${STAGE_MODEL_UID}.options.version`);\n const oldRWVersion = getRWVersion(oldContentTypes);\n const currentRWVersion = getRWVersion(contentTypes);\n\n const migrationNeeded = checkVersionThreshold(oldRWVersion, currentRWVersion, '1.1.0');\n\n // TODO: Find tables with something else than `findTables` function\n // if (migrationNeeded) {\n // const oldAttributeTableName = 'strapi_review_workflows_stage';\n // const newAttributeTableName = 'strapi_stage';\n // // const tables = await findTables({ strapi }, new RegExp(oldAttributeTableName));\n\n // await async.map(tables, async (tableName: string) => {\n // const newTableName = tableName.replace(oldAttributeTableName, newAttributeTableName);\n // const alreadyHasNextTable = await strapi.db.connection.schema.hasTable(newTableName);\n\n // // The table can be already created but empty. In order to rename the old one, we need to drop the previously created empty one.\n // if (alreadyHasNextTable) {\n // const dataInTable = await strapi.db.connection(newTableName).select().limit(1);\n // if (!dataInTable.length) {\n // await strapi.db.connection.schema.dropTable(newTableName);\n // }\n // }\n\n // try {\n // await strapi.db.connection.schema.renameTable(tableName, newTableName);\n // } catch (e: any) {\n // strapi.log.warn(\n // `An error occurred during the migration of ${tableName} table to ${newTableName}.\\nIf ${newTableName} already exists, migration can't be done automatically.`\n // );\n // strapi.log.warn(e.message);\n // }\n // });\n // }\n}\n\nexport default migrateStageAttribute;\n"],"names":["checkVersionThreshold","startVersion","currentVersion","thresholdVersion","semver","gte","lt","migrateStageAttribute","oldContentTypes","contentTypes","getRWVersion","getOr","STAGE_MODEL_UID","oldRWVersion","currentRWVersion"],"mappings":";;;;AAKA,SAASA,qBAAAA,CACPC,YAAoB,EACpBC,cAAsB,EACtBC,gBAAwB,EAAA;IAExB,OAAOC,MAAAA,CAAOC,GAAG,CAACH,cAAAA,EAAgBC,qBAAqBC,MAAAA,CAAOE,EAAE,CAACL,YAAAA,EAAcE,gBAAAA,CAAAA;AACjF;AAEA;;AAEC,IACD,eAAeI,qBAAAA,CAAsB,EAAEC,eAAe,EAAEC,YAAY,EAAO,EAAA;AACzE,IAAA,MAAMC,eAAeC,KAAAA,CAAM,OAAA,EAAS,CAAA,EAAGC,eAAAA,CAAgB,gBAAgB,CAAC,CAAA;AACxE,IAAA,MAAMC,eAAeH,YAAAA,CAAaF,eAAAA,CAAAA;AAClC,IAAA,MAAMM,mBAAmBJ,YAAAA,CAAaD,YAAAA,CAAAA;IAEdT,qBAAAA,CAAsBa,YAAAA,EAAcC,gBAAAA,EAAkB,OAAA;AAE9E;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sources":["../../server/src/register.ts"],"sourcesContent":["import { defaultsDeep, filter, pipe, map } from 'lodash/fp';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport { getService, getAdminService } from './utils';\nimport migrateStageAttribute from './migrations/shorten-stage-attribute';\nimport migrateReviewWorkflowStagesColor from './migrations/set-stages-default-color';\nimport migrateReviewWorkflowStagesRoles from './migrations/set-stages-roles';\nimport migrateReviewWorkflowName from './migrations/set-workflow-default-name';\nimport migrateWorkflowsContentTypes from './migrations/multiple-workflows';\nimport migrateDeletedCTInWorkflows from './migrations/handle-deleted-ct-in-workflows';\nimport reviewWorkflowsMiddlewares from './middlewares/review-workflows';\n\nimport { getVisibleContentTypesUID, hasStageAttribute } from './utils/review-workflows';\n\nimport {\n ENTITY_STAGE_ATTRIBUTE,\n ENTITY_ASSIGNEE_ATTRIBUTE,\n STAGE_MODEL_UID,\n MAX_WORKFLOWS,\n MAX_STAGES_PER_WORKFLOW,\n} from './constants/workflows';\n\nconst setRelation = (attributeName: any, target: any, contentType: any) => {\n Object.assign(contentType.attributes, {\n [attributeName]: {\n writable: true,\n private: false,\n configurable: false,\n visible: false,\n useJoinTable: true, // We want a join table to persist data when downgrading to CE\n type: 'relation',\n relation: 'oneToOne',\n target,\n },\n });\n\n return contentType;\n};\n\n/**\n * Add the stage and assignee attributes to content types\n */\nfunction extendReviewWorkflowContentTypes({ strapi }: { strapi: Core.Strapi }) {\n const contentTypeToExtend = getVisibleContentTypesUID(strapi.contentTypes);\n\n for (const contentTypeUID of contentTypeToExtend) {\n strapi.get('content-types').extend(contentTypeUID, (contentType: any) => {\n // Set Stage attribute\n setRelation(ENTITY_STAGE_ATTRIBUTE, STAGE_MODEL_UID, contentType);\n // Set Assignee attribute\n setRelation(ENTITY_ASSIGNEE_ATTRIBUTE, 'admin::user', contentType);\n });\n }\n}\n\n/**\n * Persist the stage & assignee attributes so they are not removed when downgrading to CE.\n *\n * TODO: V6 - Instead of persisting the join tables, always create the stage & assignee attributes, even in CE mode\n * It was decided in V4 & V5 to not expose them in CE (as they pollute the CTs) but it's not worth given the complexity this needs\n */\nfunction persistRWOnDowngrade({ strapi }: { strapi: Core.Strapi }) {\n const { removePersistedTablesWithSuffix, persistTables } = getAdminService('persist-tables');\n\n return async ({ contentTypes }: { contentTypes: Record<UID.ContentType, any> }) => {\n const getStageTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the stage join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const getAssigneeTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the assignee join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_ASSIGNEE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const enabledRWContentTypes = pipe([\n getVisibleContentTypesUID,\n filter((uid: UID.ContentType) => hasStageAttribute(contentTypes[uid])),\n ])(contentTypes);\n\n // Remove previously created join tables and persist the new ones\n const stageJoinTablesToPersist = enabledRWContentTypes.map(getStageTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_stage_lnk');\n await persistTables(stageJoinTablesToPersist);\n\n // Remove previously created join tables and persist the new ones\n const assigneeJoinTablesToPersist = enabledRWContentTypes.map(getAssigneeTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_assignee_lnk');\n await persistTables(assigneeJoinTablesToPersist);\n };\n}\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Data Migrations\n strapi.hook('strapi::content-types.beforeSync').register(migrateStageAttribute);\n strapi.hook('strapi::content-types.afterSync').register(persistRWOnDowngrade({ strapi }));\n strapi\n .hook('strapi::content-types.afterSync')\n .register(migrateReviewWorkflowStagesColor)\n .register(migrateReviewWorkflowStagesRoles)\n .register(migrateReviewWorkflowName)\n .register(migrateWorkflowsContentTypes)\n .register(migrateDeletedCTInWorkflows);\n\n // Middlewares\n reviewWorkflowsMiddlewares.contentTypeMiddleware(strapi);\n\n // Schema customization\n extendReviewWorkflowContentTypes({ strapi });\n\n // License limits\n const reviewWorkflowsOptions = defaultsDeep(\n {\n numberOfWorkflows: MAX_WORKFLOWS,\n stagesPerWorkflow: MAX_STAGES_PER_WORKFLOW,\n },\n strapi.ee.features.get('review-workflows')\n );\n const workflowsValidationService = getService('validation', { strapi });\n workflowsValidationService.register(reviewWorkflowsOptions);\n};\n"],"names":["setRelation","attributeName","target","contentType","Object","assign","attributes","writable","private","configurable","visible","useJoinTable","type","relation","extendReviewWorkflowContentTypes","strapi","contentTypeToExtend","getVisibleContentTypesUID","contentTypes","contentTypeUID","get","extend","ENTITY_STAGE_ATTRIBUTE","STAGE_MODEL_UID","ENTITY_ASSIGNEE_ATTRIBUTE","persistRWOnDowngrade","removePersistedTablesWithSuffix","persistTables","getAdminService","getStageTableToPersist","tableName","db","metadata","joinTableName","joinTable","name","dependsOn","getAssigneeTableToPersist","enabledRWContentTypes","pipe","filter","uid","hasStageAttribute","stageJoinTablesToPersist","map","assigneeJoinTablesToPersist","hook","register","migrateStageAttribute","migrateReviewWorkflowStagesColor","migrateReviewWorkflowStagesRoles","migrateReviewWorkflowName","migrateWorkflowsContentTypes","migrateDeletedCTInWorkflows","reviewWorkflowsMiddlewares","contentTypeMiddleware","reviewWorkflowsOptions","defaultsDeep","numberOfWorkflows","MAX_WORKFLOWS","stagesPerWorkflow","MAX_STAGES_PER_WORKFLOW","ee","features","workflowsValidationService","getService"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,WAAAA,GAAc,CAACC,aAAAA,EAAoBC,
|
|
1
|
+
{"version":3,"file":"register.js","sources":["../../server/src/register.ts"],"sourcesContent":["import { defaultsDeep, filter, pipe, map } from 'lodash/fp';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport { getService, getAdminService } from './utils';\nimport migrateStageAttribute from './migrations/shorten-stage-attribute';\nimport migrateReviewWorkflowStagesColor from './migrations/set-stages-default-color';\nimport migrateReviewWorkflowStagesRoles from './migrations/set-stages-roles';\nimport migrateReviewWorkflowName from './migrations/set-workflow-default-name';\nimport migrateWorkflowsContentTypes from './migrations/multiple-workflows';\nimport migrateDeletedCTInWorkflows from './migrations/handle-deleted-ct-in-workflows';\nimport reviewWorkflowsMiddlewares from './middlewares/review-workflows';\n\nimport { getVisibleContentTypesUID, hasStageAttribute } from './utils/review-workflows';\n\nimport {\n ENTITY_STAGE_ATTRIBUTE,\n ENTITY_ASSIGNEE_ATTRIBUTE,\n STAGE_MODEL_UID,\n MAX_WORKFLOWS,\n MAX_STAGES_PER_WORKFLOW,\n} from './constants/workflows';\n\nconst setRelation = (attributeName: any, target: any, contentType: any) => {\n Object.assign(contentType.attributes, {\n [attributeName]: {\n writable: true,\n private: false,\n configurable: false,\n visible: false,\n useJoinTable: true, // We want a join table to persist data when downgrading to CE\n type: 'relation',\n relation: 'oneToOne',\n target,\n },\n });\n\n return contentType;\n};\n\n/**\n * Add the stage and assignee attributes to content types\n */\nfunction extendReviewWorkflowContentTypes({ strapi }: { strapi: Core.Strapi }) {\n const contentTypeToExtend = getVisibleContentTypesUID(strapi.contentTypes);\n\n for (const contentTypeUID of contentTypeToExtend) {\n strapi.get('content-types').extend(contentTypeUID, (contentType: any) => {\n // Set Stage attribute\n setRelation(ENTITY_STAGE_ATTRIBUTE, STAGE_MODEL_UID, contentType);\n // Set Assignee attribute\n setRelation(ENTITY_ASSIGNEE_ATTRIBUTE, 'admin::user', contentType);\n });\n }\n}\n\n/**\n * Persist the stage & assignee attributes so they are not removed when downgrading to CE.\n *\n * TODO: V6 - Instead of persisting the join tables, always create the stage & assignee attributes, even in CE mode\n * It was decided in V4 & V5 to not expose them in CE (as they pollute the CTs) but it's not worth given the complexity this needs\n */\nfunction persistRWOnDowngrade({ strapi }: { strapi: Core.Strapi }) {\n const { removePersistedTablesWithSuffix, persistTables } = getAdminService('persist-tables');\n\n return async ({ contentTypes }: { contentTypes: Record<UID.ContentType, any> }) => {\n const getStageTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the stage join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const getAssigneeTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the assignee join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_ASSIGNEE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const enabledRWContentTypes = pipe([\n getVisibleContentTypesUID,\n filter((uid: UID.ContentType) => hasStageAttribute(contentTypes[uid])),\n ])(contentTypes);\n\n // Remove previously created join tables and persist the new ones\n const stageJoinTablesToPersist = enabledRWContentTypes.map(getStageTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_stage_lnk');\n await persistTables(stageJoinTablesToPersist);\n\n // Remove previously created join tables and persist the new ones\n const assigneeJoinTablesToPersist = enabledRWContentTypes.map(getAssigneeTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_assignee_lnk');\n await persistTables(assigneeJoinTablesToPersist);\n };\n}\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Data Migrations\n strapi.hook('strapi::content-types.beforeSync').register(migrateStageAttribute);\n strapi.hook('strapi::content-types.afterSync').register(persistRWOnDowngrade({ strapi }));\n strapi\n .hook('strapi::content-types.afterSync')\n .register(migrateReviewWorkflowStagesColor)\n .register(migrateReviewWorkflowStagesRoles)\n .register(migrateReviewWorkflowName)\n .register(migrateWorkflowsContentTypes)\n .register(migrateDeletedCTInWorkflows);\n\n // Middlewares\n reviewWorkflowsMiddlewares.contentTypeMiddleware(strapi);\n\n // Schema customization\n extendReviewWorkflowContentTypes({ strapi });\n\n // License limits\n const reviewWorkflowsOptions = defaultsDeep(\n {\n numberOfWorkflows: MAX_WORKFLOWS,\n stagesPerWorkflow: MAX_STAGES_PER_WORKFLOW,\n },\n strapi.ee.features.get('review-workflows')\n );\n const workflowsValidationService = getService('validation', { strapi });\n workflowsValidationService.register(reviewWorkflowsOptions);\n};\n"],"names":["setRelation","attributeName","target","contentType","Object","assign","attributes","writable","private","configurable","visible","useJoinTable","type","relation","extendReviewWorkflowContentTypes","strapi","contentTypeToExtend","getVisibleContentTypesUID","contentTypes","contentTypeUID","get","extend","ENTITY_STAGE_ATTRIBUTE","STAGE_MODEL_UID","ENTITY_ASSIGNEE_ATTRIBUTE","persistRWOnDowngrade","removePersistedTablesWithSuffix","persistTables","getAdminService","getStageTableToPersist","tableName","db","metadata","joinTableName","joinTable","name","dependsOn","getAssigneeTableToPersist","enabledRWContentTypes","pipe","filter","uid","hasStageAttribute","stageJoinTablesToPersist","map","assigneeJoinTablesToPersist","hook","register","migrateStageAttribute","migrateReviewWorkflowStagesColor","migrateReviewWorkflowStagesRoles","migrateReviewWorkflowName","migrateWorkflowsContentTypes","migrateDeletedCTInWorkflows","reviewWorkflowsMiddlewares","contentTypeMiddleware","reviewWorkflowsOptions","defaultsDeep","numberOfWorkflows","MAX_WORKFLOWS","stagesPerWorkflow","MAX_STAGES_PER_WORKFLOW","ee","features","workflowsValidationService","getService"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,WAAAA,GAAc,CAACC,aAAAA,EAAoBC,MAAAA,EAAaC,WAAAA,GAAAA;AACpDC,IAAAA,MAAAA,CAAOC,MAAM,CAACF,WAAAA,CAAYG,UAAU,EAAE;AACpC,QAAA,CAACL,gBAAgB;YACfM,QAAAA,EAAU,IAAA;YACVC,OAAAA,EAAS,KAAA;YACTC,YAAAA,EAAc,KAAA;YACdC,OAAAA,EAAS,KAAA;YACTC,YAAAA,EAAc,IAAA;YACdC,IAAAA,EAAM,UAAA;YACNC,QAAAA,EAAU,UAAA;AACVX,YAAAA;AACF;AACF,KAAA,CAAA;IAEA,OAAOC,WAAAA;AACT,CAAA;AAEA;;AAEC,IACD,SAASW,gCAAAA,CAAiC,EAAEC,MAAM,EAA2B,EAAA;IAC3E,MAAMC,mBAAAA,GAAsBC,2CAAAA,CAA0BF,MAAAA,CAAOG,YAAY,CAAA;IAEzE,KAAK,MAAMC,kBAAkBH,mBAAAA,CAAqB;AAChDD,QAAAA,MAAAA,CAA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BAAyBC,eAAAA,CAC7B;QACEC,iBAAAA,EAAmBC,uBAAAA;QACnBC,iBAAAA,EAAmBC;AACrB,KAAA,EACA9C,OAAO+C,EAAE,CAACC,QAAQ,CAAC3C,GAAG,CAAC,kBAAA,CAAA,CAAA;IAEzB,MAAM4C,0BAAAA,GAA6BC,iBAAW,YAAA,EAAc;AAAElD,QAAAA;AAAO,KAAA,CAAA;AACrEiD,IAAAA,0BAAAA,CAA2BjB,QAAQ,CAACS,sBAAAA,CAAAA;AACtC,CAAA;;;;"}
|
package/dist/server/register.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import migrateWorkflowsContentTypes from './migrations/multiple-workflows.mjs';
|
|
|
8
8
|
import migrateDeletedCTInWorkflows from './migrations/handle-deleted-ct-in-workflows.mjs';
|
|
9
9
|
import reviewWorkflowsMiddlewares from './middlewares/review-workflows.mjs';
|
|
10
10
|
import { getVisibleContentTypesUID, hasStageAttribute } from './utils/review-workflows.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { MAX_STAGES_PER_WORKFLOW, MAX_WORKFLOWS, ENTITY_STAGE_ATTRIBUTE, ENTITY_ASSIGNEE_ATTRIBUTE, STAGE_MODEL_UID } from './constants/workflows.mjs';
|
|
12
12
|
|
|
13
13
|
const setRelation = (attributeName, target, contentType)=>{
|
|
14
14
|
Object.assign(contentType.attributes, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.mjs","sources":["../../server/src/register.ts"],"sourcesContent":["import { defaultsDeep, filter, pipe, map } from 'lodash/fp';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport { getService, getAdminService } from './utils';\nimport migrateStageAttribute from './migrations/shorten-stage-attribute';\nimport migrateReviewWorkflowStagesColor from './migrations/set-stages-default-color';\nimport migrateReviewWorkflowStagesRoles from './migrations/set-stages-roles';\nimport migrateReviewWorkflowName from './migrations/set-workflow-default-name';\nimport migrateWorkflowsContentTypes from './migrations/multiple-workflows';\nimport migrateDeletedCTInWorkflows from './migrations/handle-deleted-ct-in-workflows';\nimport reviewWorkflowsMiddlewares from './middlewares/review-workflows';\n\nimport { getVisibleContentTypesUID, hasStageAttribute } from './utils/review-workflows';\n\nimport {\n ENTITY_STAGE_ATTRIBUTE,\n ENTITY_ASSIGNEE_ATTRIBUTE,\n STAGE_MODEL_UID,\n MAX_WORKFLOWS,\n MAX_STAGES_PER_WORKFLOW,\n} from './constants/workflows';\n\nconst setRelation = (attributeName: any, target: any, contentType: any) => {\n Object.assign(contentType.attributes, {\n [attributeName]: {\n writable: true,\n private: false,\n configurable: false,\n visible: false,\n useJoinTable: true, // We want a join table to persist data when downgrading to CE\n type: 'relation',\n relation: 'oneToOne',\n target,\n },\n });\n\n return contentType;\n};\n\n/**\n * Add the stage and assignee attributes to content types\n */\nfunction extendReviewWorkflowContentTypes({ strapi }: { strapi: Core.Strapi }) {\n const contentTypeToExtend = getVisibleContentTypesUID(strapi.contentTypes);\n\n for (const contentTypeUID of contentTypeToExtend) {\n strapi.get('content-types').extend(contentTypeUID, (contentType: any) => {\n // Set Stage attribute\n setRelation(ENTITY_STAGE_ATTRIBUTE, STAGE_MODEL_UID, contentType);\n // Set Assignee attribute\n setRelation(ENTITY_ASSIGNEE_ATTRIBUTE, 'admin::user', contentType);\n });\n }\n}\n\n/**\n * Persist the stage & assignee attributes so they are not removed when downgrading to CE.\n *\n * TODO: V6 - Instead of persisting the join tables, always create the stage & assignee attributes, even in CE mode\n * It was decided in V4 & V5 to not expose them in CE (as they pollute the CTs) but it's not worth given the complexity this needs\n */\nfunction persistRWOnDowngrade({ strapi }: { strapi: Core.Strapi }) {\n const { removePersistedTablesWithSuffix, persistTables } = getAdminService('persist-tables');\n\n return async ({ contentTypes }: { contentTypes: Record<UID.ContentType, any> }) => {\n const getStageTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the stage join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const getAssigneeTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the assignee join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_ASSIGNEE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const enabledRWContentTypes = pipe([\n getVisibleContentTypesUID,\n filter((uid: UID.ContentType) => hasStageAttribute(contentTypes[uid])),\n ])(contentTypes);\n\n // Remove previously created join tables and persist the new ones\n const stageJoinTablesToPersist = enabledRWContentTypes.map(getStageTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_stage_lnk');\n await persistTables(stageJoinTablesToPersist);\n\n // Remove previously created join tables and persist the new ones\n const assigneeJoinTablesToPersist = enabledRWContentTypes.map(getAssigneeTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_assignee_lnk');\n await persistTables(assigneeJoinTablesToPersist);\n };\n}\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Data Migrations\n strapi.hook('strapi::content-types.beforeSync').register(migrateStageAttribute);\n strapi.hook('strapi::content-types.afterSync').register(persistRWOnDowngrade({ strapi }));\n strapi\n .hook('strapi::content-types.afterSync')\n .register(migrateReviewWorkflowStagesColor)\n .register(migrateReviewWorkflowStagesRoles)\n .register(migrateReviewWorkflowName)\n .register(migrateWorkflowsContentTypes)\n .register(migrateDeletedCTInWorkflows);\n\n // Middlewares\n reviewWorkflowsMiddlewares.contentTypeMiddleware(strapi);\n\n // Schema customization\n extendReviewWorkflowContentTypes({ strapi });\n\n // License limits\n const reviewWorkflowsOptions = defaultsDeep(\n {\n numberOfWorkflows: MAX_WORKFLOWS,\n stagesPerWorkflow: MAX_STAGES_PER_WORKFLOW,\n },\n strapi.ee.features.get('review-workflows')\n );\n const workflowsValidationService = getService('validation', { strapi });\n workflowsValidationService.register(reviewWorkflowsOptions);\n};\n"],"names":["setRelation","attributeName","target","contentType","Object","assign","attributes","writable","private","configurable","visible","useJoinTable","type","relation","extendReviewWorkflowContentTypes","strapi","contentTypeToExtend","getVisibleContentTypesUID","contentTypes","contentTypeUID","get","extend","ENTITY_STAGE_ATTRIBUTE","STAGE_MODEL_UID","ENTITY_ASSIGNEE_ATTRIBUTE","persistRWOnDowngrade","removePersistedTablesWithSuffix","persistTables","getAdminService","getStageTableToPersist","tableName","db","metadata","joinTableName","joinTable","name","dependsOn","getAssigneeTableToPersist","enabledRWContentTypes","pipe","filter","uid","hasStageAttribute","stageJoinTablesToPersist","map","assigneeJoinTablesToPersist","hook","register","migrateStageAttribute","migrateReviewWorkflowStagesColor","migrateReviewWorkflowStagesRoles","migrateReviewWorkflowName","migrateWorkflowsContentTypes","migrateDeletedCTInWorkflows","reviewWorkflowsMiddlewares","contentTypeMiddleware","reviewWorkflowsOptions","defaultsDeep","numberOfWorkflows","MAX_WORKFLOWS","stagesPerWorkflow","MAX_STAGES_PER_WORKFLOW","ee","features","workflowsValidationService","getService"],"mappings":";;;;;;;;;;;;AAuBA,MAAMA,WAAAA,GAAc,CAACC,aAAAA,EAAoBC,
|
|
1
|
+
{"version":3,"file":"register.mjs","sources":["../../server/src/register.ts"],"sourcesContent":["import { defaultsDeep, filter, pipe, map } from 'lodash/fp';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport { getService, getAdminService } from './utils';\nimport migrateStageAttribute from './migrations/shorten-stage-attribute';\nimport migrateReviewWorkflowStagesColor from './migrations/set-stages-default-color';\nimport migrateReviewWorkflowStagesRoles from './migrations/set-stages-roles';\nimport migrateReviewWorkflowName from './migrations/set-workflow-default-name';\nimport migrateWorkflowsContentTypes from './migrations/multiple-workflows';\nimport migrateDeletedCTInWorkflows from './migrations/handle-deleted-ct-in-workflows';\nimport reviewWorkflowsMiddlewares from './middlewares/review-workflows';\n\nimport { getVisibleContentTypesUID, hasStageAttribute } from './utils/review-workflows';\n\nimport {\n ENTITY_STAGE_ATTRIBUTE,\n ENTITY_ASSIGNEE_ATTRIBUTE,\n STAGE_MODEL_UID,\n MAX_WORKFLOWS,\n MAX_STAGES_PER_WORKFLOW,\n} from './constants/workflows';\n\nconst setRelation = (attributeName: any, target: any, contentType: any) => {\n Object.assign(contentType.attributes, {\n [attributeName]: {\n writable: true,\n private: false,\n configurable: false,\n visible: false,\n useJoinTable: true, // We want a join table to persist data when downgrading to CE\n type: 'relation',\n relation: 'oneToOne',\n target,\n },\n });\n\n return contentType;\n};\n\n/**\n * Add the stage and assignee attributes to content types\n */\nfunction extendReviewWorkflowContentTypes({ strapi }: { strapi: Core.Strapi }) {\n const contentTypeToExtend = getVisibleContentTypesUID(strapi.contentTypes);\n\n for (const contentTypeUID of contentTypeToExtend) {\n strapi.get('content-types').extend(contentTypeUID, (contentType: any) => {\n // Set Stage attribute\n setRelation(ENTITY_STAGE_ATTRIBUTE, STAGE_MODEL_UID, contentType);\n // Set Assignee attribute\n setRelation(ENTITY_ASSIGNEE_ATTRIBUTE, 'admin::user', contentType);\n });\n }\n}\n\n/**\n * Persist the stage & assignee attributes so they are not removed when downgrading to CE.\n *\n * TODO: V6 - Instead of persisting the join tables, always create the stage & assignee attributes, even in CE mode\n * It was decided in V4 & V5 to not expose them in CE (as they pollute the CTs) but it's not worth given the complexity this needs\n */\nfunction persistRWOnDowngrade({ strapi }: { strapi: Core.Strapi }) {\n const { removePersistedTablesWithSuffix, persistTables } = getAdminService('persist-tables');\n\n return async ({ contentTypes }: { contentTypes: Record<UID.ContentType, any> }) => {\n const getStageTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the stage join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const getAssigneeTableToPersist = (contentTypeUID: UID.ContentType) => {\n // Persist the assignee join table\n const { attributes, tableName } = strapi.db.metadata.get(contentTypeUID) as any;\n const joinTableName = attributes[ENTITY_ASSIGNEE_ATTRIBUTE].joinTable.name;\n return {\n name: joinTableName,\n dependsOn: [{ name: tableName }],\n };\n };\n\n const enabledRWContentTypes = pipe([\n getVisibleContentTypesUID,\n filter((uid: UID.ContentType) => hasStageAttribute(contentTypes[uid])),\n ])(contentTypes);\n\n // Remove previously created join tables and persist the new ones\n const stageJoinTablesToPersist = enabledRWContentTypes.map(getStageTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_stage_lnk');\n await persistTables(stageJoinTablesToPersist);\n\n // Remove previously created join tables and persist the new ones\n const assigneeJoinTablesToPersist = enabledRWContentTypes.map(getAssigneeTableToPersist);\n await removePersistedTablesWithSuffix('_strapi_assignee_lnk');\n await persistTables(assigneeJoinTablesToPersist);\n };\n}\n\nexport default async ({ strapi }: { strapi: Core.Strapi }) => {\n // Data Migrations\n strapi.hook('strapi::content-types.beforeSync').register(migrateStageAttribute);\n strapi.hook('strapi::content-types.afterSync').register(persistRWOnDowngrade({ strapi }));\n strapi\n .hook('strapi::content-types.afterSync')\n .register(migrateReviewWorkflowStagesColor)\n .register(migrateReviewWorkflowStagesRoles)\n .register(migrateReviewWorkflowName)\n .register(migrateWorkflowsContentTypes)\n .register(migrateDeletedCTInWorkflows);\n\n // Middlewares\n reviewWorkflowsMiddlewares.contentTypeMiddleware(strapi);\n\n // Schema customization\n extendReviewWorkflowContentTypes({ strapi });\n\n // License limits\n const reviewWorkflowsOptions = defaultsDeep(\n {\n numberOfWorkflows: MAX_WORKFLOWS,\n stagesPerWorkflow: MAX_STAGES_PER_WORKFLOW,\n },\n strapi.ee.features.get('review-workflows')\n );\n const workflowsValidationService = getService('validation', { strapi });\n workflowsValidationService.register(reviewWorkflowsOptions);\n};\n"],"names":["setRelation","attributeName","target","contentType","Object","assign","attributes","writable","private","configurable","visible","useJoinTable","type","relation","extendReviewWorkflowContentTypes","strapi","contentTypeToExtend","getVisibleContentTypesUID","contentTypes","contentTypeUID","get","extend","ENTITY_STAGE_ATTRIBUTE","STAGE_MODEL_UID","ENTITY_ASSIGNEE_ATTRIBUTE","persistRWOnDowngrade","removePersistedTablesWithSuffix","persistTables","getAdminService","getStageTableToPersist","tableName","db","metadata","joinTableName","joinTable","name","dependsOn","getAssigneeTableToPersist","enabledRWContentTypes","pipe","filter","uid","hasStageAttribute","stageJoinTablesToPersist","map","assigneeJoinTablesToPersist","hook","register","migrateStageAttribute","migrateReviewWorkflowStagesColor","migrateReviewWorkflowStagesRoles","migrateReviewWorkflowName","migrateWorkflowsContentTypes","migrateDeletedCTInWorkflows","reviewWorkflowsMiddlewares","contentTypeMiddleware","reviewWorkflowsOptions","defaultsDeep","numberOfWorkflows","MAX_WORKFLOWS","stagesPerWorkflow","MAX_STAGES_PER_WORKFLOW","ee","features","workflowsValidationService","getService"],"mappings":";;;;;;;;;;;;AAuBA,MAAMA,WAAAA,GAAc,CAACC,aAAAA,EAAoBC,MAAAA,EAAaC,WAAAA,GAAAA;AACpDC,IAAAA,MAAAA,CAAOC,MAAM,CAACF,WAAAA,CAAYG,UAAU,EAAE;AACpC,QAAA,CAACL,gBAAgB;YACfM,QAAAA,EAAU,IAAA;YACVC,OAAAA,EAAS,KAAA;YACTC,YAAAA,EAAc,KAAA;YACdC,OAAAA,EAAS,KAAA;YACTC,YAAAA,EAAc,IAAA;YACdC,IAAAA,EAAM,UAAA;YACNC,QAAAA,EAAU,UAAA;AACVX,YAAAA;AACF;AACF,KAAA,CAAA;IAEA,OAAOC,WAAAA;AACT,CAAA;AAEA;;AAEC,IACD,SAASW,gCAAAA,CAAiC,EAAEC,MAAM,EAA2B,EAAA;IAC3E,MAAMC,mBAAAA,GAAsBC,yBAAAA,CAA0BF,MAAAA,CAAOG,YAAY,CAAA;IAEzE,KAAK,MAAMC,kBAAkBH,mBAAAA,CAAqB;AAChDD,QAAAA,MAAAA,CAAOK,GAAG,CAAC,eAAA,CAAA,CAAiBC,MAAM,CAACF,gBAAgB,CAAChB,WAAAA,GAAAA;;AAElDH,YAA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A9C,OAAO+C,EAAE,CAACC,QAAQ,CAAC3C,GAAG,CAAC,kBAAA,CAAA,CAAA;IAEzB,MAAM4C,0BAAAA,GAA6BC,WAAW,YAAA,EAAc;AAAElD,QAAAA;AAAO,KAAA,CAAA;AACrEiD,IAAAA,0BAAAA,CAA2BjB,QAAQ,CAACS,sBAAAA,CAAAA;AACtC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import reviewWorkflows from './review-workflows';\nimport homepage from '../homepage';\n\nexport default {\n 'review-workflows': reviewWorkflows,\n ...homepage.routes,\n};\n"],"names":["reviewWorkflows","homepage","routes"],"mappings":";;;;;AAGA,aAAe;IACb,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import reviewWorkflows from './review-workflows';\nimport homepage from '../homepage';\n\nexport default {\n 'review-workflows': reviewWorkflows,\n ...homepage.routes,\n};\n"],"names":["reviewWorkflows","homepage","routes"],"mappings":";;;;;AAGA,aAAe;IACb,kBAAA,EAAoBA,eAAAA;AACpB,IAAA,GAAGC,MAASC;AACd,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import reviewWorkflows from './review-workflows';\nimport homepage from '../homepage';\n\nexport default {\n 'review-workflows': reviewWorkflows,\n ...homepage.routes,\n};\n"],"names":["reviewWorkflows","homepage","routes"],"mappings":";;;AAGA,aAAe;IACb,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../server/src/routes/index.ts"],"sourcesContent":["import reviewWorkflows from './review-workflows';\nimport homepage from '../homepage';\n\nexport default {\n 'review-workflows': reviewWorkflows,\n ...homepage.routes,\n};\n"],"names":["reviewWorkflows","homepage","routes"],"mappings":";;;AAGA,aAAe;IACb,kBAAA,EAAoBA,eAAAA;AACpB,IAAA,GAAGC,SAASC;AACd,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflows.js","sources":["../../../server/src/routes/review-workflows.ts"],"sourcesContent":["import { enableFeatureMiddleware } from './utils';\n\nexport default {\n type: 'admin',\n routes: [\n // Review workflow\n {\n method: 'POST',\n path: '/workflows',\n handler: 'workflows.create',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.create'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/workflows/:id',\n handler: 'workflows.update',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.update'],\n },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/workflows/:id',\n handler: 'workflows.delete',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.delete'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows',\n handler: 'workflows.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages',\n handler: 'stages.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages/:id',\n handler: 'stages.findById',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',\n handler: 'stages.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stages',\n handler: 'stages.listAvailableStages',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/assignee',\n handler: 'assignees.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::users.read'],\n },\n },\n ],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","middlewares","enableFeatureMiddleware","policies","name","actions"],"mappings":";;;;AAEA,sBAAe;IACbA,
|
|
1
|
+
{"version":3,"file":"review-workflows.js","sources":["../../../server/src/routes/review-workflows.ts"],"sourcesContent":["import { enableFeatureMiddleware } from './utils';\n\nexport default {\n type: 'admin',\n routes: [\n // Review workflow\n {\n method: 'POST',\n path: '/workflows',\n handler: 'workflows.create',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.create'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/workflows/:id',\n handler: 'workflows.update',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.update'],\n },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/workflows/:id',\n handler: 'workflows.delete',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.delete'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows',\n handler: 'workflows.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages',\n handler: 'stages.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages/:id',\n handler: 'stages.findById',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',\n handler: 'stages.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stages',\n handler: 'stages.listAvailableStages',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/assignee',\n handler: 'assignees.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::users.read'],\n },\n },\n ],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","middlewares","enableFeatureMiddleware","policies","name","actions"],"mappings":";;;;AAEA,sBAAe;IACbA,IAAAA,EAAM,OAAA;IACNC,MAAAA,EAAQ;;AAEN,QAAA;YACEC,MAAAA,EAAQ,MAAA;YACRC,IAAAA,EAAM,YAAA;YACNC,OAAAA,EAAS,kBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,6BAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAAA,EAAM,uBAAA;wBACNJ,MAAAA,EAAQ;4BACNK,OAAAA,EAAS;AAAC,gCAAA;AAAiC;AAC7C;AACF;AACD;AACH;AACF,SAAA;AACA,QAAA;YACER,MAAAA,EAAQ,KAAA;YACRC,IAAAA,EAAM,gBAAA;YACNC,OAAAA,EAAS,kBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,6BAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAAA,EAAM,uBAAA;wBACNJ,MAAAA,EAAQ;4BACNK,OAAAA,EAAS;AAAC,gCAAA;AAAiC;AAC7C;AACF;AACD;AACH;AACF,SAAA;AACA,QAAA;YACER,MAAAA,EAAQ,QAAA;YACRC,IAAAA,EAAM,gBAAA;YACNC,OAAAA,EAAS,kBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,6BAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAAA,EAAM,uBAAA;wBACNJ,MAAAA,EAAQ;4BACNK,OAAAA,EAAS;AAAC,gCAAA;AAAiC;AAC7C;AACF;AACD;AACH;AACF,SAAA;AACA,QAAA;YACER,MAAAA,EAAQ,KAA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AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEN,MAAAA,EAAQ,KAAA;YACRC,IAAAA,EAAM,kEAAA;YACNC,OAAAA,EAAS,4BAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,6BAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AAAC,oBAAA;AAA8B;AAC3C;AACF,SAAA;AACA,QAAA;YACEN,MAAAA,EAAQ,KAAA;YACRC,IAAAA,EAAM,oEAAA;YACNC,OAAAA,EAAS,wBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,6BAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAAA,EAAM,uBAAA;wBACNJ,MAAAA,EAAQ;4BACNK,OAAAA,EAAS;AAAC,gCAAA;AAAoB;AAChC;AACF;AACD;AACH;AACF;AACD;AACH,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflows.mjs","sources":["../../../server/src/routes/review-workflows.ts"],"sourcesContent":["import { enableFeatureMiddleware } from './utils';\n\nexport default {\n type: 'admin',\n routes: [\n // Review workflow\n {\n method: 'POST',\n path: '/workflows',\n handler: 'workflows.create',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.create'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/workflows/:id',\n handler: 'workflows.update',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.update'],\n },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/workflows/:id',\n handler: 'workflows.delete',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.delete'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows',\n handler: 'workflows.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages',\n handler: 'stages.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages/:id',\n handler: 'stages.findById',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',\n handler: 'stages.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stages',\n handler: 'stages.listAvailableStages',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/assignee',\n handler: 'assignees.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::users.read'],\n },\n },\n ],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","middlewares","enableFeatureMiddleware","policies","name","actions"],"mappings":";;AAEA,sBAAe;IACbA,
|
|
1
|
+
{"version":3,"file":"review-workflows.mjs","sources":["../../../server/src/routes/review-workflows.ts"],"sourcesContent":["import { enableFeatureMiddleware } from './utils';\n\nexport default {\n type: 'admin',\n routes: [\n // Review workflow\n {\n method: 'POST',\n path: '/workflows',\n handler: 'workflows.create',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.create'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/workflows/:id',\n handler: 'workflows.update',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.update'],\n },\n },\n ],\n },\n },\n {\n method: 'DELETE',\n path: '/workflows/:id',\n handler: 'workflows.delete',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.delete'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows',\n handler: 'workflows.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages',\n handler: 'stages.find',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'GET',\n path: '/workflows/:workflow_id/stages/:id',\n handler: 'stages.findById',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::review-workflows.read'],\n },\n },\n ],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',\n handler: 'stages.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'GET',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/stages',\n handler: 'stages.listAvailableStages',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n {\n method: 'PUT',\n path: '/content-manager/(collection|single)-types/:model_uid/:id/assignee',\n handler: 'assignees.updateEntity',\n config: {\n middlewares: [enableFeatureMiddleware('review-workflows')],\n policies: [\n 'admin::isAuthenticatedAdmin',\n {\n name: 'admin::hasPermissions',\n config: {\n actions: ['admin::users.read'],\n },\n },\n ],\n },\n },\n ],\n};\n"],"names":["type","routes","method","path","handler","config","middlewares","enableFeatureMiddleware","policies","name","actions"],"mappings":";;AAEA,sBAAe;IACbA,IAAAA,EAAM,OAAA;IACNC,MAAAA,EAAQ;;AAEN,QAAA;YACEC,MAAAA,EAAQ,MAAA;YACRC,IAAAA,EAAM,YAAA;YACNC,OAAAA,EAAS,kBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAAa;oBAACC,uBAAAA,CAAwB,kBAAA;AAAoB,iBAAA;gBAC1DC,QAAAA,EAAU;AACR,oBAAA,6BAAA;AACA,oBAAA;wBACEC,IAAAA,EAAM,uBAAA;wBACNJ,MAAAA,EAAQ;4BACNK,OAAAA,EAAS;AAAC,gCAAA;AAAiC;AAC7C;AACF;AACD;AACH;AACF,SAAA;AACA,QAAA;YACER,MAAAA,EAAQ,KAAA;YACRC,IAAAA,EAAM,gBAAA;YACNC,OAAAA,EAAS,kBAAA;YACTC,MAAAA,EAAQ;gBACNC,WAAAA,EAA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