@webiny/api-apw 0.0.0-unstable.13771d80a8 → 0.0.0-unstable.2696f9d9e8
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/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +56 -30
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.js +7 -6
- package/crud/utils.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +39 -46
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +9 -6
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +16 -15
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +3 -2
- package/plugins/cms/utils.js +22 -14
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +3 -1
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -12
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +41 -35
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +23 -13
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -12
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +12 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.js +15 -12
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +3 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.js +3 -1
- package/plugins/hooks/notifications/appUrl.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +6 -9
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +6 -9
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +7 -10
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +3 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +3 -1
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +11 -6
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +2 -2
- package/plugins/pageBuilder/utils.js +3 -1
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -1
- package/plugins/utils.js +6 -3
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +44 -30
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +11 -6
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +21 -14
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +17 -14
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -3
- package/scheduler/handlers/utils.js +6 -7
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +10 -8
- package/scheduler/types.js +14 -12
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +60 -27
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +36 -30
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
- package/storageOperations/contentReviewStorageOperations.js +35 -27
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +1 -7
- package/storageOperations/index.js +11 -16
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +7 -7
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +7 -7
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +13 -11
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +6 -26
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +8 -8
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +1 -2
- package/storageOperations/models/workflow.model.js +19 -19
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +1 -1
- package/storageOperations/reviewerStorageOperations.js +38 -35
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.js +3 -1
- package/storageOperations/workflowStorageOperations.js +41 -31
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +16 -16
- package/types.js +126 -28
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +3 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +31 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -11
- package/storageOperations/models/contentModelPluginFactory.js +0 -19
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -5,54 +5,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createReviewerStorageOperations = void 0;
|
8
|
-
var
|
9
|
-
var _index = require("./index");
|
8
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
10
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
10
|
const createReviewerStorageOperations = ({
|
12
11
|
cms,
|
13
12
|
security
|
14
13
|
}) => {
|
15
14
|
const getReviewerModel = async () => {
|
16
|
-
security.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
return model;
|
23
|
-
} catch (ex) {
|
24
|
-
throw ex;
|
25
|
-
} finally {
|
26
|
-
security.enableAuthorization();
|
15
|
+
const model = await security.withoutAuthorization(async () => {
|
16
|
+
return cms.getModel("apwReviewerModelDefinition");
|
17
|
+
});
|
18
|
+
if (!model) {
|
19
|
+
throw new _error.default("Could not find `apwReviewerModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
27
20
|
}
|
21
|
+
return model;
|
28
22
|
};
|
29
23
|
const getReviewer = async ({
|
30
24
|
id
|
31
25
|
}) => {
|
32
26
|
const model = await getReviewerModel();
|
33
|
-
security.
|
34
|
-
|
35
|
-
|
36
|
-
return (0,
|
27
|
+
const entry = await security.withoutAuthorization(async () => {
|
28
|
+
return cms.getEntryById(model, id);
|
29
|
+
});
|
30
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
37
31
|
};
|
38
32
|
return {
|
39
33
|
getReviewerModel,
|
40
34
|
getReviewer,
|
41
35
|
async listReviewers(params) {
|
42
36
|
const model = await getReviewerModel();
|
43
|
-
security.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
37
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
38
|
+
return cms.listLatestEntries(model, {
|
39
|
+
...params,
|
40
|
+
where: {
|
41
|
+
...params.where
|
42
|
+
}
|
43
|
+
});
|
44
|
+
});
|
45
|
+
return [entries.map(_pickEntryFieldValues.pickEntryFieldValues), meta];
|
49
46
|
},
|
50
47
|
async createReviewer(params) {
|
51
48
|
const model = await getReviewerModel();
|
52
|
-
security.
|
53
|
-
|
54
|
-
|
55
|
-
return (0,
|
49
|
+
const entry = await security.withoutAuthorization(async () => {
|
50
|
+
return cms.createEntry(model, params.data);
|
51
|
+
});
|
52
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
56
53
|
},
|
57
54
|
async updateReviewer(params) {
|
58
55
|
const model = await getReviewerModel();
|
@@ -63,18 +60,24 @@ const createReviewerStorageOperations = ({
|
|
63
60
|
const existingEntry = await getReviewer({
|
64
61
|
id: params.id
|
65
62
|
});
|
66
|
-
security.
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
const entry = await security.withoutAuthorization(async () => {
|
64
|
+
return cms.updateEntry(model, params.id, {
|
65
|
+
...existingEntry,
|
66
|
+
...params.data,
|
67
|
+
savedOn: new Date()
|
68
|
+
});
|
69
|
+
});
|
70
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
70
71
|
},
|
71
72
|
async deleteReviewer(params) {
|
72
73
|
const model = await getReviewerModel();
|
73
|
-
security.
|
74
|
-
|
75
|
-
|
74
|
+
await security.withoutAuthorization(async () => {
|
75
|
+
return cms.deleteEntry(model, params.id);
|
76
|
+
});
|
76
77
|
return true;
|
77
78
|
}
|
78
79
|
};
|
79
80
|
};
|
80
|
-
exports.createReviewerStorageOperations = createReviewerStorageOperations;
|
81
|
+
exports.createReviewerStorageOperations = createReviewerStorageOperations;
|
82
|
+
|
83
|
+
//# sourceMappingURL=reviewerStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createReviewerStorageOperations","cms","security","getReviewerModel","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","createReviewerStorageOperations","cms","security","getReviewerModel","model","withoutAuthorization","getModel","WebinyError","getReviewer","id","entry","getEntryById","pickEntryFieldValues","listReviewers","params","entries","meta","listLatestEntries","where","map","createReviewer","createEntry","data","updateReviewer","existingEntry","updateEntry","savedOn","Date","deleteReviewer","deleteEntry","exports"],"sources":["reviewerStorageOperations.ts"],"sourcesContent":["import { ApwReviewerStorageOperations } from \"./types\";\nimport { CreateApwStorageOperationsParams } from \"~/storageOperations\";\nimport { pickEntryFieldValues } from \"~/utils/pickEntryFieldValues\";\nimport WebinyError from \"@webiny/error\";\nimport { ApwReviewer } from \"~/types\";\n\nexport const createReviewerStorageOperations = ({\n cms,\n security\n}: CreateApwStorageOperationsParams): ApwReviewerStorageOperations => {\n const getReviewerModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(\"apwReviewerModelDefinition\");\n });\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwReviewerModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getReviewer: ApwReviewerStorageOperations[\"getReviewer\"] = async ({ id }) => {\n const model = await getReviewerModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n return pickEntryFieldValues(entry);\n };\n return {\n getReviewerModel,\n getReviewer,\n async listReviewers(params) {\n const model = await getReviewerModel();\n\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n });\n return [entries.map(pickEntryFieldValues<ApwReviewer>), meta];\n },\n async createReviewer(params) {\n const model = await getReviewerModel();\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, params.data);\n });\n return pickEntryFieldValues(entry);\n },\n async updateReviewer(params) {\n const model = await getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getReviewer({ id: params.id });\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n });\n return pickEntryFieldValues(entry);\n },\n async deleteReviewer(params) {\n const model = await getReviewerModel();\n\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAEA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGO,MAAMG,+BAA+B,GAAGA,CAAC;EAC5CC,GAAG;EACHC;AAC8B,CAAC,KAAmC;EAClE,MAAMC,gBAAgB,GAAG,MAAAA,CAAA,KAAY;IACjC,MAAMC,KAAK,GAAG,MAAMF,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOJ,GAAG,CAACK,QAAQ,CAAC,4BAA4B,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACF,KAAK,EAAE;MACR,MAAM,IAAIG,cAAW,CACjB,oDAAoD,EACpD,uBACJ,CAAC;IACL;IACA,OAAOH,KAAK;EAChB,CAAC;EACD,MAAMI,WAAwD,GAAG,MAAAA,CAAO;IAAEC;EAAG,CAAC,KAAK;IAC/E,MAAML,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;IAEtC,MAAMO,KAAK,GAAG,MAAMR,QAAQ,CAACG,oBAAoB,CAAC,YAA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rB,KAAK,EAAEU,MAAM,CAACL,EAAE,EAAE;UACrC,GAAGe,aAAa;UAChB,GAAGV,MAAM,CAACQ,IAAI;UACdI,OAAO,EAAE,IAAIC,IAAI,CAAC;QACtB,CAAC,CAAC;MACN,CAAC,CAAC;MACF,OAAO,IAAAf,0CAAoB,EAACF,KAAK,CAAC;IACtC,CAAC;IACD,MAAMkB,cAAcA,CAACd,MAAM,EAAE;MACzB,MAAMV,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MAEtC,MAAMD,QAAQ,CAACG,oBAAoB,CAAC,YAAY;QAC5C,OAAOJ,GAAG,CAAC4B,WAAW,CAACzB,KAAK,EAAEU,MAAM,CAACL,EAAE,CAAC;MAC5C,CAAC,CAAC;MACF,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAACqB,OAAA,CAAA9B,+BAAA,GAAAA,+BAAA"}
|
@@ -5,19 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createWorkflowStorageOperations = void 0;
|
8
|
-
var
|
9
|
-
var _index = require("./index");
|
8
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
10
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
10
|
var _workflow = require("./models/workflow.model");
|
12
11
|
const formatReviewersForRefInput = (data, modelId) => {
|
13
|
-
return
|
14
|
-
|
12
|
+
return {
|
13
|
+
...data,
|
14
|
+
steps: data.steps.map(step => ({
|
15
|
+
...step,
|
15
16
|
reviewers: step.reviewers.map(id => ({
|
16
17
|
id,
|
17
18
|
modelId
|
18
19
|
}))
|
19
20
|
}))
|
20
|
-
}
|
21
|
+
};
|
21
22
|
};
|
22
23
|
const createWorkflowStorageOperations = params => {
|
23
24
|
const {
|
@@ -25,9 +26,9 @@ const createWorkflowStorageOperations = params => {
|
|
25
26
|
security
|
26
27
|
} = params;
|
27
28
|
const getWorkflowModel = async () => {
|
28
|
-
security.
|
29
|
-
|
30
|
-
|
29
|
+
const model = await security.withoutAuthorization(async () => {
|
30
|
+
return cms.getModel(_workflow.WORKFLOW_MODEL_ID);
|
31
|
+
});
|
31
32
|
if (!model) {
|
32
33
|
throw new _error.default(`Could not find "${_workflow.WORKFLOW_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
33
34
|
}
|
@@ -37,31 +38,34 @@ const createWorkflowStorageOperations = params => {
|
|
37
38
|
id
|
38
39
|
}) => {
|
39
40
|
const model = await getWorkflowModel();
|
40
|
-
security.
|
41
|
-
|
42
|
-
|
43
|
-
return (0,
|
41
|
+
const entry = await security.withoutAuthorization(async () => {
|
42
|
+
return cms.getEntryById(model, id);
|
43
|
+
});
|
44
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
44
45
|
};
|
45
46
|
return {
|
46
47
|
getWorkflowModel,
|
47
48
|
getWorkflow,
|
48
49
|
async listWorkflows(params) {
|
49
50
|
const model = await getWorkflowModel();
|
50
|
-
security.
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
52
|
+
return cms.listLatestEntries(model, {
|
53
|
+
...params,
|
54
|
+
where: {
|
55
|
+
...params.where
|
56
|
+
}
|
57
|
+
});
|
58
|
+
});
|
59
|
+
return [entries.map(_pickEntryFieldValues.pickEntryFieldValues), meta];
|
56
60
|
},
|
57
61
|
async createWorkflow(params) {
|
58
62
|
const model = await getWorkflowModel();
|
59
63
|
const reviewerModel = await this.getReviewerModel();
|
60
64
|
const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);
|
61
|
-
security.
|
62
|
-
|
63
|
-
|
64
|
-
return (0,
|
65
|
+
const entry = await security.withoutAuthorization(async () => {
|
66
|
+
return cms.createEntry(model, data);
|
67
|
+
});
|
68
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
65
69
|
},
|
66
70
|
async updateWorkflow(params) {
|
67
71
|
const model = await getWorkflowModel();
|
@@ -73,20 +77,26 @@ const createWorkflowStorageOperations = params => {
|
|
73
77
|
const existingEntry = await getWorkflow({
|
74
78
|
id: params.id
|
75
79
|
});
|
76
|
-
const input =
|
80
|
+
const input = {
|
81
|
+
...existingEntry,
|
82
|
+
...params.data,
|
83
|
+
savedOn: new Date()
|
84
|
+
};
|
77
85
|
const data = formatReviewersForRefInput(input, reviewerModel.modelId);
|
78
|
-
security.
|
79
|
-
|
80
|
-
|
81
|
-
return (0,
|
86
|
+
const entry = await security.withoutAuthorization(async () => {
|
87
|
+
return cms.updateEntry(model, params.id, data);
|
88
|
+
});
|
89
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
82
90
|
},
|
83
91
|
async deleteWorkflow(params) {
|
84
92
|
const model = await getWorkflowModel();
|
85
|
-
security.
|
86
|
-
|
87
|
-
|
93
|
+
await security.withoutAuthorization(async () => {
|
94
|
+
return cms.deleteEntry(model, params.id);
|
95
|
+
});
|
88
96
|
return true;
|
89
97
|
}
|
90
98
|
};
|
91
99
|
};
|
92
|
-
exports.createWorkflowStorageOperations = createWorkflowStorageOperations;
|
100
|
+
exports.createWorkflowStorageOperations = createWorkflowStorageOperations;
|
101
|
+
|
102
|
+
//# sourceMappingURL=workflowStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","security","getWorkflowModel","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","_workflow","formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","security","getWorkflowModel","model","withoutAuthorization","getModel","WORKFLOW_MODEL_ID","WebinyError","getWorkflow","entry","getEntryById","pickEntryFieldValues","listWorkflows","entries","meta","listLatestEntries","where","createWorkflow","reviewerModel","getReviewerModel","createEntry","updateWorkflow","existingEntry","input","savedOn","Date","updateEntry","deleteWorkflow","deleteEntry","exports"],"sources":["workflowStorageOperations.ts"],"sourcesContent":["import { ApwWorkflow, CreateApwWorkflowParams } from \"~/types\";\nimport { ApwStorageOperations, ApwWorkflowStorageOperations } from \"./types\";\nimport { CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { pickEntryFieldValues } from \"~/utils/pickEntryFieldValues\";\nimport WebinyError from \"@webiny/error\";\nimport { WORKFLOW_MODEL_ID } from \"~/storageOperations/models/workflow.model\";\n\ntype ReviewersRefInput = CreateApwWorkflowParams<{ modelId: string; id: string }>;\n\nconst formatReviewersForRefInput = (\n data: CreateApwWorkflowParams,\n modelId: string\n): ReviewersRefInput => {\n return {\n ...data,\n steps: data.steps.map(step => ({\n ...step,\n reviewers: step.reviewers.map(id => ({\n id,\n modelId\n }))\n }))\n };\n};\n\nexport const createWorkflowStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwWorkflowStorageOperations => {\n const { cms, security } = params;\n const getWorkflowModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(WORKFLOW_MODEL_ID);\n });\n if (!model) {\n throw new WebinyError(\n `Could not find \"${WORKFLOW_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getWorkflow: ApwWorkflowStorageOperations[\"getWorkflow\"] = async ({ id }) => {\n const model = await getWorkflowModel();\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n return pickEntryFieldValues(entry);\n };\n return {\n getWorkflowModel,\n getWorkflow,\n async listWorkflows(params) {\n const model = await getWorkflowModel();\n\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n });\n return [entries.map(pickEntryFieldValues<ApwWorkflow>), meta];\n },\n async createWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n\n const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, data);\n });\n\n return pickEntryFieldValues(entry);\n },\n async updateWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getWorkflow({ id: params.id });\n const input = {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n };\n const data = formatReviewersForRefInput(\n input as CreateApwWorkflowParams,\n reviewerModel.modelId\n );\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, data);\n });\n\n return pickEntryFieldValues(entry);\n },\n async deleteWorkflow(params) {\n const model = await getWorkflowModel();\n\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAIA,MAAMI,0BAA0B,GAAGA,CAC/BC,IAA6B,EAC7BC,OAAe,KACK;EACpB,OAAO;IACH,GAAGD,IAAI;IACPE,KAAK,EAAEF,IAAI,CAACE,KAAK,CAACC,GAAG,CAACC,IAAI,KAAK;MAC3B,GAAGA,IAAI;MACPC,SAAS,EAAED,IAAI,CAACC,SAAS,CAACF,GAAG,CAACG,EAAE,KAAK;QACjCA,EAAE;QACFL;MACJ,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC;AACL,CAAC;AAEM,MAAMM,+BAA+B,GACxCC,MAAwC,IACT;EAC/B,MAAM;IAAEC,GAAG;IAAEC;EAAS,CAAC,GAAGF,MAAM;EAChC,MAAMG,gBAAgB,GAAG,MAAAA,CAAA,KAAY;IACjC,MAAMC,KAAK,GAAG,MAAMF,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOJ,GAAG,CAACK,QAAQ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CAAA/B,+BAAA,GAAAA,+BAAA"}
|
package/types.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CmsEntry as BaseCmsEntry,
|
1
|
+
import { CmsEntry as BaseCmsEntry, OnEntryBeforePublishTopicParams, OnEntryAfterPublishTopicParams, OnEntryAfterUnpublishTopicParams } from "@webiny/api-headless-cms/types";
|
2
2
|
import { Page, OnPageBeforeCreateTopicParams, OnPageBeforeCreateFromTopicParams, OnPageBeforeUpdateTopicParams, OnPageBeforePublishTopicParams, PageSettings } from "@webiny/api-page-builder/types";
|
3
3
|
import { Context } from "@webiny/api/types";
|
4
4
|
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
@@ -117,8 +117,11 @@ export interface ApwBaseFields {
|
|
117
117
|
id: string;
|
118
118
|
entryId: string;
|
119
119
|
createdOn: string;
|
120
|
+
modifiedOn: string | null;
|
120
121
|
savedOn: string;
|
121
122
|
createdBy: ApwIdentity;
|
123
|
+
modifiedBy: ApwIdentity;
|
124
|
+
savedBy: ApwIdentity;
|
122
125
|
}
|
123
126
|
export interface ApwReviewer extends ApwBaseFields {
|
124
127
|
identityId: string;
|
@@ -280,7 +283,7 @@ interface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {
|
|
280
283
|
get(id: string): Promise<TEntry>;
|
281
284
|
create(data: TCreateEntryParams): Promise<TEntry>;
|
282
285
|
update(id: string, data: TUpdateEntryParams): Promise<TEntry>;
|
283
|
-
delete(id: string): Promise<
|
286
|
+
delete(id: string): Promise<boolean>;
|
284
287
|
}
|
285
288
|
export interface ApwWorkflowCrud extends BaseApwCrud<ApwWorkflow, CreateApwWorkflowParams, UpdateApwWorkflowParams> {
|
286
289
|
list(params?: ListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;
|
@@ -349,14 +352,14 @@ export interface ApwChangeRequestCrud extends BaseApwCrud<ApwChangeRequest, Crea
|
|
349
352
|
}
|
350
353
|
export interface ApwContentReviewCrud extends BaseApwCrud<ApwContentReview, CreateApwContentReviewParams, UpdateApwContentReviewParams> {
|
351
354
|
list(params: ApwContentReviewListParams): Promise<[ApwContentReview[], ListMeta]>;
|
352
|
-
provideSignOff(id: string, step: string): Promise<
|
353
|
-
retractSignOff(id: string, step: string): Promise<
|
355
|
+
provideSignOff(id: string, step: string): Promise<boolean>;
|
356
|
+
retractSignOff(id: string, step: string): Promise<boolean>;
|
354
357
|
isReviewRequired(data: ApwContentReviewContent): Promise<{
|
355
358
|
isReviewRequired: boolean;
|
356
359
|
contentReviewId?: string | null;
|
357
360
|
}>;
|
358
|
-
publishContent(id: string, datetime?: string): Promise<
|
359
|
-
unpublishContent(id: string, datetime?: string): Promise<
|
361
|
+
publishContent(id: string, datetime?: string): Promise<boolean>;
|
362
|
+
unpublishContent(id: string, datetime?: string): Promise<boolean>;
|
360
363
|
scheduleAction(data: ApwScheduleActionData): Promise<string>;
|
361
364
|
deleteScheduledAction(id: string): Promise<boolean>;
|
362
365
|
/**
|
@@ -375,10 +378,10 @@ export declare type ContentGetter = (id: string, settings: {
|
|
375
378
|
}) => Promise<PageWithWorkflow | ApwCmsEntry | null>;
|
376
379
|
export declare type ContentPublisher = (id: string, settings: {
|
377
380
|
modelId?: string;
|
378
|
-
}) => Promise<
|
381
|
+
}) => Promise<boolean | null>;
|
379
382
|
export declare type ContentUnPublisher = (id: string, settings: {
|
380
383
|
modelId?: string;
|
381
|
-
}) => Promise<
|
384
|
+
}) => Promise<boolean | null>;
|
382
385
|
export interface AdvancedPublishingWorkflow {
|
383
386
|
addContentGetter: (type: ApwContentTypes, func: ContentGetter) => void;
|
384
387
|
getContentGetter: (type: ApwContentTypes) => ContentGetter;
|
@@ -500,35 +503,35 @@ export interface ApwReviewerStorageOperations {
|
|
500
503
|
listReviewers(params: StorageOperationsListReviewersParams): Promise<[ApwReviewer[], ListMeta]>;
|
501
504
|
createReviewer(params: StorageOperationsCreateReviewerParams): Promise<ApwReviewer>;
|
502
505
|
updateReviewer(params: StorageOperationsUpdateReviewerParams): Promise<ApwReviewer>;
|
503
|
-
deleteReviewer(params: StorageOperationsDeleteReviewerParams): Promise<
|
506
|
+
deleteReviewer(params: StorageOperationsDeleteReviewerParams): Promise<boolean>;
|
504
507
|
}
|
505
508
|
export interface ApwWorkflowStorageOperations {
|
506
509
|
getWorkflow(params: StorageOperationsGetWorkflowParams): Promise<ApwWorkflow>;
|
507
510
|
listWorkflows(params: StorageOperationsListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;
|
508
511
|
createWorkflow(params: StorageOperationsCreateWorkflowParams): Promise<ApwWorkflow>;
|
509
512
|
updateWorkflow(params: StorageOperationsUpdateWorkflowParams): Promise<ApwWorkflow>;
|
510
|
-
deleteWorkflow(params: StorageOperationsDeleteWorkflowParams): Promise<
|
513
|
+
deleteWorkflow(params: StorageOperationsDeleteWorkflowParams): Promise<boolean>;
|
511
514
|
}
|
512
515
|
export interface ApwContentReviewStorageOperations {
|
513
516
|
getContentReview(params: StorageOperationsGetContentReviewParams): Promise<ApwContentReview>;
|
514
517
|
listContentReviews(params: StorageOperationsListContentReviewsParams): Promise<[ApwContentReview[], ListMeta]>;
|
515
518
|
createContentReview(params: StorageOperationsCreateContentReviewParams): Promise<ApwContentReview>;
|
516
519
|
updateContentReview(params: StorageOperationsUpdateContentReviewParams): Promise<ApwContentReview>;
|
517
|
-
deleteContentReview(params: StorageOperationsDeleteContentReviewParams): Promise<
|
520
|
+
deleteContentReview(params: StorageOperationsDeleteContentReviewParams): Promise<boolean>;
|
518
521
|
}
|
519
522
|
export interface ApwChangeRequestStorageOperations {
|
520
523
|
getChangeRequest(params: StorageOperationsGetChangeRequestParams): Promise<ApwChangeRequest>;
|
521
524
|
listChangeRequests(params: StorageOperationsListChangeRequestsParams): Promise<[ApwChangeRequest[], ListMeta]>;
|
522
525
|
createChangeRequest(params: StorageOperationsCreateChangeRequestParams): Promise<ApwChangeRequest>;
|
523
526
|
updateChangeRequest(params: StorageOperationsUpdateChangeRequestParams): Promise<ApwChangeRequest>;
|
524
|
-
deleteChangeRequest(params: StorageOperationsDeleteChangeRequestParams): Promise<
|
527
|
+
deleteChangeRequest(params: StorageOperationsDeleteChangeRequestParams): Promise<boolean>;
|
525
528
|
}
|
526
529
|
export interface ApwCommentStorageOperations {
|
527
530
|
getComment(params: StorageOperationsGetCommentParams): Promise<ApwComment>;
|
528
531
|
listComments(params: StorageOperationsListCommentsParams): Promise<[ApwComment[], ListMeta]>;
|
529
532
|
createComment(params: StorageOperationsCreateCommentParams): Promise<ApwComment>;
|
530
533
|
updateComment(params: StorageOperationsUpdateCommentParams): Promise<ApwComment>;
|
531
|
-
deleteComment(params: StorageOperationsDeleteCommentParams): Promise<
|
534
|
+
deleteComment(params: StorageOperationsDeleteCommentParams): Promise<boolean>;
|
532
535
|
}
|
533
536
|
export interface ApwStorageOperations extends ApwReviewerStorageOperations, ApwWorkflowStorageOperations, ApwContentReviewStorageOperations, ApwChangeRequestStorageOperations, ApwCommentStorageOperations {
|
534
537
|
}
|
@@ -736,9 +739,6 @@ export interface OnWorkflowBeforeDeleteTopicParams {
|
|
736
739
|
export interface OnWorkflowAfterDeleteTopicParams {
|
737
740
|
workflow: ApwWorkflow;
|
738
741
|
}
|
739
|
-
export declare type WorkflowModelDefinition = Pick<CmsModel, "name" | "modelId" | "layout" | "titleFieldId" | "description" | "fields" | "isPrivate"> & {
|
740
|
-
isPrivate: true;
|
741
|
-
};
|
742
742
|
/**
|
743
743
|
* Headless CMS
|
744
744
|
*/
|
package/types.js
CHANGED
@@ -4,52 +4,150 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.WorkflowScopeTypes = exports.ApwWorkflowStepTypes = exports.ApwWorkflowApplications = exports.ApwContentTypes = exports.ApwContentReviewStepStatus = exports.ApwContentReviewStatus = void 0;
|
7
|
-
let ApwContentTypes
|
8
|
-
exports.ApwContentTypes = ApwContentTypes;
|
9
|
-
(function (ApwContentTypes) {
|
7
|
+
let ApwContentTypes = /*#__PURE__*/function (ApwContentTypes) {
|
10
8
|
ApwContentTypes["PAGE"] = "page";
|
11
9
|
ApwContentTypes["CMS_ENTRY"] = "cms_entry";
|
12
|
-
|
13
|
-
|
14
|
-
exports.
|
15
|
-
|
10
|
+
return ApwContentTypes;
|
11
|
+
}({});
|
12
|
+
exports.ApwContentTypes = ApwContentTypes;
|
13
|
+
let WorkflowScopeTypes = /*#__PURE__*/function (WorkflowScopeTypes) {
|
16
14
|
WorkflowScopeTypes["DEFAULT"] = "default";
|
17
15
|
WorkflowScopeTypes["CUSTOM"] = "custom";
|
18
|
-
|
19
|
-
|
20
|
-
exports.
|
21
|
-
|
16
|
+
return WorkflowScopeTypes;
|
17
|
+
}({});
|
18
|
+
exports.WorkflowScopeTypes = WorkflowScopeTypes;
|
19
|
+
let ApwContentReviewStepStatus = /*#__PURE__*/function (ApwContentReviewStepStatus) {
|
22
20
|
ApwContentReviewStepStatus["DONE"] = "done";
|
23
21
|
ApwContentReviewStepStatus["ACTIVE"] = "active";
|
24
22
|
ApwContentReviewStepStatus["INACTIVE"] = "inactive";
|
25
|
-
|
26
|
-
|
23
|
+
return ApwContentReviewStepStatus;
|
24
|
+
}({});
|
25
|
+
exports.ApwContentReviewStepStatus = ApwContentReviewStepStatus;
|
26
|
+
let ApwWorkflowApplications = /*#__PURE__*/function (ApwWorkflowApplications) {
|
27
|
+
ApwWorkflowApplications["PB"] = "pageBuilder";
|
28
|
+
ApwWorkflowApplications["CMS"] = "cms";
|
29
|
+
return ApwWorkflowApplications;
|
30
|
+
}({});
|
27
31
|
/**
|
28
32
|
* A interface describing the reference to a user that created some data in the database.
|
29
33
|
*
|
30
34
|
* @category General
|
31
35
|
*/
|
32
36
|
exports.ApwWorkflowApplications = ApwWorkflowApplications;
|
33
|
-
|
34
|
-
ApwWorkflowApplications["PB"] = "pageBuilder";
|
35
|
-
ApwWorkflowApplications["CMS"] = "cms";
|
36
|
-
})(ApwWorkflowApplications || (exports.ApwWorkflowApplications = ApwWorkflowApplications = {}));
|
37
|
-
let ApwWorkflowStepTypes;
|
38
|
-
exports.ApwWorkflowStepTypes = ApwWorkflowStepTypes;
|
39
|
-
(function (ApwWorkflowStepTypes) {
|
37
|
+
let ApwWorkflowStepTypes = /*#__PURE__*/function (ApwWorkflowStepTypes) {
|
40
38
|
ApwWorkflowStepTypes["MANDATORY_BLOCKING"] = "mandatoryBlocking";
|
41
39
|
ApwWorkflowStepTypes["MANDATORY_NON_BLOCKING"] = "mandatoryNonBlocking";
|
42
40
|
ApwWorkflowStepTypes["NON_MANDATORY"] = "notMandatory";
|
43
|
-
|
44
|
-
|
45
|
-
exports.
|
46
|
-
|
41
|
+
return ApwWorkflowStepTypes;
|
42
|
+
}({});
|
43
|
+
exports.ApwWorkflowStepTypes = ApwWorkflowStepTypes;
|
44
|
+
let ApwContentReviewStatus = /*#__PURE__*/function (ApwContentReviewStatus) {
|
47
45
|
ApwContentReviewStatus["UNDER_REVIEW"] = "underReview";
|
48
46
|
ApwContentReviewStatus["READY_TO_BE_PUBLISHED"] = "readyToBePublished";
|
49
47
|
ApwContentReviewStatus["PUBLISHED"] = "published";
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
return ApwContentReviewStatus;
|
49
|
+
}({});
|
50
|
+
exports.ApwContentReviewStatus = ApwContentReviewStatus;
|
51
|
+
var ApwScheduleActionTypes = /*#__PURE__*/function (ApwScheduleActionTypes) {
|
53
52
|
ApwScheduleActionTypes["PUBLISH"] = "publish";
|
54
53
|
ApwScheduleActionTypes["UNPUBLISH"] = "unpublish";
|
55
|
-
|
54
|
+
return ApwScheduleActionTypes;
|
55
|
+
}(ApwScheduleActionTypes || {});
|
56
|
+
/**
|
57
|
+
* @category Lifecycle events
|
58
|
+
*/
|
59
|
+
/**
|
60
|
+
* @category Lifecycle events
|
61
|
+
*/
|
62
|
+
/**
|
63
|
+
* @category Lifecycle events
|
64
|
+
*/
|
65
|
+
/**
|
66
|
+
* @category Lifecycle events
|
67
|
+
*/
|
68
|
+
/**
|
69
|
+
* @category Lifecycle events
|
70
|
+
*/
|
71
|
+
/**
|
72
|
+
* @category Lifecycle events
|
73
|
+
*/
|
74
|
+
/**
|
75
|
+
* @category Lifecycle events
|
76
|
+
*/
|
77
|
+
/**
|
78
|
+
* @category Lifecycle events
|
79
|
+
*/
|
80
|
+
/**
|
81
|
+
* @category Lifecycle events
|
82
|
+
*/
|
83
|
+
/**
|
84
|
+
* @category Lifecycle events
|
85
|
+
*/
|
86
|
+
/**
|
87
|
+
* @category Lifecycle events
|
88
|
+
*/
|
89
|
+
/**
|
90
|
+
* @category Lifecycle events
|
91
|
+
*/
|
92
|
+
/**
|
93
|
+
* @category Lifecycle events
|
94
|
+
*/
|
95
|
+
/**
|
96
|
+
* @category Lifecycle events
|
97
|
+
*/
|
98
|
+
/**
|
99
|
+
* @category Lifecycle events
|
100
|
+
*/
|
101
|
+
/**
|
102
|
+
* @category Lifecycle events
|
103
|
+
*/
|
104
|
+
/**
|
105
|
+
* @category Lifecycle events
|
106
|
+
*/
|
107
|
+
/**
|
108
|
+
* @category Lifecycle events
|
109
|
+
*/
|
110
|
+
/**
|
111
|
+
* @category Lifecycle events
|
112
|
+
*/
|
113
|
+
/**
|
114
|
+
* @category Lifecycle events
|
115
|
+
*/
|
116
|
+
/**
|
117
|
+
* @category Lifecycle events
|
118
|
+
*/
|
119
|
+
/**
|
120
|
+
* @category Lifecycle events
|
121
|
+
*/
|
122
|
+
/**
|
123
|
+
* @category Lifecycle events
|
124
|
+
*/
|
125
|
+
/**
|
126
|
+
* @category Lifecycle events
|
127
|
+
*/
|
128
|
+
/**
|
129
|
+
* @category Lifecycle events
|
130
|
+
*/
|
131
|
+
/**
|
132
|
+
* @category Lifecycle events
|
133
|
+
*/
|
134
|
+
/**
|
135
|
+
* @category Lifecycle events
|
136
|
+
*/
|
137
|
+
/**
|
138
|
+
* @category Lifecycle events
|
139
|
+
*/
|
140
|
+
/**
|
141
|
+
* @category Lifecycle events
|
142
|
+
*/
|
143
|
+
/**
|
144
|
+
* @category Lifecycle events
|
145
|
+
*/
|
146
|
+
/**
|
147
|
+
* @category Lifecycle events
|
148
|
+
*/
|
149
|
+
/**
|
150
|
+
* Headless CMS
|
151
|
+
*/
|
152
|
+
|
153
|
+
//# sourceMappingURL=types.js.map
|