@webiny/api-headless-cms-workflows 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7c2def32a7
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/CmsWorkflowsFeature.d.ts +4 -0
- package/CmsWorkflowsFeature.js +24 -0
- package/CmsWorkflowsFeature.js.map +1 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateContextProvider.d.ts +15 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateContextProvider.js +35 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateContextProvider.js.map +1 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateFilter.d.ts +13 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateFilter.js +45 -0
- package/features/EntryWorkflows/decorators/CmsWorkflowStateFilter.js.map +1 -0
- package/features/EntryWorkflows/errors.d.ts +11 -0
- package/features/EntryWorkflows/errors.js +12 -0
- package/features/EntryWorkflows/errors.js.map +1 -0
- package/features/EntryWorkflows/feature.d.ts +4 -1
- package/features/EntryWorkflows/feature.js +19 -10
- package/features/EntryWorkflows/feature.js.map +1 -1
- package/features/EntryWorkflows/handlers/BlockMoveOnActiveWorkflowState.d.ts +11 -0
- package/features/EntryWorkflows/handlers/BlockMoveOnActiveWorkflowState.js +37 -0
- package/features/EntryWorkflows/handlers/BlockMoveOnActiveWorkflowState.js.map +1 -0
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateAfterDelete.d.ts +1 -1
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateAfterDelete.js +24 -22
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateAfterDelete.js.map +1 -1
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateCancel.d.ts +13 -0
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateCancel.js +35 -0
- package/features/EntryWorkflows/handlers/ClearEntryStateOnWorkflowStateCancel.js.map +1 -0
- package/features/EntryWorkflows/handlers/DeleteWorkflowStateOnEntryAfterDelete.d.ts +1 -1
- package/features/EntryWorkflows/handlers/DeleteWorkflowStateOnEntryAfterDelete.js +16 -19
- package/features/EntryWorkflows/handlers/DeleteWorkflowStateOnEntryAfterDelete.js.map +1 -1
- package/features/EntryWorkflows/handlers/DeleteWorkflowsOnModelAfterDelete.d.ts +1 -1
- package/features/EntryWorkflows/handlers/DeleteWorkflowsOnModelAfterDelete.js +29 -32
- package/features/EntryWorkflows/handlers/DeleteWorkflowsOnModelAfterDelete.js.map +1 -1
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterCreate.d.ts +1 -1
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterCreate.js +25 -23
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterCreate.js.map +1 -1
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterUpdate.d.ts +1 -1
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterUpdate.js +24 -23
- package/features/EntryWorkflows/handlers/UpdateEntryOnWorkflowStateAfterUpdate.js.map +1 -1
- package/features/EntryWorkflows/handlers/ValidateWorkflowStateOnEntryBeforePublish.d.ts +1 -1
- package/features/EntryWorkflows/handlers/ValidateWorkflowStateOnEntryBeforePublish.js +34 -36
- package/features/EntryWorkflows/handlers/ValidateWorkflowStateOnEntryBeforePublish.js.map +1 -1
- package/features/EntryWorkflows/index.js +0 -2
- package/features/Workflows/feature.d.ts +4 -1
- package/features/Workflows/feature.js +6 -5
- package/features/Workflows/feature.js.map +1 -1
- package/features/Workflows/handlers/DisallowUnpublishableModelsOnBeforeCreate.d.ts +1 -1
- package/features/Workflows/handlers/DisallowUnpublishableModelsOnBeforeCreate.js +17 -22
- package/features/Workflows/handlers/DisallowUnpublishableModelsOnBeforeCreate.js.map +1 -1
- package/features/Workflows/index.js +0 -2
- package/graphql/entrySystemSchema.d.ts +2 -0
- package/graphql/entrySystemSchema.js +18 -0
- package/graphql/entrySystemSchema.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -20
- package/package.json +26 -18
- package/utils/appName.js +6 -11
- package/utils/appName.js.map +1 -1
- package/utils/modelAllowed.js +5 -9
- package/utils/modelAllowed.js.map +1 -1
- package/utils/state.d.ts +2 -2
- package/utils/state.js +9 -8
- package/utils/state.js.map +1 -1
- package/features/EntryWorkflows/index.js.map +0 -1
- package/features/Workflows/index.js.map +0 -1
- package/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-workflows",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.7c2def32a7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"description": "Headless CMS Workflows",
|
|
7
10
|
"keywords": [
|
|
8
11
|
"api-headless-cms-workflows:base"
|
|
@@ -14,25 +17,30 @@
|
|
|
14
17
|
},
|
|
15
18
|
"license": "MIT",
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@webiny/api": "0.0.0-unstable.
|
|
18
|
-
"@webiny/api-
|
|
19
|
-
"@webiny/api-
|
|
20
|
-
"@webiny/api-
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/
|
|
20
|
+
"@webiny/api": "0.0.0-unstable.7c2def32a7",
|
|
21
|
+
"@webiny/api-aco": "0.0.0-unstable.7c2def32a7",
|
|
22
|
+
"@webiny/api-core": "0.0.0-unstable.7c2def32a7",
|
|
23
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.7c2def32a7",
|
|
24
|
+
"@webiny/api-workflows": "0.0.0-unstable.7c2def32a7",
|
|
25
|
+
"@webiny/error": "0.0.0-unstable.7c2def32a7",
|
|
26
|
+
"@webiny/feature": "0.0.0-unstable.7c2def32a7",
|
|
27
|
+
"@webiny/shared-aco": "0.0.0-unstable.7c2def32a7"
|
|
23
28
|
},
|
|
24
29
|
"devDependencies": {
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"@webiny/api-core-testing": "0.0.0-unstable.7c2def32a7",
|
|
31
|
+
"@webiny/api-headless-cms-testing": "0.0.0-unstable.7c2def32a7",
|
|
32
|
+
"@webiny/api-opensearch": "0.0.0-unstable.7c2def32a7",
|
|
33
|
+
"@webiny/build-tools": "0.0.0-unstable.7c2def32a7",
|
|
34
|
+
"@webiny/handler": "0.0.0-unstable.7c2def32a7",
|
|
35
|
+
"@webiny/plugins": "0.0.0-unstable.7c2def32a7",
|
|
36
|
+
"@webiny/wcp": "0.0.0-unstable.7c2def32a7",
|
|
37
|
+
"typescript": "7.0.2",
|
|
38
|
+
"vitest": "4.1.11"
|
|
32
39
|
},
|
|
33
40
|
"publishConfig": {
|
|
34
|
-
"access": "public"
|
|
35
|
-
"directory": "dist"
|
|
41
|
+
"access": "public"
|
|
36
42
|
},
|
|
37
|
-
"
|
|
43
|
+
"webiny": {
|
|
44
|
+
"publishFrom": "dist"
|
|
45
|
+
}
|
|
38
46
|
}
|
package/utils/appName.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const getModelIdFromAppName = app => {
|
|
7
|
-
const matched = app.match(/^cms\.([a-zA-Z0-9_-]+)$/);
|
|
8
|
-
if (!matched) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return matched ? matched[1] : null;
|
|
1
|
+
const createWorkflowAppName = ({ model })=>`cms.${model.modelId}`;
|
|
2
|
+
const getModelIdFromAppName = (app)=>{
|
|
3
|
+
const matched = app.match(/^cms\.([a-zA-Z0-9_-]+)$/);
|
|
4
|
+
if (!matched) return null;
|
|
5
|
+
return matched ? matched[1] : null;
|
|
12
6
|
};
|
|
7
|
+
export { createWorkflowAppName, getModelIdFromAppName };
|
|
13
8
|
|
|
14
9
|
//# sourceMappingURL=appName.js.map
|
package/utils/appName.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/appName.js","sources":["../../src/utils/appName.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface IParams {\n model: Pick<CmsModel, \"modelId\">;\n}\nexport const createWorkflowAppName = ({ model }: IParams): string => {\n return `cms.${model.modelId}`;\n};\n\nexport const getModelIdFromAppName = (app: string): string | null => {\n const matched = app.match(/^cms\\.([a-zA-Z0-9_-]+)$/);\n if (!matched) {\n return null;\n }\n return matched ? matched[1] : null;\n};\n"],"names":["createWorkflowAppName","model","getModelIdFromAppName","app","matched"],"mappings":"AAKO,MAAMA,wBAAwB,CAAC,EAAEC,KAAK,EAAW,GAC7C,CAAC,IAAI,EAAEA,MAAM,OAAO,EAAE;AAG1B,MAAMC,wBAAwB,CAACC;IAClC,MAAMC,UAAUD,IAAI,KAAK,CAAC;IAC1B,IAAI,CAACC,SACD,OAAO;IAEX,OAAOA,UAAUA,OAAO,CAAC,EAAE,GAAG;AAClC"}
|
package/utils/modelAllowed.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { CMS_MODEL_SINGLETON_TAG } from "@webiny/api-headless-cms/constants.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return false;
|
|
5
|
-
|
|
6
|
-
// TODO remove when we allow singleton models to have workflows.
|
|
7
|
-
else if (model.tags?.includes(CMS_MODEL_SINGLETON_TAG)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
return true;
|
|
2
|
+
const isModelAllowed = (model)=>{
|
|
3
|
+
if (model.isPrivate) return false;
|
|
4
|
+
if (model.tags?.includes(CMS_MODEL_SINGLETON_TAG)) return false;
|
|
5
|
+
return true;
|
|
11
6
|
};
|
|
7
|
+
export { isModelAllowed };
|
|
12
8
|
|
|
13
9
|
//# sourceMappingURL=modelAllowed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/modelAllowed.js","sources":["../../src/utils/modelAllowed.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"@webiny/api-headless-cms/constants.js\";\n\nexport const isModelAllowed = (model: Pick<CmsModel, \"isPrivate\" | \"tags\">): boolean => {\n if (model.isPrivate) {\n return false;\n }\n // TODO remove when we allow singleton models to have workflows.\n else if (model.tags?.includes(CMS_MODEL_SINGLETON_TAG)) {\n return false;\n }\n return true;\n};\n"],"names":["isModelAllowed","model","CMS_MODEL_SINGLETON_TAG"],"mappings":";AAGO,MAAMA,iBAAiB,CAACC;IAC3B,IAAIA,MAAM,SAAS,EACf,OAAO;IAGN,IAAIA,MAAM,IAAI,EAAE,SAASC,0BAC1B,OAAO;IAEX,OAAO;AACX"}
|
package/utils/state.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ICmsEntryWorkflowState } from "@webiny/api-workflows/types.js";
|
|
2
2
|
import type { WorkflowState } from "@webiny/api-workflows/domain/workflowState/WorkflowState.js";
|
|
3
|
-
export declare const getStateValues: (state: WorkflowState) =>
|
|
3
|
+
export declare const getStateValues: (state: WorkflowState) => ICmsEntryWorkflowState;
|
package/utils/state.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const getStateValues = (state)=>{
|
|
2
|
+
const activeStep = state.currentStep;
|
|
3
|
+
return {
|
|
4
|
+
workflowId: state.workflowId,
|
|
5
|
+
stepId: activeStep.id,
|
|
6
|
+
stepName: activeStep.title,
|
|
7
|
+
state: activeStep.state
|
|
8
|
+
};
|
|
9
9
|
};
|
|
10
|
+
export { getStateValues };
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=state.js.map
|
package/utils/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/state.js","sources":["../../src/utils/state.ts"],"sourcesContent":["import type { ICmsEntryWorkflowState } from \"@webiny/api-workflows/types.js\";\nimport type { WorkflowState } from \"@webiny/api-workflows/domain/workflowState/WorkflowState.js\";\n\nexport const getStateValues = (state: WorkflowState): ICmsEntryWorkflowState => {\n const activeStep = state.currentStep;\n\n return {\n workflowId: state.workflowId,\n stepId: activeStep.id,\n stepName: activeStep.title,\n state: activeStep.state\n };\n};\n"],"names":["getStateValues","state","activeStep"],"mappings":"AAGO,MAAMA,iBAAiB,CAACC;IAC3B,MAAMC,aAAaD,MAAM,WAAW;IAEpC,OAAO;QACH,YAAYA,MAAM,UAAU;QAC5B,QAAQC,WAAW,EAAE;QACrB,UAAUA,WAAW,KAAK;QAC1B,OAAOA,WAAW,KAAK;IAC3B;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EntryWorkflowsFeature"],"sources":["index.ts"],"sourcesContent":["export { EntryWorkflowsFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WorkflowsFeature"],"sources":["index.ts"],"sourcesContent":["export { WorkflowsFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,gBAAgB","ignoreList":[]}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createContextPlugin","EntryWorkflowsFeature","WcpContext","WorkflowsFeature","createHeadlessCmsWorkflows","plugin","context","wcpContext","container","resolve","canUseWorkflows","register","name"],"sources":["index.ts"],"sourcesContent":["import { createContextPlugin } from \"@webiny/api\";\nimport { EntryWorkflowsFeature } from \"./features/EntryWorkflows/feature.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\nimport { WorkflowsFeature } from \"~/features/Workflows/index.js\";\n\nexport const createHeadlessCmsWorkflows = () => {\n const plugin = createContextPlugin(async context => {\n const wcpContext = context.container.resolve(WcpContext);\n\n if (!wcpContext.canUseWorkflows()) {\n return;\n }\n\n // Register features\n EntryWorkflowsFeature.register(context.container, context);\n WorkflowsFeature.register(context.container);\n });\n\n plugin.name = \"headless-cms-workflows.context\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,aAAa;AACjD,SAASC,qBAAqB;AAC9B,SAASC,UAAU,QAAQ,mDAAmD;AAC9E,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EAC5C,MAAMC,MAAM,GAAGL,mBAAmB,CAAC,MAAMM,OAAO,IAAI;IAChD,MAAMC,UAAU,GAAGD,OAAO,CAACE,SAAS,CAACC,OAAO,CAACP,UAAU,CAAC;IAExD,IAAI,CAACK,UAAU,CAACG,eAAe,CAAC,CAAC,EAAE;MAC/B;IACJ;;IAEA;IACAT,qBAAqB,CAACU,QAAQ,CAACL,OAAO,CAACE,SAAS,EAAEF,OAAO,CAAC;IAC1DH,gBAAgB,CAACQ,QAAQ,CAACL,OAAO,CAACE,SAAS,CAAC;EAChD,CAAC,CAAC;EAEFH,MAAM,CAACO,IAAI,GAAG,gCAAgC;EAE9C,OAAOP,MAAM;AACjB,CAAC","ignoreList":[]}
|