@webiny/api-apw 0.0.0-unstable.de38392959 → 0.0.0-unstable.e0bfc55d5a
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.d.ts +1 -1
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.d.ts +1 -1
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.d.ts +1 -1
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.d.ts +1 -1
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.d.ts +1 -1
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/crud/createChangeRequestMethods.d.ts +1 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.d.ts +1 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.d.ts +2 -2
- package/crud/createContentReviewMethods.js +1 -2
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.d.ts +1 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.d.ts +1 -1
- package/crud/index.js.map +1 -1
- package/crud/utils.d.ts +2 -2
- package/crud/utils.js +1 -2
- package/crud/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +4 -5
- package/index.js.map +1 -1
- package/package.json +32 -43
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +1 -1
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.d.ts +2 -2
- package/plugins/cms/apwEntryPlugins.js +10 -1
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.d.ts +4 -4
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.d.ts +2 -2
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.d.ts +2 -2
- package/plugins/cms/linkWorkflowToEntry.js +1 -1
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.d.ts +2 -2
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.d.ts +3 -3
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +2 -2
- package/plugins/cms/utils.js +1 -3
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +3 -3
- package/plugins/context.js +3 -14
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.d.ts +1 -1
- package/plugins/graphql/changeRequest.gql.js +1 -2
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.d.ts +1 -1
- package/plugins/graphql/comment.gql.js +1 -2
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.d.ts +1 -1
- package/plugins/graphql/contentReview.gql.js +1 -2
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.d.ts +1 -1
- package/plugins/graphql/reviewer.gql.js +1 -2
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.js +2 -4
- package/plugins/graphql/utils.js.map +1 -1
- package/plugins/graphql/workflow.gql.d.ts +1 -1
- package/plugins/graphql/workflow.gql.js +1 -2
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.d.ts +1 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.d.ts +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.d.ts +1 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.d.ts +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +1 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.d.ts +3 -3
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +2 -2
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +2 -2
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +2 -2
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.d.ts +2 -2
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/getAppUrl.d.ts +2 -0
- package/plugins/hooks/notifications/getAppUrl.js +19 -0
- package/plugins/hooks/notifications/getAppUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.d.ts +1 -1
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.d.ts +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.d.ts +1 -1
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.d.ts +1 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.d.ts +1 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.d.ts +1 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/utils.d.ts +6 -5
- package/plugins/utils.js +6 -5
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.d.ts +1 -1
- package/scheduler/createScheduleActionMethods.js +63 -38
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +2 -2
- package/scheduler/handlers/executeAction/index.js +0 -1
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +3 -2
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.d.ts +2 -2
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +2 -2
- package/scheduler/handlers/scheduleAction/index.js +1 -3
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +3 -3
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +1 -1
- package/scheduler/handlers/utils.js +15 -7
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.d.ts +1 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +11 -11
- package/scheduler/types.js +3 -6
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.d.ts +2 -2
- package/storageOperations/changeRequestStorageOperations.js +13 -25
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.d.ts +3 -3
- package/storageOperations/commentStorageOperations.js +15 -28
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -3
- package/storageOperations/contentReviewStorageOperations.js +14 -27
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +3 -3
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -1
- package/storageOperations/models/changeRequest.model.js +5 -6
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -1
- package/storageOperations/models/comment.model.js +5 -6
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -1
- package/storageOperations/models/contentReview.model.js +5 -6
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.d.ts +1 -1
- package/storageOperations/models/index.js +5 -5
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -1
- package/storageOperations/models/reviewer.model.js +5 -6
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.d.ts +2 -2
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +2 -2
- package/storageOperations/models/workflow.model.js +5 -6
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +3 -3
- package/storageOperations/reviewerStorageOperations.js +14 -27
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.d.ts +2 -2
- package/storageOperations/types.js.map +1 -1
- package/storageOperations/workflowStorageOperations.d.ts +2 -2
- package/storageOperations/workflowStorageOperations.js +11 -24
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +31 -48
- package/types.js +6 -12
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.d.ts +2 -2
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.d.ts +2 -2
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +1 -1
- package/utils/pickEntryFieldValues.js +1 -2
- package/utils/pickEntryFieldValues.js.map +1 -1
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.d.ts +0 -2
- package/plugins/hooks/notifications/appUrl.js +0 -20
- package/plugins/hooks/notifications/appUrl.js.map +0 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +0 -9
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +0 -36
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +0 -1
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +0 -3
- package/plugins/pageBuilder/apwContentPagePlugins.js +0 -28
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +0 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +0 -3
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +0 -22
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +0 -1
- package/plugins/pageBuilder/index.d.ts +0 -11
- package/plugins/pageBuilder/index.js +0 -44
- package/plugins/pageBuilder/index.js.map +0 -1
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +0 -8
- package/plugins/pageBuilder/linkContentReviewToPage.js +0 -93
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +0 -1
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +0 -8
- package/plugins/pageBuilder/linkWorkflowToPage.js +0 -166
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +0 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +0 -33
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/commentNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +0 -33
- package/plugins/pageBuilder/notifications/commentNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +0 -33
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/contentUrl.d.ts +0 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +0 -49
- package/plugins/pageBuilder/notifications/contentUrl.js.map +0 -1
- package/plugins/pageBuilder/triggerContentReview.d.ts +0 -8
- package/plugins/pageBuilder/triggerContentReview.js +0 -41
- package/plugins/pageBuilder/triggerContentReview.js.map +0 -1
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +0 -10
- package/plugins/pageBuilder/updateContentReviewStatus.js +0 -72
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +0 -1
- package/plugins/pageBuilder/utils.d.ts +0 -22
- package/plugins/pageBuilder/utils.js +0 -152
- package/plugins/pageBuilder/utils.js.map +0 -1
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.createReviewerModel = exports.REVIEWER_MODEL_ID = void 0;
|
7
7
|
var _utils = require("./utils");
|
8
8
|
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
9
9
|
const idField = () => (0, _utils.createModelField)({
|
@@ -48,16 +48,15 @@ const emailField = () => (0, _utils.createModelField)({
|
|
48
48
|
}
|
49
49
|
}]
|
50
50
|
});
|
51
|
-
const REVIEWER_MODEL_ID = "apwReviewerModelDefinition";
|
52
|
-
|
53
|
-
|
54
|
-
return (0, _apiHeadlessCms.createPrivateModelDefinition)({
|
51
|
+
const REVIEWER_MODEL_ID = exports.REVIEWER_MODEL_ID = "apwReviewerModelDefinition";
|
52
|
+
const createReviewerModel = () => {
|
53
|
+
return (0, _apiHeadlessCms.createPrivateModel)({
|
55
54
|
name: "APW - Reviewer",
|
56
55
|
titleFieldId: "displayName",
|
57
56
|
modelId: REVIEWER_MODEL_ID,
|
58
57
|
fields: [idField(), displayNameField(), typeField(), emailField()]
|
59
58
|
});
|
60
59
|
};
|
61
|
-
exports.
|
60
|
+
exports.createReviewerModel = createReviewerModel;
|
62
61
|
|
63
62
|
//# sourceMappingURL=reviewer.model.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_utils","require","_apiHeadlessCms","idField","createModelField","label","type","parent","validation","message","name","displayNameField","typeField","emailField","fieldId","settings","preset","regex","flags","REVIEWER_MODEL_ID","exports","
|
1
|
+
{"version":3,"names":["_utils","require","_apiHeadlessCms","idField","createModelField","label","type","parent","validation","message","name","displayNameField","typeField","emailField","fieldId","settings","preset","regex","flags","REVIEWER_MODEL_ID","exports","createReviewerModel","createPrivateModel","titleFieldId","modelId","fields"],"sources":["reviewer.model.ts"],"sourcesContent":["import { createModelField } from \"./utils\";\nimport { createPrivateModel } from \"@webiny/api-headless-cms\";\n\nconst idField = () =>\n createModelField({\n label: \"Identity Id\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`identityId` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst displayNameField = () =>\n createModelField({\n label: \"Display Name\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`displayName` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst typeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`type` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst emailField = () =>\n createModelField({\n label: \"E-mail\",\n fieldId: \"email\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`email` field value in reviewer accepts only e-mails.\",\n name: \"pattern\",\n settings: {\n preset: \"email\",\n regex: null,\n flags: null\n }\n }\n ]\n });\n\nexport const REVIEWER_MODEL_ID = \"apwReviewerModelDefinition\";\n\nexport const createReviewerModel = () => {\n return createPrivateModel({\n name: \"APW - Reviewer\",\n titleFieldId: \"displayName\",\n modelId: REVIEWER_MODEL_ID,\n fields: [idField(), displayNameField(), typeField(), emailField()]\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,MAAME,OAAO,GAAGA,CAAA,KACZ,IAAAC,uBAAgB,EAAC;EACbC,KAAK,EAAE,aAAa;EACpBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,UAAU;EAClBC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,mDAAmD;IAC5DC,IAAI,EAAE;EACV,CAAC;AAET,CAAC,CAAC;AAEN,MAAMC,gBAAgB,GAAGA,CAAA,KACrB,IAAAP,uBAA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elField } from "@webiny/api-headless-cms/types";
|
2
|
-
import { CreateModelFieldParams } from "../../plugins/utils";
|
1
|
+
import type { CmsModelField } from "@webiny/api-headless-cms/types";
|
2
|
+
import type { CreateModelFieldParams } from "../../plugins/utils";
|
3
3
|
export declare const createModelField: (params: CreateModelFieldParams) => CmsModelField;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_camelCase","_interopRequireDefault","require","createModelField","params","label","fieldId","initialFieldId","type","parent","camelCase","id","storageId","settings","listValidation","validation","multipleValues","predefinedValues","values","enabled","exports"],"sources":["utils.ts"],"sourcesContent":["import camelCase from \"lodash/camelCase\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { CreateModelFieldParams } from \"~/plugins/utils\";\n\nexport const createModelField = (params: CreateModelFieldParams): CmsModelField => {\n const { label, fieldId: initialFieldId, type, parent } = params;\n const fieldId = initialFieldId ? camelCase(initialFieldId) : camelCase(label);\n return {\n id: `${camelCase(parent)}_${fieldId}`,\n storageId: fieldId,\n fieldId,\n label,\n type,\n settings: params.settings || {},\n listValidation: params.listValidation || [],\n validation: params.validation || [],\n multipleValues: params.multipleValues || false,\n predefinedValues: params.predefinedValues || {\n values: [],\n enabled: false\n }\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIO,MAAMC,gBAAgB,GAAIC,MAA8B,IAAoB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,OAAO,EAAEC,cAAc;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGL,MAAM;EAC/D,MAAME,OAAO,GAAGC,cAAc,GAAG,IAAAG,kBAAS,EAACH,cAAc,CAAC,GAAG,IAAAG,kBAAS,EAACL,KAAK,CAAC;EAC7E,OAAO;IACHM,EAAE,
|
1
|
+
{"version":3,"names":["_camelCase","_interopRequireDefault","require","createModelField","params","label","fieldId","initialFieldId","type","parent","camelCase","id","storageId","settings","listValidation","validation","multipleValues","predefinedValues","values","enabled","exports"],"sources":["utils.ts"],"sourcesContent":["import camelCase from \"lodash/camelCase\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport type { CreateModelFieldParams } from \"~/plugins/utils\";\n\nexport const createModelField = (params: CreateModelFieldParams): CmsModelField => {\n const { label, fieldId: initialFieldId, type, parent } = params;\n const fieldId = initialFieldId ? camelCase(initialFieldId) : camelCase(label);\n return {\n id: `${camelCase(parent)}_${fieldId}`,\n storageId: fieldId,\n fieldId,\n label,\n type,\n settings: params.settings || {},\n listValidation: params.listValidation || [],\n validation: params.validation || [],\n multipleValues: params.multipleValues || false,\n predefinedValues: params.predefinedValues || {\n values: [],\n enabled: false\n }\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIO,MAAMC,gBAAgB,GAAIC,MAA8B,IAAoB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,OAAO,EAAEC,cAAc;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGL,MAAM;EAC/D,MAAME,OAAO,GAAGC,cAAc,GAAG,IAAAG,kBAAS,EAACH,cAAc,CAAC,GAAG,IAAAG,kBAAS,EAACL,KAAK,CAAC;EAC7E,OAAO;IACHM,EAAE,EAAE,GAAG,IAAAD,kBAAS,EAACD,MAAM,CAAC,IAAIH,OAAO,EAAE;IACrCM,SAAS,EAAEN,OAAO;IAClBA,OAAO;IACPD,KAAK;IACLG,IAAI;IACJK,QAAQ,EAAET,MAAM,CAACS,QAAQ,IAAI,CAAC,CAAC;IAC/BC,cAAc,EAAEV,MAAM,CAACU,cAAc,IAAI,EAAE;IAC3CC,UAAU,EAAEX,MAAM,CAACW,UAAU,IAAI,EAAE;IACnCC,cAAc,EAAEZ,MAAM,CAACY,cAAc,IAAI,KAAK;IAC9CC,gBAAgB,EAAEb,MAAM,CAACa,gBAAgB,IAAI;MACzCC,MAAM,EAAE,EAAE;MACVC,OAAO,EAAE;IACb;EACJ,CAAC;AACL,CAAC;AAACC,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
1
|
+
import type { CmsModelField } from "@webiny/api-headless-cms/types";
|
2
2
|
export declare const stepTitleField: () => CmsModelField;
|
3
3
|
export declare const stepTypeField: () => CmsModelField;
|
4
4
|
export declare const stepIdField: () => CmsModelField;
|
@@ -7,5 +7,5 @@ interface CreateWorkflowModelDefinitionParams {
|
|
7
7
|
reviewerModelId: string;
|
8
8
|
}
|
9
9
|
export declare const WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
|
10
|
-
export declare const
|
10
|
+
export declare const createWorkflowModel: ({ reviewerModelId }: CreateWorkflowModelDefinitionParams) => import("@webiny/api-headless-cms").CmsPrivateModelFull;
|
11
11
|
export {};
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.stepTypeField = exports.stepTitleField = exports.stepReviewersField = exports.stepIdField = exports.
|
6
|
+
exports.stepTypeField = exports.stepTitleField = exports.stepReviewersField = exports.stepIdField = exports.createWorkflowModel = exports.WORKFLOW_MODEL_ID = void 0;
|
7
7
|
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
8
8
|
var _utils = require("./utils");
|
9
9
|
var _types = require("../../types");
|
@@ -165,12 +165,11 @@ const applicationField = () => (0, _utils.createModelField)({
|
|
165
165
|
}]
|
166
166
|
}
|
167
167
|
});
|
168
|
-
const WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
|
169
|
-
|
170
|
-
const createWorkflowModelDefinition = ({
|
168
|
+
const WORKFLOW_MODEL_ID = exports.WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
|
169
|
+
const createWorkflowModel = ({
|
171
170
|
reviewerModelId
|
172
171
|
}) => {
|
173
|
-
return (0, _apiHeadlessCms.
|
172
|
+
return (0, _apiHeadlessCms.createPrivateModel)({
|
174
173
|
name: "APW - Workflow",
|
175
174
|
/**
|
176
175
|
* Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.
|
@@ -180,6 +179,6 @@ const createWorkflowModelDefinition = ({
|
|
180
179
|
fields: [titleField(), stepsField([stepTitleField(), stepTypeField(), stepIdField(), stepReviewersField(reviewerModelId)]), scopeField([scopeTypeField(), scopeDataField([scopeDataPbCategories(), scopeDataPbPages(), scopeDataCmsModels(), scopeDataCmsEntries()])]), applicationField()]
|
181
180
|
});
|
182
181
|
};
|
183
|
-
exports.
|
182
|
+
exports.createWorkflowModel = createWorkflowModel;
|
184
183
|
|
185
184
|
//# sourceMappingURL=workflow.model.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_apiHeadlessCms","require","_utils","_types","titleField","createModelField","label","type","parent","validation","message","name","stepsField","fields","settings","multipleValues","stepTitleField","exports","stepTypeField","predefinedValues","enabled","values","value","stepIdField","stepReviewersField","reviewerModelId","models","modelId","listValidation","scopeField","scopeTypeField","WorkflowScopeTypes","DEFAULT","CUSTOM","scopeDataField","scopeDataPbCategories","scopeDataPbPages","scopeDataCmsModels","scopeDataCmsEntries","applicationField","WORKFLOW_MODEL_ID","createWorkflowModelDefinition","createPrivateModelDefinition","titleFieldId"],"sources":["workflow.model.ts"],"sourcesContent":["import { createPrivateModelDefinition } from \"@webiny/api-headless-cms\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { createModelField } from \"./utils\";\nimport { WorkflowScopeTypes } from \"~/types\";\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow\",\n validation: [\n {\n message: \"`title` field value is required in workflow.\",\n name: \"required\"\n }\n ]\n });\n\nconst stepsField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Steps\",\n type: \"object\",\n parent: \"workflow\",\n settings: {\n fields\n },\n multipleValues: true\n });\n\nexport const stepTitleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`title` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepTypeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"workflow steps\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"mandatoryBlocking\",\n label: \"Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. \"\n },\n {\n value: \"mandatoryNonBlocking\",\n label: \"Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. \"\n },\n {\n value: \"notMandatory\",\n label: \"Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not.\"\n }\n ]\n },\n validation: [\n {\n name: \"required\",\n message: \"`type` field value is required in workflow steps.\"\n }\n ]\n });\n\nexport const stepIdField = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`id` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepReviewersField = (reviewerModelId: string) =>\n createModelField({\n label: \"Reviewers\",\n type: \"ref\",\n parent: \"workflow steps\",\n multipleValues: true,\n settings: {\n models: [\n {\n modelId: reviewerModelId\n }\n ]\n },\n listValidation: [\n {\n name: \"minLength\",\n message: \"Value is too short.\",\n settings: {\n value: \"1\"\n }\n }\n ]\n });\n\nconst scopeField = (fields: CmsModelField[]) =>\n createModelField({\n type: \"object\",\n label: \"Scope\",\n parent: \"workflow\",\n settings: {\n fields\n }\n });\n\nconst scopeTypeField = () =>\n createModelField({\n label: \"Type\",\n parent: \"workflow scope\",\n type: \"text\",\n validation: [\n {\n message: \"`type` field value is required in workflow scope.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: WorkflowScopeTypes.DEFAULT,\n label: \"Default - Catch all scope that applies to all content that's being published.\"\n },\n {\n value: WorkflowScopeTypes.CUSTOM,\n label: \"Custom - The workflow will be applied to all selected content.\"\n }\n ]\n }\n });\n\nconst scopeDataField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Data\",\n parent: \"workflow scope\",\n type: \"object\",\n settings: {\n fields\n }\n });\n\nconst scopeDataPbCategories = () =>\n createModelField({\n label: \"Categories\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataPbPages = () =>\n createModelField({\n label: \"Pages\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsModels = () =>\n createModelField({\n label: \"Models\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsEntries = () =>\n createModelField({\n label: \"Entries\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\n\nconst applicationField = () =>\n createModelField({\n parent: \"workflow\",\n type: \"text\",\n label: \"App\",\n validation: [\n {\n message: \"`app` field value is required in workflow.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n { label: \"Page Builder\", value: \"pageBuilder\" },\n { label: \"Headless CMS\", value: \"cms\" }\n ]\n }\n });\n\ninterface CreateWorkflowModelDefinitionParams {\n reviewerModelId: string;\n}\n\nexport const WORKFLOW_MODEL_ID = \"apwWorkflowModelDefinition\";\n\nexport const createWorkflowModelDefinition = ({\n reviewerModelId\n}: CreateWorkflowModelDefinitionParams) => {\n return createPrivateModelDefinition({\n name: \"APW - Workflow\",\n /**\n * Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.\n */\n modelId: WORKFLOW_MODEL_ID,\n titleFieldId: \"title\",\n fields: [\n titleField(),\n stepsField([\n stepTitleField(),\n stepTypeField(),\n stepIdField(),\n stepReviewersField(reviewerModelId)\n ]),\n scopeField([\n scopeTypeField(),\n scopeDataField([\n scopeDataPbCategories(),\n scopeDataPbPages(),\n scopeDataCmsModels(),\n scopeDataCmsEntries()\n ])\n ]),\n applicationField()\n ]\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,I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,EAAE,KAAK;EACZG,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,4CAA4C;IACrDC,IAAI,EAAE;EACV,CAAC,CACJ;EACDQ,gBAAgB,EAAE;IACdC,OAAO,EAAE,IAAI;IACbC,MAAM,EAAE,CACJ;MAAEf,KAAK,EAAE,cAAc;MAAEgB,KAAK,EAAE;IAAc,CAAC,EAC/C;MAAEhB,KAAK,EAAE,cAAc;MAAEgB,KAAK,EAAE;IAAM,CAAC;EAE/C;AACJ,CAAC,CAAC;AAMC,MAAMkB,iBAAiB,GAAG,4BAA4B;AAACvB,OAAA,CAAAuB,iBAAA,GAAAA,iBAAA;AAEvD,MAAMC,6BAA6B,GAAGA,CAAC;EAC1ChB;AACiC,CAAC,KAAK;EACvC,OAAO,IAAAiB,4CAA4B,EAAC;IAChC/B,IAAI,EAAE,gBAAgB;IACtB;AACR;AACA;IACQgB,OAAO,EAAEa,iBAAiB;IAC1BG,YAAY,EAAE,OAAO;IACrB9B,MAAM,EAAE,CACJT,UAAU,CAAC,CAAC,EACZQ,UAAU,CAAC,CACPI,cAAc,CAAC,CAAC,EAChBE,aAAa,CAAC,CAAC,EACfK,WAAW,CAAC,CAAC,EACbC,kBAAkB,CAACC,eAAe,CAAC,CACtC,CAAC,EACFI,UAAU,CAAC,CACPC,cAAc,CAAC,CAAC,EAChBI,cAAc,CAAC,CACXC,qBAAqB,CAAC,CAAC,EACvBC,gBAAgB,CAAC,CAAC,EAClBC,kBAAkB,CAAC,CAAC,EACpBC,mBAAmB,CAAC,CAAC,CACxB,CAAC,CACL,CAAC,EACFC,gBAAgB,CAAC,CAAC;EAE1B,CAAC,CAAC;AACN,CAAC;AAACtB,OAAA,CAAAwB,6BAAA,GAAAA,6BAAA"}
|
1
|
+
{"version":3,"names":["_apiHeadlessCms","require","_utils","_types","titleField","createModelField","label","type","parent","validation","message","name","stepsField","fields","settings","multipleValues","stepTitleField","exports","stepTypeField","predefinedValues","enabled","values","value","stepIdField","stepReviewersField","reviewerModelId","models","modelId","listValidation","scopeField","scopeTypeField","WorkflowScopeTypes","DEFAULT","CUSTOM","scopeDataField","scopeDataPbCategories","scopeDataPbPages","scopeDataCmsModels","scopeDataCmsEntries","applicationField","WORKFLOW_MODEL_ID","createWorkflowModel","createPrivateModel","titleFieldId"],"sources":["workflow.model.ts"],"sourcesContent":["import { createPrivateModel } from \"@webiny/api-headless-cms\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { createModelField } from \"./utils\";\nimport { WorkflowScopeTypes } from \"~/types\";\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow\",\n validation: [\n {\n message: \"`title` field value is required in workflow.\",\n name: \"required\"\n }\n ]\n });\n\nconst stepsField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Steps\",\n type: \"object\",\n parent: \"workflow\",\n settings: {\n fields\n },\n multipleValues: true\n });\n\nexport const stepTitleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`title` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepTypeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"workflow steps\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"mandatoryBlocking\",\n label: \"Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. \"\n },\n {\n value: \"mandatoryNonBlocking\",\n label: \"Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. \"\n },\n {\n value: \"notMandatory\",\n label: \"Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not.\"\n }\n ]\n },\n validation: [\n {\n name: \"required\",\n message: \"`type` field value is required in workflow steps.\"\n }\n ]\n });\n\nexport const stepIdField = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`id` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepReviewersField = (reviewerModelId: string) =>\n createModelField({\n label: \"Reviewers\",\n type: \"ref\",\n parent: \"workflow steps\",\n multipleValues: true,\n settings: {\n models: [\n {\n modelId: reviewerModelId\n }\n ]\n },\n listValidation: [\n {\n name: \"minLength\",\n message: \"Value is too short.\",\n settings: {\n value: \"1\"\n }\n }\n ]\n });\n\nconst scopeField = (fields: CmsModelField[]) =>\n createModelField({\n type: \"object\",\n label: \"Scope\",\n parent: \"workflow\",\n settings: {\n fields\n }\n });\n\nconst scopeTypeField = () =>\n createModelField({\n label: \"Type\",\n parent: \"workflow scope\",\n type: \"text\",\n validation: [\n {\n message: \"`type` field value is required in workflow scope.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: WorkflowScopeTypes.DEFAULT,\n label: \"Default - Catch all scope that applies to all content that's being published.\"\n },\n {\n value: WorkflowScopeTypes.CUSTOM,\n label: \"Custom - The workflow will be applied to all selected content.\"\n }\n ]\n }\n });\n\nconst scopeDataField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Data\",\n parent: \"workflow scope\",\n type: \"object\",\n settings: {\n fields\n }\n });\n\nconst scopeDataPbCategories = () =>\n createModelField({\n label: \"Categories\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataPbPages = () =>\n createModelField({\n label: \"Pages\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsModels = () =>\n createModelField({\n label: \"Models\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsEntries = () =>\n createModelField({\n label: \"Entries\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\n\nconst applicationField = () =>\n createModelField({\n parent: \"workflow\",\n type: \"text\",\n label: \"App\",\n validation: [\n {\n message: \"`app` field value is required in workflow.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n { label: \"Page Builder\", value: \"pageBuilder\" },\n { label: \"Headless CMS\", value: \"cms\" }\n ]\n }\n });\n\ninterface CreateWorkflowModelDefinitionParams {\n reviewerModelId: string;\n}\n\nexport const WORKFLOW_MODEL_ID = \"apwWorkflowModelDefinition\";\n\nexport const createWorkflowModel = ({ reviewerModelId }: CreateWorkflowModelDefinitionParams) => {\n return createPrivateModel({\n name: \"APW - Workflow\",\n /**\n * Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.\n */\n modelId: WORKFLOW_MODEL_ID,\n titleFieldId: \"title\",\n fields: [\n titleField(),\n stepsField([\n stepTitleField(),\n stepTypeField(),\n stepIdField(),\n stepReviewersField(reviewerModelId)\n ]),\n scopeField([\n scopeTypeField(),\n scopeDataField([\n scopeDataPbCategories(),\n scopeDataPbPages(),\n scopeDataCmsModels(),\n scopeDataCmsEntries()\n ])\n ]),\n applicationField()\n ]\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,MAAMG,UAAU,GAAGA,CAAA,KACf,IAAAC,uBAAgB,EAAC;EACbC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,UAAU;EAClBC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,8CAA8C;IACvDC,IAAI,EAAE;EACV,CAAC;AAET,CAAC,CAAC;AAEN,MAAMC,UAAU,GAAIC,MAAuB,IACvC,IAAAR,uBAAgB,EAAC;EACbC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAE,UAAU;EAClBM,QAAQ,EAAE;IACND;EACJ,CAAC;EACDE,cAAc,EAAE;AACpB,CAAC,CAAC;AAEC,MAAMC,cAAc,GAAGA,CAAA,KAC1B,IAAAX,uBAAgB,EAAC;EACbC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,gBAAgB;EACxBC,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UAAU,CAAC,CACPI,cAAc,CAAC,CAAC,EAChBE,aAAa,CAAC,CAAC,EACfK,WAAW,CAAC,CAAC,EACbC,kBAAkB,CAACC,eAAe,CAAC,CACtC,CAAC,EACFI,UAAU,CAAC,CACPC,cAAc,CAAC,CAAC,EAChBI,cAAc,CAAC,CACXC,qBAAqB,CAAC,CAAC,EACvBC,gBAAgB,CAAC,CAAC,EAClBC,kBAAkB,CAAC,CAAC,EACpBC,mBAAmB,CAAC,CAAC,CACxB,CAAC,CACL,CAAC,EACFC,gBAAgB,CAAC,CAAC;EAE1B,CAAC,CAAC;AACN,CAAC;AAACtB,OAAA,CAAAwB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ApwReviewerStorageOperations } from "./types";
|
2
|
-
import { CreateApwStorageOperationsParams } from "
|
3
|
-
export declare const createReviewerStorageOperations: ({ cms
|
1
|
+
import type { ApwReviewerStorageOperations } from "./types";
|
2
|
+
import type { CreateApwStorageOperationsParams } from "./";
|
3
|
+
export declare const createReviewerStorageOperations: ({ cms }: CreateApwStorageOperationsParams) => ApwReviewerStorageOperations;
|
@@ -8,13 +8,10 @@ exports.createReviewerStorageOperations = void 0;
|
|
8
8
|
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
9
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
10
10
|
const createReviewerStorageOperations = ({
|
11
|
-
cms
|
12
|
-
security
|
11
|
+
cms
|
13
12
|
}) => {
|
14
13
|
const getReviewerModel = async () => {
|
15
|
-
const model = await
|
16
|
-
return cms.getModel("apwReviewerModelDefinition");
|
17
|
-
});
|
14
|
+
const model = await cms.getModel("apwReviewerModelDefinition");
|
18
15
|
if (!model) {
|
19
16
|
throw new _error.default("Could not find `apwReviewerModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
20
17
|
}
|
@@ -24,9 +21,7 @@ const createReviewerStorageOperations = ({
|
|
24
21
|
id
|
25
22
|
}) => {
|
26
23
|
const model = await getReviewerModel();
|
27
|
-
const entry = await
|
28
|
-
return cms.getEntryById(model, id);
|
29
|
-
});
|
24
|
+
const entry = await cms.getEntryById(model, id);
|
30
25
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
31
26
|
};
|
32
27
|
return {
|
@@ -34,21 +29,17 @@ const createReviewerStorageOperations = ({
|
|
34
29
|
getReviewer,
|
35
30
|
async listReviewers(params) {
|
36
31
|
const model = await getReviewerModel();
|
37
|
-
const [entries, meta] = await
|
38
|
-
|
39
|
-
|
40
|
-
where
|
41
|
-
|
42
|
-
}
|
43
|
-
});
|
32
|
+
const [entries, meta] = await cms.listLatestEntries(model, {
|
33
|
+
...params,
|
34
|
+
where: {
|
35
|
+
...params.where
|
36
|
+
}
|
44
37
|
});
|
45
38
|
return [entries.map(_pickEntryFieldValues.pickEntryFieldValues), meta];
|
46
39
|
},
|
47
40
|
async createReviewer(params) {
|
48
41
|
const model = await getReviewerModel();
|
49
|
-
const entry = await
|
50
|
-
return cms.createEntry(model, params.data);
|
51
|
-
});
|
42
|
+
const entry = await cms.createEntry(model, params.data);
|
52
43
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
53
44
|
},
|
54
45
|
async updateReviewer(params) {
|
@@ -60,20 +51,16 @@ const createReviewerStorageOperations = ({
|
|
60
51
|
const existingEntry = await getReviewer({
|
61
52
|
id: params.id
|
62
53
|
});
|
63
|
-
const entry = await
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
savedOn: new Date()
|
68
|
-
});
|
54
|
+
const entry = await cms.updateEntry(model, params.id, {
|
55
|
+
...existingEntry,
|
56
|
+
...params.data,
|
57
|
+
savedOn: new Date()
|
69
58
|
});
|
70
59
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
71
60
|
},
|
72
61
|
async deleteReviewer(params) {
|
73
62
|
const model = await getReviewerModel();
|
74
|
-
await
|
75
|
-
return cms.deleteEntry(model, params.id);
|
76
|
-
});
|
63
|
+
await cms.deleteEntry(model, params.id);
|
77
64
|
return true;
|
78
65
|
}
|
79
66
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","createReviewerStorageOperations","cms","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","createReviewerStorageOperations","cms","getReviewerModel","model","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 type { ApwReviewerStorageOperations } from \"./types\";\nimport type { CreateApwStorageOperationsParams } from \"~/storageOperations\";\nimport { pickEntryFieldValues } from \"~/utils/pickEntryFieldValues\";\nimport WebinyError from \"@webiny/error\";\nimport type { ApwReviewer } from \"~/types\";\n\nexport const createReviewerStorageOperations = ({\n cms\n}: CreateApwStorageOperationsParams): ApwReviewerStorageOperations => {\n const getReviewerModel = async () => {\n const model = await cms.getModel(\"apwReviewerModelDefinition\");\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 cms.getEntryById(model, id);\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 cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n return [entries.map(pickEntryFieldValues<ApwReviewer>), meta];\n },\n async createReviewer(params) {\n const model = await getReviewerModel();\n const entry = await cms.createEntry(model, params.data);\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 cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n return pickEntryFieldValues(entry);\n },\n async deleteReviewer(params) {\n const model = await getReviewerModel();\n\n await cms.deleteEntry(model, params.id);\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;AAC8B,CAAC,KAAmC;EAClE,MAAMC,gBAAgB,GAAG,MAAAA,CAAA,KAAY;IACjC,MAAMC,KAAK,GAAG,MAAMF,GAAG,CAACG,QAAQ,CAAC,4BAA4B,CAAC;IAC9D,IAAI,CAACD,KAAK,EAAE;MACR,MAAM,IAAIE,cAAW,CACjB,oDAAoD,EACpD,uBACJ,CAAC;IACL;IACA,OAAOF,KAAK;EAChB,CAAC;EACD,MAAMG,WAAwD,GAAG,MAAAA,CAAO;IAAEC;EAAG,CAAC,KAAK;IAC/E,MAAMJ,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;IAEtC,MAAMM,KAAK,GAAG,MAAMP,GAAG,CAACQ,YAAY,CAACN,KAAK,EAAEI,EAAE,CAAC;IAC/C,OAAO,IAAAG,0CAAoB,EAACF,KAAK,CAAC;EACtC,CAAC;EACD,OAAO;IACHN,gBAAgB;IAChBI,WAAW;IACX,MAAMK,aAAaA,CAACC,MAAM,EAAE;MACxB,MAAMT,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MAEtC,MAAM,CAACW,OAAO,EAAEC,IAAI,CAAC,GAAG,MAAMb,GAAG,CAACc,iBAAiB,CAACZ,KAAK,EAAE;QACvD,GAAGS,MAAM;QACTI,KAAK,EAAE;UACH,GAAGJ,MAAM,CAACI;QACd;MACJ,CAAC,CAAC;MACF,OAAO,CAACH,OAAO,CAACI,GAAG,CAACP,0CAAiC,CAAC,EAAEI,IAAI,CAAC;IACjE,CAAC;IACD,MAAMI,cAAcA,CAACN,MAAM,EAAE;MACzB,MAAMT,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MACtC,MAAMM,KAAK,GAAG,MAAMP,GAAG,CAACkB,WAAW,CAAChB,KAAK,EAAES,MAAM,CAACQ,IAAI,CAAC;MACvD,OAAO,IAAAV,0CAAoB,EAACF,KAAK,CAAC;IACtC,CAAC;IACD,MAAMa,cAAcA,CAACT,MAAM,EAAE;MACzB,MAAMT,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MACtC;AACZ;AACA;AACA;MACY,MAAMoB,aAAa,GAAG,MAAMhB,WAAW,CAAC;QAAEC,EAAE,EAAEK,MAAM,CAACL;MAAG,CAAC,CAAC;MAE1D,MAAMC,KAAK,GAAG,MAAMP,GAAG,CAACsB,WAAW,CAACpB,KAAK,EAAES,MAAM,CAACL,EAAE,EAAE;QAClD,GAAGe,aAAa;QAChB,GAAGV,MAAM,CAACQ,IAAI;QACdI,OAAO,EAAE,IAAIC,IAAI,CAAC;MACtB,CAAC,CAAC;MACF,OAAO,IAAAf,0CAAoB,EAACF,KAAK,CAAC;IACtC,CAAC;IACD,MAAMkB,cAAcA,CAACd,MAAM,EAAE;MACzB,MAAMT,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MAEtC,MAAMD,GAAG,CAAC0B,WAAW,CAACxB,KAAK,EAAES,MAAM,CAACL,EAAE,CAAC;MACvC,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAACqB,OAAA,CAAA5B,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
2
|
-
import { ApwReviewerStorageOperations as BaseApwReviewerStorageOperations, ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations, ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations, ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations, ApwCommentStorageOperations as BaseApwCommentStorageOperations } from "../types";
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
2
|
+
import type { ApwReviewerStorageOperations as BaseApwReviewerStorageOperations, ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations, ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations, ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations, ApwCommentStorageOperations as BaseApwCommentStorageOperations } from "../types";
|
3
3
|
export interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {
|
4
4
|
/**
|
5
5
|
* @internal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport {\n ApwReviewerStorageOperations as BaseApwReviewerStorageOperations,\n ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations,\n ApwCommentStorageOperations as BaseApwCommentStorageOperations\n} from \"~/types\";\n\nexport interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {\n /**\n * @internal\n */\n getCommentModel(): Promise<CmsModel>;\n}\n\nexport interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {\n /**\n * @internal\n */\n getReviewerModel(): Promise<CmsModel>;\n}\n\nexport interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {\n /**\n * @internal\n */\n getWorkflowModel(): Promise<CmsModel>;\n}\n\nexport interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {\n /**\n * @internal\n */\n getContentReviewModel(): Promise<CmsModel>;\n}\n\nexport interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {\n /**\n * @internal\n */\n getChangeRequestModel(): Promise<CmsModel>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type {\n ApwReviewerStorageOperations as BaseApwReviewerStorageOperations,\n ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations,\n ApwCommentStorageOperations as BaseApwCommentStorageOperations\n} from \"~/types\";\n\nexport interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {\n /**\n * @internal\n */\n getCommentModel(): Promise<CmsModel>;\n}\n\nexport interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {\n /**\n * @internal\n */\n getReviewerModel(): Promise<CmsModel>;\n}\n\nexport interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {\n /**\n * @internal\n */\n getWorkflowModel(): Promise<CmsModel>;\n}\n\nexport interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {\n /**\n * @internal\n */\n getContentReviewModel(): Promise<CmsModel>;\n}\n\nexport interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {\n /**\n * @internal\n */\n getChangeRequestModel(): Promise<CmsModel>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n"],"mappings":"","ignoreList":[]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ApwWorkflowStorageOperations } from "./types";
|
2
|
-
import { CreateApwStorageOperationsParams } from "./index";
|
1
|
+
import type { ApwWorkflowStorageOperations } from "./types";
|
2
|
+
import type { CreateApwStorageOperationsParams } from "./index";
|
3
3
|
export declare const createWorkflowStorageOperations: (params: CreateApwStorageOperationsParams) => ApwWorkflowStorageOperations;
|
@@ -22,13 +22,10 @@ const formatReviewersForRefInput = (data, modelId) => {
|
|
22
22
|
};
|
23
23
|
const createWorkflowStorageOperations = params => {
|
24
24
|
const {
|
25
|
-
cms
|
26
|
-
security
|
25
|
+
cms
|
27
26
|
} = params;
|
28
27
|
const getWorkflowModel = async () => {
|
29
|
-
const model = await
|
30
|
-
return cms.getModel(_workflow.WORKFLOW_MODEL_ID);
|
31
|
-
});
|
28
|
+
const model = await cms.getModel(_workflow.WORKFLOW_MODEL_ID);
|
32
29
|
if (!model) {
|
33
30
|
throw new _error.default(`Could not find "${_workflow.WORKFLOW_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
34
31
|
}
|
@@ -38,9 +35,7 @@ const createWorkflowStorageOperations = params => {
|
|
38
35
|
id
|
39
36
|
}) => {
|
40
37
|
const model = await getWorkflowModel();
|
41
|
-
const entry = await
|
42
|
-
return cms.getEntryById(model, id);
|
43
|
-
});
|
38
|
+
const entry = await cms.getEntryById(model, id);
|
44
39
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
45
40
|
};
|
46
41
|
return {
|
@@ -48,13 +43,11 @@ const createWorkflowStorageOperations = params => {
|
|
48
43
|
getWorkflow,
|
49
44
|
async listWorkflows(params) {
|
50
45
|
const model = await getWorkflowModel();
|
51
|
-
const [entries, meta] = await
|
52
|
-
|
53
|
-
|
54
|
-
where
|
55
|
-
|
56
|
-
}
|
57
|
-
});
|
46
|
+
const [entries, meta] = await cms.listLatestEntries(model, {
|
47
|
+
...params,
|
48
|
+
where: {
|
49
|
+
...params.where
|
50
|
+
}
|
58
51
|
});
|
59
52
|
return [entries.map(_pickEntryFieldValues.pickEntryFieldValues), meta];
|
60
53
|
},
|
@@ -62,9 +55,7 @@ const createWorkflowStorageOperations = params => {
|
|
62
55
|
const model = await getWorkflowModel();
|
63
56
|
const reviewerModel = await this.getReviewerModel();
|
64
57
|
const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);
|
65
|
-
const entry = await
|
66
|
-
return cms.createEntry(model, data);
|
67
|
-
});
|
58
|
+
const entry = await cms.createEntry(model, data);
|
68
59
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
69
60
|
},
|
70
61
|
async updateWorkflow(params) {
|
@@ -83,16 +74,12 @@ const createWorkflowStorageOperations = params => {
|
|
83
74
|
savedOn: new Date()
|
84
75
|
};
|
85
76
|
const data = formatReviewersForRefInput(input, reviewerModel.modelId);
|
86
|
-
const entry = await
|
87
|
-
return cms.updateEntry(model, params.id, data);
|
88
|
-
});
|
77
|
+
const entry = await cms.updateEntry(model, params.id, data);
|
89
78
|
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
90
79
|
},
|
91
80
|
async deleteWorkflow(params) {
|
92
81
|
const model = await getWorkflowModel();
|
93
|
-
await
|
94
|
-
return cms.deleteEntry(model, params.id);
|
95
|
-
});
|
82
|
+
await cms.deleteEntry(model, params.id);
|
96
83
|
return true;
|
97
84
|
}
|
98
85
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","_workflow","formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","_workflow","formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","getWorkflowModel","model","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 type { ApwWorkflow, CreateApwWorkflowParams } from \"~/types\";\nimport type { ApwStorageOperations, ApwWorkflowStorageOperations } from \"./types\";\nimport type { 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 } = params;\n const getWorkflowModel = async () => {\n const model = await cms.getModel(WORKFLOW_MODEL_ID);\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 cms.getEntryById(model, id);\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 cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\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 cms.createEntry(model, data);\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 cms.updateEntry(model, params.id, data);\n\n return pickEntryFieldValues(entry);\n },\n async deleteWorkflow(params) {\n const model = await getWorkflowModel();\n\n await cms.deleteEntry(model, params.id);\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;EAAI,CAAC,GAAGD,MAAM;EACtB,MAAME,gBAAgB,GAAG,MAAAA,CAAA,KAAY;IACjC,MAAMC,KAAK,GAAG,MAAMF,GAAG,CAACG,QAAQ,CAACC,2BAAiB,CAAC;IACnD,IAAI,CAACF,KAAK,EAAE;MACR,MAAM,IAAIG,cAAW,CACjB,mBAAmBD,2BAAiB,UAAU,EAC9C,uBACJ,CAAC;IACL;IACA,OAAOF,KAAK;EAChB,CAAC;EACD,MAAMI,WAAwD,GAAG,MAAAA,CAAO;IAAET;EAAG,CAAC,KAAK;IAC/E,MAAMK,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;IACtC,MAAMM,KAAK,GAAG,MAAMP,GA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rB,MAAM,CAACR,IAAI;QACd+B,OAAO,EAAE,IAAIC,IAAI,CAAC;MACtB,CAAC;MACD,MAAMhC,IAAI,GAAGD,0BAA0B,CACnC+B,KAAK,EACLL,aAAa,CAACxB,OAClB,CAAC;MAED,MAAMe,KAAK,GAAG,MAAMP,GAAG,CAACwB,WAAW,CAACtB,KAAK,EAAEH,MAAM,CAACF,EAAE,EAAEN,IAAI,CAAC;MAE3D,OAAO,IAAAkB,0CAAoB,EAACF,KAAK,CAAC;IACtC,CAAC;IACD,MAAMkB,cAAcA,CAAC1B,MAAM,EAAE;MACzB,MAAMG,KAAK,GAAG,MAAMD,gBAAgB,CAAC,CAAC;MAEtC,MAAMD,GAAG,CAAC0B,WAAW,CAACxB,KAAK,EAAEH,MAAM,CAACF,EAAE,CAAC;MACvC,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAAC8B,OAAA,CAAA7B,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
package/types.d.ts
CHANGED
@@ -1,17 +1,14 @@
|
|
1
|
-
import { CmsEntry as BaseCmsEntry, OnEntryBeforePublishTopicParams, OnEntryAfterPublishTopicParams, OnEntryAfterUnpublishTopicParams } from "@webiny/api-headless-cms/types";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
import
|
11
|
-
import {
|
12
|
-
import { WcpContextObject } from "@webiny/api-wcp/types";
|
13
|
-
import { MailerContext } from "@webiny/api-mailer/types";
|
14
|
-
import { AdminSettingsContext } from "@webiny/api-admin-settings/types";
|
1
|
+
import type { CmsEntry as BaseCmsEntry, OnEntryBeforePublishTopicParams, OnEntryAfterPublishTopicParams, OnEntryAfterUnpublishTopicParams, CmsEntryListSort } from "@webiny/api-headless-cms/types";
|
2
|
+
import type { Context } from "@webiny/api/types";
|
3
|
+
import type { SecurityIdentity, SecurityPermission } from "@webiny/api-security/types";
|
4
|
+
import type { I18NLocale } from "@webiny/api-i18n/types";
|
5
|
+
import type { Tenant } from "@webiny/api-tenancy/types";
|
6
|
+
import type { Topic } from "@webiny/pubsub/types";
|
7
|
+
import type { ApwScheduleActionCrud, ScheduleActionContext } from "./scheduler/types";
|
8
|
+
import type HandlerClient from "@webiny/handler-client/HandlerClient";
|
9
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
10
|
+
import type { WcpContextObject } from "@webiny/api-wcp/types";
|
11
|
+
import type { MailerContext } from "@webiny/api-mailer/types";
|
15
12
|
export interface ApwCmsEntry extends BaseCmsEntry {
|
16
13
|
title: string;
|
17
14
|
meta: {
|
@@ -46,7 +43,7 @@ export interface ListWhere {
|
|
46
43
|
}
|
47
44
|
export interface ListParams {
|
48
45
|
where?: ListWhere;
|
49
|
-
sort?:
|
46
|
+
sort?: CmsEntryListSort;
|
50
47
|
limit?: number;
|
51
48
|
after?: string | null;
|
52
49
|
}
|
@@ -68,19 +65,6 @@ export declare enum ApwContentTypes {
|
|
68
65
|
PAGE = "page",
|
69
66
|
CMS_ENTRY = "cms_entry"
|
70
67
|
}
|
71
|
-
export interface PageSettingsWithWorkflow extends PageSettings {
|
72
|
-
apw: {
|
73
|
-
workflowId: string;
|
74
|
-
contentReviewId: string | null;
|
75
|
-
};
|
76
|
-
}
|
77
|
-
export interface PageWithWorkflow extends Page {
|
78
|
-
settings: PageSettingsWithWorkflow;
|
79
|
-
}
|
80
|
-
export declare type ApwOnPageBeforeCreateTopicParams = OnPageBeforeCreateTopicParams<PageWithWorkflow>;
|
81
|
-
export declare type ApwOnPageBeforeCreateFromTopicParams = OnPageBeforeCreateFromTopicParams<PageWithWorkflow>;
|
82
|
-
export declare type ApwOnPageBeforeUpdateTopicParams = OnPageBeforeUpdateTopicParams<PageWithWorkflow>;
|
83
|
-
export declare type ApwOnPageBeforePublishTopicParams = OnPageBeforePublishTopicParams<PageWithWorkflow>;
|
84
68
|
export declare enum WorkflowScopeTypes {
|
85
69
|
DEFAULT = "default",
|
86
70
|
CUSTOM = "custom"
|
@@ -193,7 +177,7 @@ export declare enum ApwContentReviewStatus {
|
|
193
177
|
READY_TO_BE_PUBLISHED = "readyToBePublished",
|
194
178
|
PUBLISHED = "published"
|
195
179
|
}
|
196
|
-
export
|
180
|
+
export type ApwContentReviewListFilter = ApwContentReviewStatus | "requiresMyAttention";
|
197
181
|
export interface ApwWorkflowStep<TReviewer = ApwReviewer> {
|
198
182
|
title: string;
|
199
183
|
type: ApwWorkflowStepTypes;
|
@@ -373,13 +357,13 @@ export interface ApwContentReviewCrud extends BaseApwCrud<ApwContentReview, Crea
|
|
373
357
|
onContentReviewAfterDelete: Topic<OnContentReviewAfterDeleteTopicParams>;
|
374
358
|
onContentReviewBeforeList: Topic<OnContentReviewBeforeListTopicParams>;
|
375
359
|
}
|
376
|
-
export
|
360
|
+
export type ContentGetter = (id: string, settings: {
|
377
361
|
modelId?: string;
|
378
|
-
}) => Promise<
|
379
|
-
export
|
362
|
+
}) => Promise<ApwCmsEntry | null>;
|
363
|
+
export type ContentPublisher = (id: string, settings: {
|
380
364
|
modelId?: string;
|
381
365
|
}) => Promise<boolean | null>;
|
382
|
-
export
|
366
|
+
export type ContentUnPublisher = (id: string, settings: {
|
383
367
|
modelId?: string;
|
384
368
|
}) => Promise<boolean | null>;
|
385
369
|
export interface AdvancedPublishingWorkflow {
|
@@ -396,9 +380,8 @@ export interface AdvancedPublishingWorkflow {
|
|
396
380
|
contentReview: ApwContentReviewCrud;
|
397
381
|
scheduleAction: ApwScheduleActionCrud;
|
398
382
|
}
|
399
|
-
export interface ApwContext extends Context, MailerContext
|
383
|
+
export interface ApwContext extends Context, MailerContext {
|
400
384
|
apw: AdvancedPublishingWorkflow;
|
401
|
-
pageBuilder: PageBuilderContextObject;
|
402
385
|
wcp: WcpContextObject;
|
403
386
|
scheduleAction: ScheduleActionContext["scheduleAction"];
|
404
387
|
}
|
@@ -420,7 +403,7 @@ export interface CreateApwParams {
|
|
420
403
|
interface StorageOperationsGetReviewerParams {
|
421
404
|
id: string;
|
422
405
|
}
|
423
|
-
|
406
|
+
type StorageOperationsListReviewersParams = ApwReviewerListParams;
|
424
407
|
interface CreateApwReviewerData {
|
425
408
|
identityId: string;
|
426
409
|
displayName: string | null;
|
@@ -449,8 +432,8 @@ interface StorageOperationsGetParams {
|
|
449
432
|
interface StorageOperationsDeleteParams {
|
450
433
|
id: string;
|
451
434
|
}
|
452
|
-
|
453
|
-
|
435
|
+
type StorageOperationsGetWorkflowParams = StorageOperationsGetParams;
|
436
|
+
type StorageOperationsListWorkflowsParams = ListParams;
|
454
437
|
interface StorageOperationsCreateWorkflowParams {
|
455
438
|
data: CreateApwWorkflowParams;
|
456
439
|
}
|
@@ -458,8 +441,8 @@ interface StorageOperationsUpdateWorkflowParams {
|
|
458
441
|
id: string;
|
459
442
|
data: UpdateApwWorkflowParams;
|
460
443
|
}
|
461
|
-
|
462
|
-
|
444
|
+
type StorageOperationsDeleteWorkflowParams = StorageOperationsDeleteParams;
|
445
|
+
type StorageOperationsGetContentReviewParams = StorageOperationsGetParams;
|
463
446
|
export interface ApwContentReviewListParams extends ListParams {
|
464
447
|
where: ListWhere & {
|
465
448
|
reviewStatus?: ApwContentReviewListFilter;
|
@@ -469,7 +452,7 @@ export interface ApwContentReviewListParams extends ListParams {
|
|
469
452
|
workflowId_in?: string[];
|
470
453
|
};
|
471
454
|
}
|
472
|
-
|
455
|
+
type StorageOperationsListContentReviewsParams = ApwContentReviewListParams;
|
473
456
|
interface StorageOperationsCreateContentReviewParams {
|
474
457
|
data: CreateApwContentReviewParams;
|
475
458
|
}
|
@@ -477,9 +460,9 @@ interface StorageOperationsUpdateContentReviewParams {
|
|
477
460
|
id: string;
|
478
461
|
data: UpdateApwContentReviewParams;
|
479
462
|
}
|
480
|
-
|
481
|
-
|
482
|
-
|
463
|
+
type StorageOperationsDeleteContentReviewParams = StorageOperationsDeleteParams;
|
464
|
+
type StorageOperationsGetChangeRequestParams = StorageOperationsGetParams;
|
465
|
+
type StorageOperationsListChangeRequestsParams = ApwChangeRequestListParams;
|
483
466
|
interface StorageOperationsCreateChangeRequestParams {
|
484
467
|
data: CreateApwChangeRequestParams;
|
485
468
|
}
|
@@ -487,10 +470,10 @@ interface StorageOperationsUpdateChangeRequestParams {
|
|
487
470
|
id: string;
|
488
471
|
data: UpdateApwChangeRequestParams;
|
489
472
|
}
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
473
|
+
type StorageOperationsDeleteChangeRequestParams = StorageOperationsDeleteParams;
|
474
|
+
type StorageOperationsGetCommentParams = StorageOperationsGetParams;
|
475
|
+
type StorageOperationsDeleteCommentParams = StorageOperationsDeleteParams;
|
476
|
+
type StorageOperationsListCommentsParams = ApwCommentListParams;
|
494
477
|
interface StorageOperationsCreateCommentParams {
|
495
478
|
data: CreateApwCommentParams;
|
496
479
|
}
|