@webiny/api-apw 5.34.8 → 5.35.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.js +0 -10
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.js +0 -10
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.js +0 -10
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.js +0 -10
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.js +0 -5
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/crud/createChangeRequestMethods.js +4 -11
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +4 -12
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +20 -84
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +4 -12
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +4 -17
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +0 -25
- package/crud/index.js.map +1 -1
- package/crud/utils.js +0 -28
- package/crud/utils.js.map +1 -1
- package/index.d.ts +1 -2
- package/index.js +1 -15
- package/index.js.map +1 -1
- package/package.json +34 -34
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +0 -15
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +0 -8
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +0 -13
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +0 -17
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +2 -31
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +0 -4
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +0 -4
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +0 -4
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +1 -8
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js +0 -14
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +0 -18
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.js +2 -47
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +0 -1
- package/plugins/context.js +2 -47
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +3 -10
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +3 -10
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +6 -25
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +3 -10
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/workflow.gql.js +3 -10
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +3 -18
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +2 -11
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +1 -9
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +1 -8
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +0 -14
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +2 -18
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.js +0 -5
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.js +0 -12
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.js +0 -4
- package/plugins/hooks/notifications/appUrl.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +3 -36
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +0 -4
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +3 -38
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +0 -4
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +4 -32
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +0 -4
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.js +0 -5
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +15 -21
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +0 -11
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +0 -11
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +0 -11
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +0 -8
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +0 -9
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +0 -16
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +1 -12
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +0 -6
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +0 -15
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +0 -4
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +1 -6
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +0 -11
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +0 -16
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +1 -31
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +0 -4
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +0 -4
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +0 -4
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +1 -7
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +0 -11
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +0 -12
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.js +1 -35
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.js +0 -43
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +1 -20
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +9 -40
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +0 -7
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +1 -23
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -28
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +0 -11
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +5 -25
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +2 -23
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +1 -2
- package/scheduler/handlers/utils.js +3 -41
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +0 -3
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +2 -20
- package/scheduler/types.js +0 -11
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +20 -39
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +23 -44
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js +20 -37
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.js +0 -14
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.js +0 -9
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.js +0 -8
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +3 -10
- package/storageOperations/models/contentModelPluginFactory.js +3 -11
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -1
- package/storageOperations/models/contentReview.model.js +0 -26
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +2 -28
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.js +0 -8
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +0 -4
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.js +0 -23
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +23 -45
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js +20 -39
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +6 -5
- package/types.js +0 -14
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +0 -6
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +0 -17
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +2 -12
- package/utils/fieldResolver.js.map +1 -1
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +0 -3
- package/utils/resolve.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createReviewerMethods","storageOperations","onReviewerBeforeCreate","createTopic","onReviewerAfterCreate","onReviewerBeforeUpdate","onReviewerAfterUpdate","onReviewerBeforeDelete","onReviewerAfterDelete","get","id","getReviewer","list","params","listReviewers","create","data","publish","input","reviewer","createReviewer","update","original","updateReviewer","delete","deleteReviewer"],"sources":["createReviewerMethods.ts"],"sourcesContent":["import {\n ApwReviewerCrud,\n CreateApwParams,\n OnReviewerAfterCreateTopicParams,\n OnReviewerAfterDeleteTopicParams,\n OnReviewerAfterUpdateTopicParams,\n OnReviewerBeforeCreateTopicParams,\n OnReviewerBeforeDeleteTopicParams,\n OnReviewerBeforeUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\n\nexport function createReviewerMethods({ storageOperations }: CreateApwParams): ApwReviewerCrud {\n // create\n const onReviewerBeforeCreate = createTopic<OnReviewerBeforeCreateTopicParams>(\n \"apw.onReviewerBeforeCreate\"\n );\n const onReviewerAfterCreate = createTopic<OnReviewerAfterCreateTopicParams>(\n \"apw.onReviewerAfterCreate\"\n );\n // update\n const onReviewerBeforeUpdate = createTopic<OnReviewerBeforeUpdateTopicParams>(\n \"apw.onReviewerBeforeUpdate\"\n );\n const onReviewerAfterUpdate = createTopic<OnReviewerAfterUpdateTopicParams>(\n \"apw.onReviewerAfterUpdate\"\n );\n // delete\n const onReviewerBeforeDelete = createTopic<OnReviewerBeforeDeleteTopicParams>(\n \"apw.onReviewerBeforeDelete\"\n );\n const onReviewerAfterDelete = createTopic<OnReviewerAfterDeleteTopicParams>(\n \"apw.onReviewerAfterDelete\"\n );\n return {\n /**\n * Lifecycle events\n */\n onReviewerBeforeCreate,\n onReviewerAfterCreate,\n onReviewerBeforeUpdate,\n onReviewerAfterUpdate,\n onReviewerBeforeDelete,\n onReviewerAfterDelete,\n async get(id) {\n return storageOperations.getReviewer({ id });\n },\n async list(params) {\n return storageOperations.listReviewers(params);\n },\n async create(data) {\n await onReviewerBeforeCreate.publish({ input: data });\n\n const reviewer = await storageOperations.createReviewer({ data });\n\n await onReviewerAfterCreate.publish({ reviewer });\n\n return reviewer;\n },\n async update(id, data) {\n const original = await storageOperations.getReviewer({ id });\n\n await onReviewerBeforeUpdate.publish({ original, input: { id, data } });\n\n const reviewer = await storageOperations.updateReviewer({ id, data });\n\n await onReviewerAfterUpdate.publish({ original, input: { id, data }, reviewer });\n\n return reviewer;\n },\n async delete(id: string) {\n const reviewer = await storageOperations.getReviewer({ id });\n\n await onReviewerBeforeDelete.publish({ reviewer });\n\n await storageOperations.deleteReviewer({ id });\n\n await onReviewerAfterDelete.publish({ reviewer });\n\n return true;\n }\n };\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["createReviewerMethods","storageOperations","onReviewerBeforeCreate","createTopic","onReviewerAfterCreate","onReviewerBeforeUpdate","onReviewerAfterUpdate","onReviewerBeforeDelete","onReviewerAfterDelete","get","id","getReviewer","list","params","listReviewers","create","data","publish","input","reviewer","createReviewer","update","original","updateReviewer","delete","deleteReviewer"],"sources":["createReviewerMethods.ts"],"sourcesContent":["import {\n ApwReviewerCrud,\n CreateApwParams,\n OnReviewerAfterCreateTopicParams,\n OnReviewerAfterDeleteTopicParams,\n OnReviewerAfterUpdateTopicParams,\n OnReviewerBeforeCreateTopicParams,\n OnReviewerBeforeDeleteTopicParams,\n OnReviewerBeforeUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\n\nexport function createReviewerMethods({ storageOperations }: CreateApwParams): ApwReviewerCrud {\n // create\n const onReviewerBeforeCreate = createTopic<OnReviewerBeforeCreateTopicParams>(\n \"apw.onReviewerBeforeCreate\"\n );\n const onReviewerAfterCreate = createTopic<OnReviewerAfterCreateTopicParams>(\n \"apw.onReviewerAfterCreate\"\n );\n // update\n const onReviewerBeforeUpdate = createTopic<OnReviewerBeforeUpdateTopicParams>(\n \"apw.onReviewerBeforeUpdate\"\n );\n const onReviewerAfterUpdate = createTopic<OnReviewerAfterUpdateTopicParams>(\n \"apw.onReviewerAfterUpdate\"\n );\n // delete\n const onReviewerBeforeDelete = createTopic<OnReviewerBeforeDeleteTopicParams>(\n \"apw.onReviewerBeforeDelete\"\n );\n const onReviewerAfterDelete = createTopic<OnReviewerAfterDeleteTopicParams>(\n \"apw.onReviewerAfterDelete\"\n );\n return {\n /**\n * Lifecycle events\n */\n onReviewerBeforeCreate,\n onReviewerAfterCreate,\n onReviewerBeforeUpdate,\n onReviewerAfterUpdate,\n onReviewerBeforeDelete,\n onReviewerAfterDelete,\n async get(id) {\n return storageOperations.getReviewer({ id });\n },\n async list(params) {\n return storageOperations.listReviewers(params);\n },\n async create(data) {\n await onReviewerBeforeCreate.publish({ input: data });\n\n const reviewer = await storageOperations.createReviewer({ data });\n\n await onReviewerAfterCreate.publish({ reviewer });\n\n return reviewer;\n },\n async update(id, data) {\n const original = await storageOperations.getReviewer({ id });\n\n await onReviewerBeforeUpdate.publish({ original, input: { id, data } });\n\n const reviewer = await storageOperations.updateReviewer({ id, data });\n\n await onReviewerAfterUpdate.publish({ original, input: { id, data }, reviewer });\n\n return reviewer;\n },\n async delete(id: string) {\n const reviewer = await storageOperations.getReviewer({ id });\n\n await onReviewerBeforeDelete.publish({ reviewer });\n\n await storageOperations.deleteReviewer({ id });\n\n await onReviewerAfterDelete.publish({ reviewer });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAUA;AAEO,SAASA,qBAAqB,CAAC;EAAEC;AAAmC,CAAC,EAAmB;EAC3F;EACA,MAAMC,sBAAsB,GAAG,IAAAC,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMC,qBAAqB,GAAG,IAAAD,mBAAW,EACrC,2BAA2B,CAC9B;EACD;EACA,MAAME,sBAAsB,GAAG,IAAAF,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMG,qBAAqB,GAAG,IAAAH,mBAAW,EACrC,2BAA2B,CAC9B;EACD;EACA,MAAMI,sBAAsB,GAAG,IAAAJ,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMK,qBAAqB,GAAG,IAAAL,mBAAW,EACrC,2BAA2B,CAC9B;EACD,OAAO;IACH;AACR;AACA;IACQD,sBAAsB;IACtBE,qBAAqB;IACrBC,sBAAsB;IACtBC,qBAAqB;IACrBC,sBAAsB;IACtBC,qBAAqB;IACrB,MAAMC,GAAG,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;IAChD,CAAC;IACD,MAAME,IAAI,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,aAAa,CAACD,MAAM,CAAC;IAClD,CAAC;IACD,MAAME,MAAM,CAACC,IAAI,EAAE;MACf,MAAMd,sBAAsB,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAErD,MAAMG,QAAQ,GAAG,MAAMlB,iBAAiB,CAACmB,cAAc,CAAC;QAAEJ;MAAK,CAAC,CAAC;MAEjE,MAAMZ,qBAAqB,CAACa,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAEjD,OAAOA,QAAQ;IACnB,CAAC;IACD,MAAME,MAAM,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;MAE5D,MAAML,sBAAsB,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAEvE,MAAMG,QAAQ,GAAG,MAAMlB,iBAAiB,CAACsB,cAAc,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAErE,MAAMV,qBAAqB,CAACW,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK,CAAC;QAAEG;MAAS,CAAC,CAAC;MAEhF,OAAOA,QAAQ;IACnB,CAAC;IACD,MAAMK,MAAM,CAACd,EAAU,EAAE;MACrB,MAAMS,QAAQ,GAAG,MAAMlB,iBAAiB,CAACU,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;MAE5D,MAAMH,sBAAsB,CAACU,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAElD,MAAMlB,iBAAiB,CAACwB,cAAc,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE9C,MAAMF,qBAAqB,CAACS,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAEjD,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
|
@@ -4,37 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.createWorkflowMethods = createWorkflowMethods;
|
7
|
-
|
8
7
|
var _pubsub = require("@webiny/pubsub");
|
9
|
-
|
10
8
|
var _apiSecurity = require("@webiny/api-security");
|
11
|
-
|
12
9
|
function createWorkflowMethods({
|
13
10
|
storageOperations,
|
14
11
|
getPermission
|
15
12
|
}) {
|
16
13
|
// create
|
17
14
|
const onWorkflowBeforeCreate = (0, _pubsub.createTopic)("apw.onWorkflowBeforeCreate");
|
18
|
-
const onWorkflowAfterCreate = (0, _pubsub.createTopic)("apw.onWorkflowAfterCreate");
|
19
|
-
|
15
|
+
const onWorkflowAfterCreate = (0, _pubsub.createTopic)("apw.onWorkflowAfterCreate");
|
16
|
+
// update
|
20
17
|
const onWorkflowBeforeUpdate = (0, _pubsub.createTopic)("apw.onWorkflowBeforeUpdate");
|
21
|
-
const onWorkflowAfterUpdate = (0, _pubsub.createTopic)("apw.onWorkflowAfterUpdate");
|
22
|
-
|
18
|
+
const onWorkflowAfterUpdate = (0, _pubsub.createTopic)("apw.onWorkflowAfterUpdate");
|
19
|
+
// delete
|
23
20
|
const onWorkflowBeforeDelete = (0, _pubsub.createTopic)("apw.onWorkflowBeforeDelete");
|
24
21
|
const onWorkflowAfterDelete = (0, _pubsub.createTopic)("apw.onWorkflowAfterDelete");
|
25
|
-
|
26
22
|
const validateAccess = async () => {
|
27
23
|
const permission = await getPermission("apw.publishingWorkflows");
|
28
|
-
|
29
24
|
if (!!permission) {
|
30
25
|
return;
|
31
26
|
}
|
32
|
-
|
33
27
|
throw new _apiSecurity.NotAuthorizedError({
|
34
28
|
message: "Not authorized to access publishing workflows."
|
35
29
|
});
|
36
30
|
};
|
37
|
-
|
38
31
|
return {
|
39
32
|
/**
|
40
33
|
* Lifecycle events
|
@@ -45,17 +38,14 @@ function createWorkflowMethods({
|
|
45
38
|
onWorkflowAfterUpdate,
|
46
39
|
onWorkflowBeforeDelete,
|
47
40
|
onWorkflowAfterDelete,
|
48
|
-
|
49
41
|
async get(id) {
|
50
42
|
return storageOperations.getWorkflow({
|
51
43
|
id
|
52
44
|
});
|
53
45
|
},
|
54
|
-
|
55
46
|
async list(params) {
|
56
47
|
return storageOperations.listWorkflows(params || {});
|
57
48
|
},
|
58
|
-
|
59
49
|
async create(data) {
|
60
50
|
await validateAccess();
|
61
51
|
await onWorkflowBeforeCreate.publish({
|
@@ -69,7 +59,6 @@ function createWorkflowMethods({
|
|
69
59
|
});
|
70
60
|
return workflow;
|
71
61
|
},
|
72
|
-
|
73
62
|
async update(id, data) {
|
74
63
|
await validateAccess();
|
75
64
|
const original = await storageOperations.getWorkflow({
|
@@ -96,7 +85,6 @@ function createWorkflowMethods({
|
|
96
85
|
});
|
97
86
|
return workflow;
|
98
87
|
},
|
99
|
-
|
100
88
|
async delete(id) {
|
101
89
|
await validateAccess();
|
102
90
|
const workflow = await storageOperations.getWorkflow({
|
@@ -113,6 +101,5 @@ function createWorkflowMethods({
|
|
113
101
|
});
|
114
102
|
return true;
|
115
103
|
}
|
116
|
-
|
117
104
|
};
|
118
105
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createWorkflowMethods","storageOperations","getPermission","onWorkflowBeforeCreate","createTopic","onWorkflowAfterCreate","onWorkflowBeforeUpdate","onWorkflowAfterUpdate","onWorkflowBeforeDelete","onWorkflowAfterDelete","validateAccess","permission","NotAuthorizedError","message","get","id","getWorkflow","list","params","listWorkflows","create","data","publish","input","workflow","createWorkflow","update","original","updateWorkflow","delete","deleteWorkflow"],"sources":["createWorkflowMethods.ts"],"sourcesContent":["import {\n ApwWorkflowCrud,\n CreateApwParams,\n OnWorkflowAfterCreateTopicParams,\n OnWorkflowAfterDeleteTopicParams,\n OnWorkflowAfterUpdateTopicParams,\n OnWorkflowBeforeCreateTopicParams,\n OnWorkflowBeforeDeleteTopicParams,\n OnWorkflowBeforeUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\n\nexport function createWorkflowMethods({\n storageOperations,\n getPermission\n}: CreateApwParams): ApwWorkflowCrud {\n // create\n const onWorkflowBeforeCreate = createTopic<OnWorkflowBeforeCreateTopicParams>(\n \"apw.onWorkflowBeforeCreate\"\n );\n const onWorkflowAfterCreate = createTopic<OnWorkflowAfterCreateTopicParams>(\n \"apw.onWorkflowAfterCreate\"\n );\n // update\n const onWorkflowBeforeUpdate = createTopic<OnWorkflowBeforeUpdateTopicParams>(\n \"apw.onWorkflowBeforeUpdate\"\n );\n const onWorkflowAfterUpdate = createTopic<OnWorkflowAfterUpdateTopicParams>(\n \"apw.onWorkflowAfterUpdate\"\n );\n // delete\n const onWorkflowBeforeDelete = createTopic<OnWorkflowBeforeDeleteTopicParams>(\n \"apw.onWorkflowBeforeDelete\"\n );\n const onWorkflowAfterDelete = createTopic<OnWorkflowAfterDeleteTopicParams>(\n \"apw.onWorkflowAfterDelete\"\n );\n\n const validateAccess = async (): Promise<void> => {\n const permission = await getPermission(\"apw.publishingWorkflows\");\n if (!!permission) {\n return;\n }\n throw new NotAuthorizedError({\n message: \"Not authorized to access publishing workflows.\"\n });\n };\n\n return {\n /**\n * Lifecycle events\n */\n onWorkflowBeforeCreate,\n onWorkflowAfterCreate,\n onWorkflowBeforeUpdate,\n onWorkflowAfterUpdate,\n onWorkflowBeforeDelete,\n onWorkflowAfterDelete,\n async get(id) {\n return storageOperations.getWorkflow({ id });\n },\n async list(params) {\n return storageOperations.listWorkflows(params || {});\n },\n async create(data) {\n await validateAccess();\n await onWorkflowBeforeCreate.publish({ input: data });\n\n const workflow = await storageOperations.createWorkflow({ data });\n\n await onWorkflowAfterCreate.publish({ workflow });\n\n return workflow;\n },\n async update(id, data) {\n await validateAccess();\n const original = await storageOperations.getWorkflow({ id });\n\n await onWorkflowBeforeUpdate.publish({ original, input: { id, data } });\n\n const workflow = await storageOperations.updateWorkflow({ id, data });\n\n await onWorkflowAfterUpdate.publish({ original, input: { id, data }, workflow });\n\n return workflow;\n },\n async delete(id: string) {\n await validateAccess();\n const workflow = await storageOperations.getWorkflow({ id });\n\n await onWorkflowBeforeDelete.publish({ workflow });\n\n await storageOperations.deleteWorkflow({ id });\n\n await onWorkflowAfterDelete.publish({ workflow });\n\n return true;\n }\n };\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["createWorkflowMethods","storageOperations","getPermission","onWorkflowBeforeCreate","createTopic","onWorkflowAfterCreate","onWorkflowBeforeUpdate","onWorkflowAfterUpdate","onWorkflowBeforeDelete","onWorkflowAfterDelete","validateAccess","permission","NotAuthorizedError","message","get","id","getWorkflow","list","params","listWorkflows","create","data","publish","input","workflow","createWorkflow","update","original","updateWorkflow","delete","deleteWorkflow"],"sources":["createWorkflowMethods.ts"],"sourcesContent":["import {\n ApwWorkflowCrud,\n CreateApwParams,\n OnWorkflowAfterCreateTopicParams,\n OnWorkflowAfterDeleteTopicParams,\n OnWorkflowAfterUpdateTopicParams,\n OnWorkflowBeforeCreateTopicParams,\n OnWorkflowBeforeDeleteTopicParams,\n OnWorkflowBeforeUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\n\nexport function createWorkflowMethods({\n storageOperations,\n getPermission\n}: CreateApwParams): ApwWorkflowCrud {\n // create\n const onWorkflowBeforeCreate = createTopic<OnWorkflowBeforeCreateTopicParams>(\n \"apw.onWorkflowBeforeCreate\"\n );\n const onWorkflowAfterCreate = createTopic<OnWorkflowAfterCreateTopicParams>(\n \"apw.onWorkflowAfterCreate\"\n );\n // update\n const onWorkflowBeforeUpdate = createTopic<OnWorkflowBeforeUpdateTopicParams>(\n \"apw.onWorkflowBeforeUpdate\"\n );\n const onWorkflowAfterUpdate = createTopic<OnWorkflowAfterUpdateTopicParams>(\n \"apw.onWorkflowAfterUpdate\"\n );\n // delete\n const onWorkflowBeforeDelete = createTopic<OnWorkflowBeforeDeleteTopicParams>(\n \"apw.onWorkflowBeforeDelete\"\n );\n const onWorkflowAfterDelete = createTopic<OnWorkflowAfterDeleteTopicParams>(\n \"apw.onWorkflowAfterDelete\"\n );\n\n const validateAccess = async (): Promise<void> => {\n const permission = await getPermission(\"apw.publishingWorkflows\");\n if (!!permission) {\n return;\n }\n throw new NotAuthorizedError({\n message: \"Not authorized to access publishing workflows.\"\n });\n };\n\n return {\n /**\n * Lifecycle events\n */\n onWorkflowBeforeCreate,\n onWorkflowAfterCreate,\n onWorkflowBeforeUpdate,\n onWorkflowAfterUpdate,\n onWorkflowBeforeDelete,\n onWorkflowAfterDelete,\n async get(id) {\n return storageOperations.getWorkflow({ id });\n },\n async list(params) {\n return storageOperations.listWorkflows(params || {});\n },\n async create(data) {\n await validateAccess();\n await onWorkflowBeforeCreate.publish({ input: data });\n\n const workflow = await storageOperations.createWorkflow({ data });\n\n await onWorkflowAfterCreate.publish({ workflow });\n\n return workflow;\n },\n async update(id, data) {\n await validateAccess();\n const original = await storageOperations.getWorkflow({ id });\n\n await onWorkflowBeforeUpdate.publish({ original, input: { id, data } });\n\n const workflow = await storageOperations.updateWorkflow({ id, data });\n\n await onWorkflowAfterUpdate.publish({ original, input: { id, data }, workflow });\n\n return workflow;\n },\n async delete(id: string) {\n await validateAccess();\n const workflow = await storageOperations.getWorkflow({ id });\n\n await onWorkflowBeforeDelete.publish({ workflow });\n\n await storageOperations.deleteWorkflow({ id });\n\n await onWorkflowAfterDelete.publish({ workflow });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAUA;AACA;AAEO,SAASA,qBAAqB,CAAC;EAClCC,iBAAiB;EACjBC;AACa,CAAC,EAAmB;EACjC;EACA,MAAMC,sBAAsB,GAAG,IAAAC,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMC,qBAAqB,GAAG,IAAAD,mBAAW,EACrC,2BAA2B,CAC9B;EACD;EACA,MAAME,sBAAsB,GAAG,IAAAF,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMG,qBAAqB,GAAG,IAAAH,mBAAW,EACrC,2BAA2B,CAC9B;EACD;EACA,MAAMI,sBAAsB,GAAG,IAAAJ,mBAAW,EACtC,4BAA4B,CAC/B;EACD,MAAMK,qBAAqB,GAAG,IAAAL,mBAAW,EACrC,2BAA2B,CAC9B;EAED,MAAMM,cAAc,GAAG,YAA2B;IAC9C,MAAMC,UAAU,GAAG,MAAMT,aAAa,CAAC,yBAAyB,CAAC;IACjE,IAAI,CAAC,CAACS,UAAU,EAAE;MACd;IACJ;IACA,MAAM,IAAIC,+BAAkB,CAAC;MACzBC,OAAO,EAAE;IACb,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACH;AACR;AACA;IACQV,sBAAsB;IACtBE,qBAAqB;IACrBC,sBAAsB;IACtBC,qBAAqB;IACrBC,sBAAsB;IACtBC,qBAAqB;IACrB,MAAMK,GAAG,CAACC,EAAE,EAAE;MACV,OAAOd,iBAAiB,CAACe,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;IAChD,CAAC;IACD,MAAME,IAAI,CAACC,MAAM,EAAE;MACf,OAAOjB,iBAAiB,CAACkB,aAAa,CAACD,MAAM,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,MAAME,MAAM,CAACC,IAAI,EAAE;MACf,MAAMX,cAAc,EAAE;MACtB,MAAMP,sBAAsB,CAACmB,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAErD,MAAMG,QAAQ,GAAG,MAAMvB,iBAAiB,CAACwB,cAAc,CAAC;QAAEJ;MAAK,CAAC,CAAC;MAEjE,MAAMhB,qBAAqB,CAACiB,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAEjD,OAAOA,QAAQ;IACnB,CAAC;IACD,MAAME,MAAM,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMX,cAAc,EAAE;MACtB,MAAMiB,QAAQ,GAAG,MAAM1B,iBAAiB,CAACe,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;MAE5D,MAAMT,sBAAsB,CAACgB,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAEvE,MAAMG,QAAQ,GAAG,MAAMvB,iBAAiB,CAAC2B,cAAc,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAErE,MAAMd,qBAAqB,CAACe,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK,CAAC;QAAEG;MAAS,CAAC,CAAC;MAEhF,OAAOA,QAAQ;IACnB,CAAC;IACD,MAAMK,MAAM,CAACd,EAAU,EAAE;MACrB,MAAML,cAAc,EAAE;MACtB,MAAMc,QAAQ,GAAG,MAAMvB,iBAAiB,CAACe,WAAW,CAAC;QAAED;MAAG,CAAC,CAAC;MAE5D,MAAMP,sBAAsB,CAACc,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAElD,MAAMvB,iBAAiB,CAAC6B,cAAc,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE9C,MAAMN,qBAAqB,CAACa,OAAO,CAAC;QAAEE;MAAS,CAAC,CAAC;MAEjD,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
|
package/crud/index.js
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.createApw = void 0;
|
9
|
-
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
|
-
|
12
9
|
var _createWorkflowMethods = require("./createWorkflowMethods");
|
13
|
-
|
14
10
|
var _createReviewerMethods = require("./createReviewerMethods");
|
15
|
-
|
16
11
|
var _createCommentMethods = require("./createCommentMethods");
|
17
|
-
|
18
12
|
var _createChangeRequestMethods = require("./createChangeRequestMethods");
|
19
|
-
|
20
13
|
var _createContentReviewMethods = require("./createContentReviewMethods");
|
21
|
-
|
22
14
|
const createApw = params => {
|
23
15
|
const contentGetters = new Map();
|
24
16
|
const contentPublisher = new Map();
|
@@ -26,54 +18,39 @@ const createApw = params => {
|
|
26
18
|
const workflowMethods = (0, _createWorkflowMethods.createWorkflowMethods)(params);
|
27
19
|
const reviewerMethods = (0, _createReviewerMethods.createReviewerMethods)(params);
|
28
20
|
const changeRequestMethods = (0, _createChangeRequestMethods.createChangeRequestMethods)(params);
|
29
|
-
|
30
21
|
function getContentGetter(type) {
|
31
22
|
const getter = contentGetters.get(type);
|
32
|
-
|
33
23
|
if (!getter) {
|
34
24
|
throw new Error(`No "ContentGetter" loader found for type: "${type}". You must define a loader.`);
|
35
25
|
}
|
36
|
-
|
37
26
|
return getter;
|
38
27
|
}
|
39
|
-
|
40
28
|
function getContentUnPublisher(type) {
|
41
29
|
const getter = contentUnPublisher.get(type);
|
42
|
-
|
43
30
|
if (!getter) {
|
44
31
|
throw new Error(`No "Content UnPublisher" loader found for type: "${type}". You must define a loader.`);
|
45
32
|
}
|
46
|
-
|
47
33
|
return getter;
|
48
34
|
}
|
49
|
-
|
50
35
|
function getContentPublisher(type) {
|
51
36
|
const getter = contentPublisher.get(type);
|
52
|
-
|
53
37
|
if (!getter) {
|
54
38
|
throw new Error(`No "ContentPublisher" loader found for type: "${type}". You must define a loader.`);
|
55
39
|
}
|
56
|
-
|
57
40
|
return getter;
|
58
41
|
}
|
59
|
-
|
60
42
|
return {
|
61
43
|
addContentPublisher(type, func) {
|
62
44
|
contentPublisher.set(type, func);
|
63
45
|
},
|
64
|
-
|
65
46
|
getContentPublisher,
|
66
|
-
|
67
47
|
addContentGetter(type, func) {
|
68
48
|
contentGetters.set(type, func);
|
69
49
|
},
|
70
|
-
|
71
50
|
getContentGetter,
|
72
|
-
|
73
51
|
addContentUnPublisher(type, func) {
|
74
52
|
contentUnPublisher.set(type, func);
|
75
53
|
},
|
76
|
-
|
77
54
|
getContentUnPublisher,
|
78
55
|
workflow: workflowMethods,
|
79
56
|
reviewer: reviewerMethods,
|
@@ -85,12 +62,10 @@ const createApw = params => {
|
|
85
62
|
getContentPublisher,
|
86
63
|
getContentUnPublisher
|
87
64
|
})),
|
88
|
-
|
89
65
|
/**
|
90
66
|
* Add scheduler to context so that we can access it later. For example, during testing.
|
91
67
|
*/
|
92
68
|
scheduleAction: params.scheduler
|
93
69
|
};
|
94
70
|
};
|
95
|
-
|
96
71
|
exports.createApw = createApw;
|
package/crud/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createApw","params","contentGetters","Map","contentPublisher","contentUnPublisher","workflowMethods","createWorkflowMethods","reviewerMethods","createReviewerMethods","changeRequestMethods","createChangeRequestMethods","getContentGetter","type","getter","get","Error","getContentUnPublisher","getContentPublisher","addContentPublisher","func","set","addContentGetter","addContentUnPublisher","workflow","reviewer","changeRequest","comment","createCommentMethods","contentReview","createContentReviewMethods","getReviewer","bind","scheduleAction","scheduler"],"sources":["index.ts"],"sourcesContent":["import { createWorkflowMethods } from \"./createWorkflowMethods\";\nimport { createReviewerMethods } from \"./createReviewerMethods\";\nimport { createCommentMethods } from \"./createCommentMethods\";\nimport { createChangeRequestMethods } from \"./createChangeRequestMethods\";\nimport { createContentReviewMethods } from \"./createContentReviewMethods\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentTypes,\n ContentGetter,\n ContentPublisher,\n ContentUnPublisher,\n CreateApwParams\n} from \"~/types\";\n\nexport const createApw = (params: CreateApwParams): AdvancedPublishingWorkflow => {\n const contentGetters = new Map<ApwContentTypes, ContentGetter>();\n const contentPublisher = new Map<ApwContentTypes, ContentPublisher>();\n const contentUnPublisher = new Map<ApwContentTypes, ContentUnPublisher>();\n\n const workflowMethods = createWorkflowMethods(params);\n const reviewerMethods = createReviewerMethods(params);\n const changeRequestMethods = createChangeRequestMethods(params);\n\n function getContentGetter(type: ApwContentTypes) {\n const getter = contentGetters.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentGetter\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentUnPublisher(type: ApwContentTypes) {\n const getter = contentUnPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"Content UnPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentPublisher(type: ApwContentTypes) {\n const getter = contentPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n return {\n addContentPublisher(type, func) {\n contentPublisher.set(type, func);\n },\n getContentPublisher,\n addContentGetter(type, func) {\n contentGetters.set(type, func);\n },\n getContentGetter,\n addContentUnPublisher(type, func) {\n contentUnPublisher.set(type, func);\n },\n getContentUnPublisher,\n workflow: workflowMethods,\n reviewer: reviewerMethods,\n changeRequest: changeRequestMethods,\n comment: createCommentMethods(params),\n contentReview: createContentReviewMethods({\n ...params,\n getReviewer: reviewerMethods.get.bind(reviewerMethods),\n getContentGetter,\n getContentPublisher,\n getContentUnPublisher\n }),\n /**\n * Add scheduler to context so that we can access it later. For example, during testing.\n */\n scheduleAction: params.scheduler\n };\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["createApw","params","contentGetters","Map","contentPublisher","contentUnPublisher","workflowMethods","createWorkflowMethods","reviewerMethods","createReviewerMethods","changeRequestMethods","createChangeRequestMethods","getContentGetter","type","getter","get","Error","getContentUnPublisher","getContentPublisher","addContentPublisher","func","set","addContentGetter","addContentUnPublisher","workflow","reviewer","changeRequest","comment","createCommentMethods","contentReview","createContentReviewMethods","getReviewer","bind","scheduleAction","scheduler"],"sources":["index.ts"],"sourcesContent":["import { createWorkflowMethods } from \"./createWorkflowMethods\";\nimport { createReviewerMethods } from \"./createReviewerMethods\";\nimport { createCommentMethods } from \"./createCommentMethods\";\nimport { createChangeRequestMethods } from \"./createChangeRequestMethods\";\nimport { createContentReviewMethods } from \"./createContentReviewMethods\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentTypes,\n ContentGetter,\n ContentPublisher,\n ContentUnPublisher,\n CreateApwParams\n} from \"~/types\";\n\nexport const createApw = (params: CreateApwParams): AdvancedPublishingWorkflow => {\n const contentGetters = new Map<ApwContentTypes, ContentGetter>();\n const contentPublisher = new Map<ApwContentTypes, ContentPublisher>();\n const contentUnPublisher = new Map<ApwContentTypes, ContentUnPublisher>();\n\n const workflowMethods = createWorkflowMethods(params);\n const reviewerMethods = createReviewerMethods(params);\n const changeRequestMethods = createChangeRequestMethods(params);\n\n function getContentGetter(type: ApwContentTypes) {\n const getter = contentGetters.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentGetter\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentUnPublisher(type: ApwContentTypes) {\n const getter = contentUnPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"Content UnPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentPublisher(type: ApwContentTypes) {\n const getter = contentPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n return {\n addContentPublisher(type, func) {\n contentPublisher.set(type, func);\n },\n getContentPublisher,\n addContentGetter(type, func) {\n contentGetters.set(type, func);\n },\n getContentGetter,\n addContentUnPublisher(type, func) {\n contentUnPublisher.set(type, func);\n },\n getContentUnPublisher,\n workflow: workflowMethods,\n reviewer: reviewerMethods,\n changeRequest: changeRequestMethods,\n comment: createCommentMethods(params),\n contentReview: createContentReviewMethods({\n ...params,\n getReviewer: reviewerMethods.get.bind(reviewerMethods),\n getContentGetter,\n getContentPublisher,\n getContentUnPublisher\n }),\n /**\n * Add scheduler to context so that we can access it later. For example, during testing.\n */\n scheduleAction: params.scheduler\n };\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAUO,MAAMA,SAAS,GAAIC,MAAuB,IAAiC;EAC9E,MAAMC,cAAc,GAAG,IAAIC,GAAG,EAAkC;EAChE,MAAMC,gBAAgB,GAAG,IAAID,GAAG,EAAqC;EACrE,MAAME,kBAAkB,GAAG,IAAIF,GAAG,EAAuC;EAEzE,MAAMG,eAAe,GAAG,IAAAC,4CAAqB,EAACN,MAAM,CAAC;EACrD,MAAMO,eAAe,GAAG,IAAAC,4CAAqB,EAACR,MAAM,CAAC;EACrD,MAAMS,oBAAoB,GAAG,IAAAC,sDAA0B,EAACV,MAAM,CAAC;EAE/D,SAASW,gBAAgB,CAACC,IAAqB,EAAE;IAC7C,MAAMC,MAAM,GAAGZ,cAAc,CAACa,GAAG,CAACF,IAAI,CAAC;IACvC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,KAAK,CACV,8CAA6CH,IAAK,8BAA6B,CACnF;IACL;IACA,OAAOC,MAAM;EACjB;EAEA,SAASG,qBAAqB,CAACJ,IAAqB,EAAE;IAClD,MAAMC,MAAM,GAAGT,kBAAkB,CAACU,GAAG,CAACF,IAAI,CAAC;IAC3C,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,KAAK,CACV,oDAAmDH,IAAK,8BAA6B,CACzF;IACL;IACA,OAAOC,MAAM;EACjB;EAEA,SAASI,mBAAmB,CAACL,IAAqB,EAAE;IAChD,MAAMC,MAAM,GAAGV,gBAAgB,CAACW,GAAG,CAACF,IAAI,CAAC;IACzC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,KAAK,CACV,iDAAgDH,IAAK,8BAA6B,CACtF;IACL;IACA,OAAOC,MAAM;EACjB;EAEA,OAAO;IACHK,mBAAmB,CAACN,IAAI,EAAEO,IAAI,EAAE;MAC5BhB,gBAAgB,CAACiB,GAAG,CAACR,IAAI,EAAEO,IAAI,CAAC;IACpC,CAAC;IACDF,mBAAmB;IACnBI,gBAAgB,CAACT,IAAI,EAAEO,IAAI,EAAE;MACzBlB,cAAc,CAACmB,GAAG,CAACR,IAAI,EAAEO,IAAI,CAAC;IAClC,CAAC;IACDR,gBAAgB;IAChBW,qBAAqB,CAACV,IAAI,EAAEO,IAAI,EAAE;MAC9Bf,kBAAkB,CAACgB,GAAG,CAACR,IAAI,EAAEO,IAAI,CAAC;IACtC,CAAC;IACDH,qBAAqB;IACrBO,QAAQ,EAAElB,eAAe;IACzBmB,QAAQ,EAAEjB,eAAe;IACzBkB,aAAa,EAAEhB,oBAAoB;IACnCiB,OAAO,EAAE,IAAAC,0CAAoB,EAAC3B,MAAM,CAAC;IACrC4B,aAAa,EAAE,IAAAC,sDAA0B,8DAClC7B,MAAM;MACT8B,WAAW,EAAEvB,eAAe,CAACO,GAAG,CAACiB,IAAI,CAACxB,eAAe,CAAC;MACtDI,gBAAgB;MAChBM,mBAAmB;MACnBD;IAAqB,GACvB;IACF;AACR;AACA;IACQgB,cAAc,EAAEhC,MAAM,CAACiC;EAC3B,CAAC;AACL,CAAC;AAAC"}
|
package/crud/utils.js
CHANGED
@@ -1,35 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = void 0;
|
9
8
|
exports.checkValidDateTime = checkValidDateTime;
|
10
9
|
exports.getPendingRequiredSteps = exports.filterContentReviewsByRequiresMyAttention = void 0;
|
11
|
-
|
12
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
13
|
-
|
14
11
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
15
|
-
|
16
12
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
17
|
-
|
18
13
|
var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
|
19
|
-
|
20
14
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
21
|
-
|
22
15
|
var _set = _interopRequireDefault(require("lodash/set"));
|
23
|
-
|
24
16
|
var _types = require("../types");
|
25
|
-
|
26
17
|
_dayjs.default.extend(_utc.default);
|
27
|
-
|
28
18
|
function checkValidDateTime(datetime) {
|
29
19
|
if (typeof datetime !== "string") {
|
30
20
|
return;
|
31
21
|
}
|
32
|
-
|
33
22
|
if (!(0, _dayjs.default)(datetime).isValid()) {
|
34
23
|
throw new _error.default({
|
35
24
|
message: `Invalid input "datetime" should be an ISO string.`,
|
@@ -39,9 +28,7 @@ function checkValidDateTime(datetime) {
|
|
39
28
|
}
|
40
29
|
});
|
41
30
|
}
|
42
|
-
|
43
31
|
const today = _dayjs.default.utc();
|
44
|
-
|
45
32
|
if ((0, _dayjs.default)(datetime).isBefore(today)) {
|
46
33
|
throw new _error.default({
|
47
34
|
message: `Cannot schedule for a past "datetime".`,
|
@@ -52,19 +39,15 @@ function checkValidDateTime(datetime) {
|
|
52
39
|
});
|
53
40
|
}
|
54
41
|
}
|
55
|
-
|
56
42
|
const getPendingRequiredSteps = (steps, predicate) => {
|
57
43
|
return steps.filter(step => {
|
58
44
|
const isRequiredStep = [_types.ApwWorkflowStepTypes.MANDATORY_BLOCKING, _types.ApwWorkflowStepTypes.MANDATORY_NON_BLOCKING].includes(step.type);
|
59
|
-
|
60
45
|
if (!isRequiredStep) {
|
61
46
|
return false;
|
62
47
|
}
|
63
|
-
|
64
48
|
return predicate(step);
|
65
49
|
});
|
66
50
|
};
|
67
|
-
|
68
51
|
exports.getPendingRequiredSteps = getPendingRequiredSteps;
|
69
52
|
const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {
|
70
53
|
scheduledOn: null,
|
@@ -72,7 +55,6 @@ const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {
|
|
72
55
|
scheduledActionId: null
|
73
56
|
};
|
74
57
|
exports.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META;
|
75
|
-
|
76
58
|
/**
|
77
59
|
* Filter "content reviews" that are "underReview" and current user is a reviewer for the active step.
|
78
60
|
* That is the user is able to provide sign-off or comment.
|
@@ -87,7 +69,6 @@ const filterContentReviewsByRequiresMyAttention = async params => {
|
|
87
69
|
/**
|
88
70
|
* Get all "content reviews" with status "underReview"
|
89
71
|
*/
|
90
|
-
|
91
72
|
const newListParams = (0, _set.default)((0, _cloneDeep.default)(listParams), "where.reviewStatus", _types.ApwContentReviewStatus.UNDER_REVIEW);
|
92
73
|
const [contentReviews, meta] = await listContentReviews(newListParams);
|
93
74
|
const identity = getIdentity();
|
@@ -95,17 +76,13 @@ const filterContentReviewsByRequiresMyAttention = async params => {
|
|
95
76
|
/**
|
96
77
|
* Filter items where current user is a reviewer for the active step.
|
97
78
|
*/
|
98
|
-
|
99
79
|
for (let i = 0; i < contentReviews.length; i++) {
|
100
80
|
const contentReview = contentReviews[i];
|
101
81
|
const activeStep = contentReview.steps.find(step => step.status === _types.ApwContentReviewStepStatus.ACTIVE);
|
102
|
-
|
103
82
|
if (!activeStep) {
|
104
83
|
continue;
|
105
84
|
}
|
106
|
-
|
107
85
|
let requiresMyAttention = false;
|
108
|
-
|
109
86
|
for (let j = 0; j < activeStep.reviewers.length; j++) {
|
110
87
|
const {
|
111
88
|
id
|
@@ -113,26 +90,21 @@ const filterContentReviewsByRequiresMyAttention = async params => {
|
|
113
90
|
/**
|
114
91
|
* Load reviewer
|
115
92
|
*/
|
116
|
-
|
117
93
|
const reviewer = await getReviewer(id);
|
118
94
|
/**
|
119
95
|
* Check if the current logged in user is the reviewer.
|
120
96
|
*/
|
121
|
-
|
122
97
|
if (reviewer.identityId === identity.id) {
|
123
98
|
requiresMyAttention = true;
|
124
99
|
break;
|
125
100
|
}
|
126
101
|
}
|
127
|
-
|
128
102
|
if (requiresMyAttention) {
|
129
103
|
filteredItems.push(contentReview);
|
130
104
|
}
|
131
105
|
}
|
132
|
-
|
133
106
|
return [filteredItems, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, meta), {}, {
|
134
107
|
totalCount: filteredItems.length
|
135
108
|
})];
|
136
109
|
};
|
137
|
-
|
138
110
|
exports.filterContentReviewsByRequiresMyAttention = filterContentReviewsByRequiresMyAttention;
|
package/crud/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["dayjs","extend","utc","checkValidDateTime","datetime","isValid","Error","message","code","data","today","isBefore","getPendingRequiredSteps","steps","predicate","filter","step","isRequiredStep","ApwWorkflowStepTypes","MANDATORY_BLOCKING","MANDATORY_NON_BLOCKING","includes","type","INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META","scheduledOn","scheduledBy","scheduledActionId","filterContentReviewsByRequiresMyAttention","params","listContentReviews","listParams","getIdentity","getReviewer","newListParams","set","cloneDeep","ApwContentReviewStatus","UNDER_REVIEW","contentReviews","meta","identity","filteredItems","i","length","contentReview","activeStep","find","status","ApwContentReviewStepStatus","ACTIVE","requiresMyAttention","j","reviewers","id","reviewer","identityId","push","totalCount"],"sources":["utils.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport set from \"lodash/set\";\nimport {\n ApwContentReview,\n ApwContentReviewListParams,\n ApwContentReviewStatus,\n ApwContentReviewStep,\n ApwContentReviewStepStatus,\n ApwWorkflowStepTypes,\n ListMeta\n} from \"~/types\";\nimport { CreateContentReviewMethodsParams } from \"./createContentReviewMethods\";\n\ndayjs.extend(utc);\n\nexport function checkValidDateTime(datetime: string | undefined): void {\n if (typeof datetime !== \"string\") {\n return;\n }\n\n if (!dayjs(datetime).isValid()) {\n throw new Error({\n message: `Invalid input \"datetime\" should be an ISO string.`,\n code: \"INVALID_DATETIME_FORMAT\",\n data: {\n datetime\n }\n });\n }\n const today = dayjs.utc();\n\n if (dayjs(datetime).isBefore(today)) {\n throw new Error({\n message: `Cannot schedule for a past \"datetime\".`,\n code: \"PAST_DATETIME\",\n data: {\n datetime\n }\n });\n }\n}\n\nexport interface GetPendingRequiredSteps {\n (\n steps: ApwContentReviewStep[],\n predicate: (step: ApwContentReviewStep) => boolean\n ): ApwContentReviewStep[];\n}\n\nexport const getPendingRequiredSteps: GetPendingRequiredSteps = (steps, predicate) => {\n return steps.filter(step => {\n const isRequiredStep = [\n ApwWorkflowStepTypes.MANDATORY_BLOCKING,\n ApwWorkflowStepTypes.MANDATORY_NON_BLOCKING\n ].includes(step.type);\n\n if (!isRequiredStep) {\n return false;\n }\n\n return predicate(step);\n });\n};\n\nexport const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {\n scheduledOn: null,\n scheduledBy: null,\n scheduledActionId: null\n};\n\nexport interface FilterContentReviewsParams\n extends Pick<CreateContentReviewMethodsParams, \"getReviewer\" | \"getIdentity\"> {\n listParams: ApwContentReviewListParams;\n listContentReviews: CreateContentReviewMethodsParams[\"storageOperations\"][\"listContentReviews\"];\n}\n\n/**\n * Filter \"content reviews\" that are \"underReview\" and current user is a reviewer for the active step.\n * That is the user is able to provide sign-off or comment.\n */\nexport const filterContentReviewsByRequiresMyAttention = async (\n params: FilterContentReviewsParams\n): Promise<[ApwContentReview[], ListMeta]> => {\n const { listContentReviews, listParams, getIdentity, getReviewer } = params;\n /**\n * Get all \"content reviews\" with status \"underReview\"\n */\n const newListParams = set(\n cloneDeep(listParams),\n \"where.reviewStatus\",\n ApwContentReviewStatus.UNDER_REVIEW\n );\n const [contentReviews, meta] = await listContentReviews(newListParams);\n\n const identity = getIdentity();\n const filteredItems = [];\n /**\n * Filter items where current user is a reviewer for the active step.\n */\n for (let i = 0; i < contentReviews.length; i++) {\n const contentReview = contentReviews[i];\n\n const activeStep = contentReview.steps.find(\n step => step.status === ApwContentReviewStepStatus.ACTIVE\n );\n\n if (!activeStep) {\n continue;\n }\n\n let requiresMyAttention = false;\n\n for (let j = 0; j < activeStep.reviewers.length; j++) {\n const { id } = activeStep.reviewers[j];\n /**\n * Load reviewer\n */\n const reviewer = await getReviewer(id);\n /**\n * Check if the current logged in user is the reviewer.\n */\n if (reviewer.identityId === identity.id) {\n requiresMyAttention = true;\n break;\n }\n }\n\n if (requiresMyAttention) {\n filteredItems.push(contentReview);\n }\n }\n\n return [\n filteredItems,\n {\n ...meta,\n totalCount: filteredItems.length\n }\n ];\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["dayjs","extend","utc","checkValidDateTime","datetime","isValid","Error","message","code","data","today","isBefore","getPendingRequiredSteps","steps","predicate","filter","step","isRequiredStep","ApwWorkflowStepTypes","MANDATORY_BLOCKING","MANDATORY_NON_BLOCKING","includes","type","INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META","scheduledOn","scheduledBy","scheduledActionId","filterContentReviewsByRequiresMyAttention","params","listContentReviews","listParams","getIdentity","getReviewer","newListParams","set","cloneDeep","ApwContentReviewStatus","UNDER_REVIEW","contentReviews","meta","identity","filteredItems","i","length","contentReview","activeStep","find","status","ApwContentReviewStepStatus","ACTIVE","requiresMyAttention","j","reviewers","id","reviewer","identityId","push","totalCount"],"sources":["utils.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport set from \"lodash/set\";\nimport {\n ApwContentReview,\n ApwContentReviewListParams,\n ApwContentReviewStatus,\n ApwContentReviewStep,\n ApwContentReviewStepStatus,\n ApwWorkflowStepTypes,\n ListMeta\n} from \"~/types\";\nimport { CreateContentReviewMethodsParams } from \"./createContentReviewMethods\";\n\ndayjs.extend(utc);\n\nexport function checkValidDateTime(datetime: string | undefined): void {\n if (typeof datetime !== \"string\") {\n return;\n }\n\n if (!dayjs(datetime).isValid()) {\n throw new Error({\n message: `Invalid input \"datetime\" should be an ISO string.`,\n code: \"INVALID_DATETIME_FORMAT\",\n data: {\n datetime\n }\n });\n }\n const today = dayjs.utc();\n\n if (dayjs(datetime).isBefore(today)) {\n throw new Error({\n message: `Cannot schedule for a past \"datetime\".`,\n code: \"PAST_DATETIME\",\n data: {\n datetime\n }\n });\n }\n}\n\nexport interface GetPendingRequiredSteps {\n (\n steps: ApwContentReviewStep[],\n predicate: (step: ApwContentReviewStep) => boolean\n ): ApwContentReviewStep[];\n}\n\nexport const getPendingRequiredSteps: GetPendingRequiredSteps = (steps, predicate) => {\n return steps.filter(step => {\n const isRequiredStep = [\n ApwWorkflowStepTypes.MANDATORY_BLOCKING,\n ApwWorkflowStepTypes.MANDATORY_NON_BLOCKING\n ].includes(step.type);\n\n if (!isRequiredStep) {\n return false;\n }\n\n return predicate(step);\n });\n};\n\nexport const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {\n scheduledOn: null,\n scheduledBy: null,\n scheduledActionId: null\n};\n\nexport interface FilterContentReviewsParams\n extends Pick<CreateContentReviewMethodsParams, \"getReviewer\" | \"getIdentity\"> {\n listParams: ApwContentReviewListParams;\n listContentReviews: CreateContentReviewMethodsParams[\"storageOperations\"][\"listContentReviews\"];\n}\n\n/**\n * Filter \"content reviews\" that are \"underReview\" and current user is a reviewer for the active step.\n * That is the user is able to provide sign-off or comment.\n */\nexport const filterContentReviewsByRequiresMyAttention = async (\n params: FilterContentReviewsParams\n): Promise<[ApwContentReview[], ListMeta]> => {\n const { listContentReviews, listParams, getIdentity, getReviewer } = params;\n /**\n * Get all \"content reviews\" with status \"underReview\"\n */\n const newListParams = set(\n cloneDeep(listParams),\n \"where.reviewStatus\",\n ApwContentReviewStatus.UNDER_REVIEW\n );\n const [contentReviews, meta] = await listContentReviews(newListParams);\n\n const identity = getIdentity();\n const filteredItems = [];\n /**\n * Filter items where current user is a reviewer for the active step.\n */\n for (let i = 0; i < contentReviews.length; i++) {\n const contentReview = contentReviews[i];\n\n const activeStep = contentReview.steps.find(\n step => step.status === ApwContentReviewStepStatus.ACTIVE\n );\n\n if (!activeStep) {\n continue;\n }\n\n let requiresMyAttention = false;\n\n for (let j = 0; j < activeStep.reviewers.length; j++) {\n const { id } = activeStep.reviewers[j];\n /**\n * Load reviewer\n */\n const reviewer = await getReviewer(id);\n /**\n * Check if the current logged in user is the reviewer.\n */\n if (reviewer.identityId === identity.id) {\n requiresMyAttention = true;\n break;\n }\n }\n\n if (requiresMyAttention) {\n filteredItems.push(contentReview);\n }\n }\n\n return [\n filteredItems,\n {\n ...meta,\n totalCount: filteredItems.length\n }\n ];\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAWAA,cAAK,CAACC,MAAM,CAACC,YAAG,CAAC;AAEV,SAASC,kBAAkB,CAACC,QAA4B,EAAQ;EACnE,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;IAC9B;EACJ;EAEA,IAAI,CAAC,IAAAJ,cAAK,EAACI,QAAQ,CAAC,CAACC,OAAO,EAAE,EAAE;IAC5B,MAAM,IAAIC,cAAK,CAAC;MACZC,OAAO,EAAG,mDAAkD;MAC5DC,IAAI,EAAE,yBAAyB;MAC/BC,IAAI,EAAE;QACFL;MACJ;IACJ,CAAC,CAAC;EACN;EACA,MAAMM,KAAK,GAAGV,cAAK,CAACE,GAAG,EAAE;EAEzB,IAAI,IAAAF,cAAK,EAACI,QAAQ,CAAC,CAACO,QAAQ,CAACD,KAAK,CAAC,EAAE;IACjC,MAAM,IAAIJ,cAAK,CAAC;MACZC,OAAO,EAAG,wCAAuC;MACjDC,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACFL;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AASO,MAAMQ,uBAAgD,GAAG,CAACC,KAAK,EAAEC,SAAS,KAAK;EAClF,OAAOD,KAAK,CAACE,MAAM,CAACC,IAAI,IAAI;IACxB,MAAMC,cAAc,GAAG,CACnBC,2BAAoB,CAACC,kBAAkB,EACvCD,2BAAoB,CAACE,sBAAsB,CAC9C,CAACC,QAAQ,CAACL,IAAI,CAACM,IAAI,CAAC;IAErB,IAAI,CAACL,cAAc,EAAE;MACjB,OAAO,KAAK;IAChB;IAEA,OAAOH,SAAS,CAACE,IAAI,CAAC;EAC1B,CAAC,CAAC;AACN,CAAC;AAAC;AAEK,MAAMO,4CAA4C,GAAG;EACxDC,WAAW,EAAE,IAAI;EACjBC,WAAW,EAAE,IAAI;EACjBC,iBAAiB,EAAE;AACvB,CAAC;AAAC;AAQF;AACA;AACA;AACA;AACO,MAAMC,yCAAyC,GAAG,MACrDC,MAAkC,IACQ;EAC1C,MAAM;IAAEC,kBAAkB;IAAEC,UAAU;IAAEC,WAAW;IAAEC;EAAY,CAAC,GAAGJ,MAAM;EAC3E;AACJ;AACA;EACI,MAAMK,aAAa,GAAG,IAAAC,YAAG,EACrB,IAAAC,kBAAS,EAACL,UAAU,CAAC,EACrB,oBAAoB,EACpBM,6BAAsB,CAACC,YAAY,CACtC;EACD,MAAM,CAACC,cAAc,EAAEC,IAAI,CAAC,GAAG,MAAMV,kBAAkB,CAACI,aAAa,CAAC;EAEtE,MAAMO,QAAQ,GAAGT,WAAW,EAAE;EAC9B,MAAMU,aAAa,GAAG,EAAE;EACxB;AACJ;AACA;EACI,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,cAAc,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IAC5C,MAAME,aAAa,GAAGN,cAAc,CAACI,CAAC,CAAC;IAEvC,MAAMG,UAAU,GAAGD,aAAa,CAAC/B,KAAK,CAACiC,IAAI,CACvC9B,IAAI,IAAIA,IAAI,CAAC+B,MAAM,KAAKC,iCAA0B,CAACC,MAAM,CAC5D;IAED,IAAI,CAACJ,UAAU,EAAE;MACb;IACJ;IAEA,IAAIK,mBAAmB,GAAG,KAAK;IAE/B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,UAAU,CAACO,SAAS,CAACT,MAAM,EAAEQ,CAAC,EAAE,EAAE;MAClD,MAAM;QAAEE;MAAG,CAAC,GAAGR,UAAU,CAACO,SAAS,CAACD,CAAC,CAAC;MACtC;AACZ;AACA;MACY,MAAMG,QAAQ,GAAG,MAAMtB,WAAW,CAACqB,EAAE,CAAC;MACtC;AACZ;AACA;MACY,IAAIC,QAAQ,CAACC,UAAU,KAAKf,QAAQ,CAACa,EAAE,EAAE;QACrCH,mBAAmB,GAAG,IAAI;QAC1B;MACJ;IACJ;IAEA,IAAIA,mBAAmB,EAAE;MACrBT,aAAa,CAACe,IAAI,CAACZ,aAAa,CAAC;IACrC;EACJ;EAEA,OAAO,CACHH,aAAa,8DAENF,IAAI;IACPkB,UAAU,EAAEhB,aAAa,CAACE;EAAM,GAEvC;AACL,CAAC;AAAC"}
|
package/index.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
1
|
import { CreateApwContextParams } from "./scheduler/types";
|
2
|
-
export declare const
|
3
|
-
export declare const createApwPageBuilderContext: (params: CreateApwContextParams) => (import("@webiny/plugins/types").Plugin<Record<string, any>> | import("@webiny/plugins/types").PluginCollection | import("@webiny/api").ContextPlugin<import("./types").ApwContext> | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("@webiny/api-mailer/types").MailerContext>)[];
|
2
|
+
export declare const createApwPageBuilderContext: (params: CreateApwContextParams) => (import("@webiny/api").ContextPlugin<import("./types").ApwContext> | import("@webiny/plugins/types").Plugin<Record<string, any>> | import("@webiny/plugins/types").PluginCollection | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("@webiny/api-mailer/types").MailerContext>)[];
|
4
3
|
export declare const createApwGraphQL: () => import("@webiny/api").ContextPlugin<import("./types").ApwContext>[];
|
package/index.js
CHANGED
@@ -1,38 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
|
-
exports.createApwPageBuilderContext = exports.
|
9
|
-
|
7
|
+
exports.createApwPageBuilderContext = exports.createApwGraphQL = void 0;
|
10
8
|
var _graphql = _interopRequireDefault(require("./plugins/graphql"));
|
11
|
-
|
12
9
|
var _context = require("./plugins/context");
|
13
|
-
|
14
10
|
var _apiMailer = require("@webiny/api-mailer");
|
15
|
-
|
16
11
|
var _apiAdminSettings = require("@webiny/api-admin-settings");
|
17
|
-
|
18
12
|
/**
|
19
13
|
* We have separated context and GraphQL creation so user can initialize only context if required.
|
20
14
|
* GraphQL will not work without context, but context will without GraphQL.
|
21
15
|
*/
|
22
|
-
const createApwHeadlessCmsContext = params => {
|
23
|
-
return [...(0, _apiAdminSettings.createAdminSettingsContext)(), ...(0, _apiMailer.createMailerContext)(), (0, _context.createApwHeadlessCmsContext)(params)];
|
24
|
-
};
|
25
|
-
|
26
|
-
exports.createApwHeadlessCmsContext = createApwHeadlessCmsContext;
|
27
16
|
|
28
17
|
const createApwPageBuilderContext = params => {
|
29
18
|
return [...(0, _apiAdminSettings.createAdminSettingsContext)(), ...(0, _apiMailer.createMailerContext)(), ...(0, _apiMailer.createMailerGraphQL)(), (0, _context.createApwPageBuilderContext)(params)];
|
30
19
|
};
|
31
|
-
|
32
20
|
exports.createApwPageBuilderContext = createApwPageBuilderContext;
|
33
|
-
|
34
21
|
const createApwGraphQL = () => {
|
35
22
|
return [(0, _graphql.default)()];
|
36
23
|
};
|
37
|
-
|
38
24
|
exports.createApwGraphQL = createApwGraphQL;
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["createApwPageBuilderContext","params","createAdminSettingsContext","createMailerContext","createMailerGraphQL","createPageBuilder","createApwGraphQL","graphql"],"sources":["index.ts"],"sourcesContent":["/**\n * We have separated context and GraphQL creation so user can initialize only context if required.\n * GraphQL will not work without context, but context will without GraphQL.\n */\nimport graphql from \"~/plugins/graphql\";\nimport { createApwPageBuilderContext as createPageBuilder } from \"./plugins/context\";\nimport { CreateApwContextParams } from \"./scheduler/types\";\nimport { createMailerContext, createMailerGraphQL } from \"@webiny/api-mailer\";\nimport { createAdminSettingsContext } from \"@webiny/api-admin-settings\";\n\nexport const createApwPageBuilderContext = (params: CreateApwContextParams) => {\n return [\n ...createAdminSettingsContext(),\n ...createMailerContext(),\n ...createMailerGraphQL(),\n createPageBuilder(params)\n ];\n};\n\nexport const createApwGraphQL = () => {\n return [graphql()];\n};\n"],"mappings":";;;;;;;AAIA;AACA;AAEA;AACA;AARA;AACA;AACA;AACA;;AAOO,MAAMA,2BAA2B,GAAIC,MAA8B,IAAK;EAC3E,OAAO,CACH,GAAG,IAAAC,4CAA0B,GAAE,EAC/B,GAAG,IAAAC,8BAAmB,GAAE,EACxB,GAAG,IAAAC,8BAAmB,GAAE,EACxB,IAAAC,oCAAiB,EAACJ,MAAM,CAAC,CAC5B;AACL,CAAC;AAAC;AAEK,MAAMK,gBAAgB,GAAG,MAAM;EAClC,OAAO,CAAC,IAAAC,gBAAO,GAAE,CAAC;AACtB,CAAC;AAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@webiny/api-apw",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.35.0-beta.0",
|
4
4
|
"keywords": [
|
5
5
|
"apw:base"
|
6
6
|
],
|
@@ -14,31 +14,31 @@
|
|
14
14
|
"author": "Webiny Ltd",
|
15
15
|
"license": "MIT",
|
16
16
|
"dependencies": {
|
17
|
-
"@aws-sdk/client-cloudwatch-events": "3.
|
18
|
-
"@babel/runtime": "7.
|
17
|
+
"@aws-sdk/client-cloudwatch-events": "3.54.1",
|
18
|
+
"@babel/runtime": "7.20.13",
|
19
19
|
"@commodo/fields": "1.1.2-beta.20",
|
20
|
-
"@webiny/api": "5.
|
21
|
-
"@webiny/api-admin-settings": "5.
|
22
|
-
"@webiny/api-headless-cms": "5.
|
23
|
-
"@webiny/api-i18n": "5.
|
24
|
-
"@webiny/api-i18n-ddb": "5.
|
25
|
-
"@webiny/api-mailer": "5.
|
26
|
-
"@webiny/api-page-builder": "5.
|
27
|
-
"@webiny/api-security": "5.
|
28
|
-
"@webiny/api-tenancy": "5.
|
29
|
-
"@webiny/api-wcp": "5.
|
30
|
-
"@webiny/db-dynamodb": "5.
|
31
|
-
"@webiny/error": "5.
|
32
|
-
"@webiny/handler": "5.
|
33
|
-
"@webiny/handler-client": "5.
|
34
|
-
"@webiny/handler-db": "5.
|
35
|
-
"@webiny/handler-graphql": "5.
|
36
|
-
"@webiny/handler-logs": "5.
|
37
|
-
"@webiny/plugins": "5.
|
38
|
-
"@webiny/pubsub": "5.
|
39
|
-
"@webiny/utils": "5.
|
40
|
-
"@webiny/validation": "5.
|
41
|
-
"dayjs": "1.11.
|
20
|
+
"@webiny/api": "5.35.0-beta.0",
|
21
|
+
"@webiny/api-admin-settings": "5.35.0-beta.0",
|
22
|
+
"@webiny/api-headless-cms": "5.35.0-beta.0",
|
23
|
+
"@webiny/api-i18n": "5.35.0-beta.0",
|
24
|
+
"@webiny/api-i18n-ddb": "5.35.0-beta.0",
|
25
|
+
"@webiny/api-mailer": "5.35.0-beta.0",
|
26
|
+
"@webiny/api-page-builder": "5.35.0-beta.0",
|
27
|
+
"@webiny/api-security": "5.35.0-beta.0",
|
28
|
+
"@webiny/api-tenancy": "5.35.0-beta.0",
|
29
|
+
"@webiny/api-wcp": "5.35.0-beta.0",
|
30
|
+
"@webiny/db-dynamodb": "5.35.0-beta.0",
|
31
|
+
"@webiny/error": "5.35.0-beta.0",
|
32
|
+
"@webiny/handler": "5.35.0-beta.0",
|
33
|
+
"@webiny/handler-client": "5.35.0-beta.0",
|
34
|
+
"@webiny/handler-db": "5.35.0-beta.0",
|
35
|
+
"@webiny/handler-graphql": "5.35.0-beta.0",
|
36
|
+
"@webiny/handler-logs": "5.35.0-beta.0",
|
37
|
+
"@webiny/plugins": "5.35.0-beta.0",
|
38
|
+
"@webiny/pubsub": "5.35.0-beta.0",
|
39
|
+
"@webiny/utils": "5.35.0-beta.0",
|
40
|
+
"@webiny/validation": "5.35.0-beta.0",
|
41
|
+
"dayjs": "1.11.7",
|
42
42
|
"lodash": "4.17.21",
|
43
43
|
"mdbid": "1.0.0"
|
44
44
|
},
|
@@ -46,14 +46,14 @@
|
|
46
46
|
"@babel/cli": "^7.19.3",
|
47
47
|
"@babel/core": "^7.19.3",
|
48
48
|
"@babel/preset-env": "^7.19.4",
|
49
|
-
"@webiny/api-headless-cms-ddb": "^5.
|
50
|
-
"@webiny/api-page-builder-so-ddb": "^5.
|
51
|
-
"@webiny/api-security-so-ddb": "^5.
|
52
|
-
"@webiny/api-tenancy-so-ddb": "^5.
|
53
|
-
"@webiny/cli": "^5.
|
54
|
-
"@webiny/handler-aws": "^5.
|
55
|
-
"@webiny/project-utils": "^5.
|
56
|
-
"@webiny/wcp": "^5.
|
49
|
+
"@webiny/api-headless-cms-ddb": "^5.35.0-beta.0",
|
50
|
+
"@webiny/api-page-builder-so-ddb": "^5.35.0-beta.0",
|
51
|
+
"@webiny/api-security-so-ddb": "^5.35.0-beta.0",
|
52
|
+
"@webiny/api-tenancy-so-ddb": "^5.35.0-beta.0",
|
53
|
+
"@webiny/cli": "^5.35.0-beta.0",
|
54
|
+
"@webiny/handler-aws": "^5.35.0-beta.0",
|
55
|
+
"@webiny/project-utils": "^5.35.0-beta.0",
|
56
|
+
"@webiny/wcp": "^5.35.0-beta.0",
|
57
57
|
"get-yarn-workspaces": "^1.0.2",
|
58
58
|
"graphql": "^15.7.2",
|
59
59
|
"jest": "^28.1.0",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"build": "yarn webiny run build",
|
73
73
|
"watch": "yarn webiny run watch"
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "8acc9e8892842cabb3980ce0b6432fde55968d5b"
|
76
76
|
}
|