@webiny/api-apw 5.37.8 → 5.38.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 +3 -1
- package/ApwCommentNotification.js +3 -1
- package/ApwContentReviewNotification.js +3 -1
- package/ApwContentUrlPlugin.js +3 -1
- package/ContentApwSettingsPlugin.js +3 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createContentReviewMethods.js +3 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/index.js +3 -1
- package/crud/utils.js +3 -1
- package/index.js +3 -1
- package/package.json +26 -26
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +3 -1
- package/plugins/cms/apwEntryPlugins.js +3 -1
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/linkContentReviewToEntry.js +4 -2
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +10 -6
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/triggerContentReview.js +4 -2
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +5 -3
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +2 -1
- package/plugins/cms/utils.js +17 -8
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +3 -1
- package/plugins/graphql/changeRequest.gql.js +3 -1
- package/plugins/graphql/comment.gql.js +3 -1
- package/plugins/graphql/contentReview.gql.js +3 -1
- package/plugins/graphql/reviewer.gql.js +3 -1
- package/plugins/graphql/workflow.gql.js +3 -1
- package/plugins/graphql.js +3 -1
- package/plugins/hooks/createReviewerFromIdentity.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/initializeContentReviewSteps.js +3 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/listContentReviews.js +3 -1
- package/plugins/hooks/notifications/appUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/reviewers.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/updatePendingChangeRequests.js +3 -1
- package/plugins/hooks/updateTotalComments.js +3 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +3 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +3 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
- package/plugins/pageBuilder/triggerContentReview.js +3 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +3 -1
- package/plugins/pageBuilder/utils.js +3 -1
- package/plugins/utils.js +3 -1
- package/scheduler/createScheduleActionMethods.js +3 -1
- package/scheduler/handlers/executeAction/index.js +3 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +3 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +3 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +3 -1
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/scheduleAction/index.js +3 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +3 -1
- package/scheduler/handlers/utils.js +3 -1
- package/scheduler/index.js +3 -1
- package/scheduler/types.d.ts +2 -3
- package/scheduler/types.js +3 -1
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +28 -1
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +3 -1
- package/storageOperations/contentReviewStorageOperations.js +3 -1
- package/storageOperations/index.js +3 -1
- package/storageOperations/models/changeRequest.model.js +3 -1
- package/storageOperations/models/comment.model.js +3 -1
- package/storageOperations/models/contentModelPluginFactory.js +3 -1
- package/storageOperations/models/contentReview.model.js +4 -2
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +3 -1
- package/storageOperations/models/reviewer.model.js +3 -1
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/workflow.model.js +7 -7
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +3 -1
- package/storageOperations/types.js +3 -1
- package/storageOperations/workflowStorageOperations.js +3 -1
- package/types.js +3 -1
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/errors.js +3 -1
- package/utils/fieldResolver.js +3 -1
- package/utils/resolve.js +3 -1
package/plugins/cms/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_types","_utils","_changeRequest","_comment","_contentReview","_reviewer","_workflow","fetchModel","cms","id","settings","WebinyError","modelId","model","getModel","exports","getEntryTitle","entry","titleFieldId","values","getLatestEntryRevision","params","entryId","items","getLatestEntriesByIds","item","shift","updateEntryMeta","meta","updateEntry","isWorkflowApplicable","workflow","application","app","ApwWorkflowApplications","CMS","scopeType","scope","type","WorkflowScopeTypes","DEFAULT","CUSTOM","_workflow$scope$data","_workflow$scope$data2","models","data","Array","isArray","includes","entries","some","value","assignWorkflowToEntry","apw","list","where","console","log","length","sortedWorkflows","sort","workflowByPrecedenceDesc","workflowByCreatedOnDesc","_objectSpread2","default","workflowId","contentReviewId","ex","code","hasEntries","isAwpModel","CHANGE_REQUEST_MODEL_ID","COMMENT_MODEL_ID","CONTENT_REVIEW_MODEL_ID","REVIEWER_MODEL_ID","WORKFLOW_MODEL_ID"],"sources":["utils.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntry, CmsModel, HeadlessCms } from \"@webiny/api-headless-cms/types\";\nimport {\n AdvancedPublishingWorkflow,\n ApwWorkflow,\n ApwWorkflowApplications,\n WorkflowScopeTypes\n} from \"~/types\";\nimport { workflowByCreatedOnDesc, workflowByPrecedenceDesc } from \"~/plugins/utils\";\nimport { CHANGE_REQUEST_MODEL_ID } from \"~/storageOperations/models/changeRequest.model\";\nimport { COMMENT_MODEL_ID } from \"~/storageOperations/models/comment.model\";\nimport { CONTENT_REVIEW_MODEL_ID } from \"~/storageOperations/models/contentReview.model\";\nimport { REVIEWER_MODEL_ID } from \"~/storageOperations/models/reviewer.model\";\nimport { WORKFLOW_MODEL_ID } from \"~/storageOperations/models/workflow.model\";\n\nexport const fetchModel = async (\n cms: HeadlessCms,\n id: string,\n settings?: { modelId?: string } | null\n): Promise<CmsModel> => {\n if (!settings) {\n throw new WebinyError(\"Missing settings.\", \"SETTINGS_ERROR\", {\n id\n });\n }\n const modelId = settings.modelId;\n if (!modelId) {\n throw new WebinyError(\"Missing modelId in settings.\", \"MODEL_ID_ERROR\", {\n id,\n settings\n });\n }\n const model = await cms.getModel(modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\"There is no requested model in the system.\", \"MODEL_NOT_EXISTS\", {\n id,\n settings\n });\n};\n\nexport const getEntryTitle = (model: CmsModel, entry: CmsEntry): string => {\n const titleFieldId = model.titleFieldId;\n if (!titleFieldId || !entry.values[titleFieldId]) {\n return entry.id;\n }\n return entry.values[titleFieldId];\n};\n\ninterface GetLatestEntryRevisionParams {\n cms: HeadlessCms;\n model: CmsModel;\n entryId: string;\n}\nexport const getLatestEntryRevision = async (\n params: GetLatestEntryRevisionParams\n): Promise<CmsEntry> => {\n const { cms, model, entryId } = params;\n const items = await cms.getLatestEntriesByIds(model, [entryId]);\n\n const item = items.shift();\n if (!item) {\n throw new WebinyError(\"There is no entry with given ID.\", \"ENTRY_NOT_FOUND\", {\n entryId\n });\n }\n return item;\n};\n\ninterface UpdateEntryMetaParams {\n meta: Record<string, any>;\n entryId: string;\n cms: HeadlessCms;\n model: CmsModel;\n}\nexport const updateEntryMeta = async (params: UpdateEntryMetaParams): Promise<void> => {\n const { entryId, cms, model, meta } = params;\n\n const entry = await getLatestEntryRevision({\n cms,\n model,\n entryId\n });\n\n await cms.updateEntry(model, entry.id, {}, meta);\n};\n\nconst isWorkflowApplicable = (entry: CmsEntry, workflow: ApwWorkflow): boolean => {\n const application = workflow.app;\n if (application !== ApwWorkflowApplications.CMS) {\n return false;\n }\n\n const scopeType = workflow.scope.type;\n\n if (scopeType === WorkflowScopeTypes.DEFAULT) {\n return true;\n } else if (scopeType === WorkflowScopeTypes.CUSTOM) {\n const models = workflow.scope.data?.models;\n\n if (Array.isArray(models) && models.includes(entry.modelId)) {\n return true;\n }\n\n const entries = workflow.scope.data?.entries || [];\n if (Array.isArray(entries) && entries.some(value => value.id === entry.entryId)) {\n return true;\n }\n return false;\n }\n throw new WebinyError(`Unknown scope type \"${scopeType}\".`, \"UNKNOWN_SCOPE_TYPE\", {\n workflow\n });\n};\n\ninterface AssignWorkflowToEntryParams {\n apw: AdvancedPublishingWorkflow;\n entry: CmsEntry;\n}\nexport const assignWorkflowToEntry = async (params: AssignWorkflowToEntryParams): Promise<void> => {\n const { apw, entry } = params;\n /**\n * Lookup and assign \"workflowId\".\n */\n try {\n /*\n * List all workflows for app cms\n */\n const [entries] = await apw.workflow.list({\n where: {\n app: ApwWorkflowApplications.CMS\n }\n });\n\n console.log(`Found ${entries.length} workflows.`);\n\n /*\n * Re-order them based on workflow scope and pre-defined rule i.e.\n * \"specific\" entry -> entry for a \"category\" -> \"default\".\n * There can be more than one workflow with same \"scope\" and \"app\".\n * Therefore, we are also sorting the workflows by `createdOn` to get the latest workflow.\n */\n const sortedWorkflows = entries\n .sort(workflowByPrecedenceDesc)\n .sort(workflowByCreatedOnDesc);\n\n /**\n * Assign the first applicable workflow to the page and exit.\n */\n for (const workflow of sortedWorkflows) {\n if (isWorkflowApplicable(entry, workflow) === false) {\n console.log(`Not applying workflow ${workflow.id} to entry ${entry.id}.`);\n continue;\n }\n entry.meta = {\n ...(entry.meta || {}),\n apw: {\n workflowId: workflow.id,\n contentReviewId: null\n }\n };\n return;\n }\n } catch (ex) {\n throw new WebinyError(\n `Failed to assign workflow to CMS entry \"${entry.id}\".`,\n ex.code,\n ex.data\n );\n }\n};\n\nexport const hasEntries = (workflow: ApwWorkflow): Boolean => {\n const { app, scope } = workflow;\n return (\n app === ApwWorkflowApplications.CMS &&\n scope.type === WorkflowScopeTypes.CUSTOM &&\n scope.data &&\n Array.isArray(scope.data.entries)\n );\n};\n\nexport const isAwpModel = (model: CmsModel): boolean => {\n return [\n CHAN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MAAMC,UAAU,GAAIzD,KAAe,IAAc;EACpD,OAAO,CACH0D,sCAAuB,EACvBC,yBAAgB,EAChBC,sCAAuB,EACvBC,2BAAiB,EACjBC,2BAAiB,CACpB,CAAC3B,QAAQ,CAACnC,KAAK,CAACD,OAAO,CAAC;AAC7B,CAAC;AAACG,OAAA,CAAAuD,UAAA,GAAAA,UAAA"}
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_types","_utils","_changeRequest","_comment","_contentReview","_reviewer","_workflow","fetchModel","cms","id","settings","WebinyError","modelId","model","getModel","exports","getEntryTitle","entry","titleFieldId","values","getLatestEntryRevision","params","entryId","item","getLatestEntriesByIds","updateEntryMeta","meta","updateEntry","isWorkflowApplicable","workflow","application","app","ApwWorkflowApplications","CMS","scopeType","scope","type","WorkflowScopeTypes","DEFAULT","CUSTOM","_workflow$scope$data","_workflow$scope$data2","models","data","Array","isArray","includes","entries","some","value","assignWorkflowToEntry","apw","list","where","console","log","length","sortedWorkflows","sort","workflowByPrecedenceDesc","workflowByCreatedOnDesc","_objectSpread2","default","workflowId","contentReviewId","ex","code","hasEntries","isApwDisabledOnModel","isPrivate","CHANGE_REQUEST_MODEL_ID","COMMENT_MODEL_ID","CONTENT_REVIEW_MODEL_ID","REVIEWER_MODEL_ID","WORKFLOW_MODEL_ID"],"sources":["utils.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntry, CmsModel, HeadlessCms } from \"@webiny/api-headless-cms/types\";\nimport {\n AdvancedPublishingWorkflow,\n ApwWorkflow,\n ApwWorkflowApplications,\n WorkflowScopeTypes\n} from \"~/types\";\nimport { workflowByCreatedOnDesc, workflowByPrecedenceDesc } from \"~/plugins/utils\";\nimport { CHANGE_REQUEST_MODEL_ID } from \"~/storageOperations/models/changeRequest.model\";\nimport { COMMENT_MODEL_ID } from \"~/storageOperations/models/comment.model\";\nimport { CONTENT_REVIEW_MODEL_ID } from \"~/storageOperations/models/contentReview.model\";\nimport { REVIEWER_MODEL_ID } from \"~/storageOperations/models/reviewer.model\";\nimport { WORKFLOW_MODEL_ID } from \"~/storageOperations/models/workflow.model\";\n\nexport const fetchModel = async (\n cms: HeadlessCms,\n id: string,\n settings?: { modelId?: string } | null\n): Promise<CmsModel> => {\n if (!settings) {\n throw new WebinyError(\"Missing settings.\", \"SETTINGS_ERROR\", {\n id\n });\n }\n const modelId = settings.modelId;\n if (!modelId) {\n throw new WebinyError(\"Missing modelId in settings.\", \"MODEL_ID_ERROR\", {\n id,\n settings\n });\n }\n const model = await cms.getModel(modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\"There is no requested model in the system.\", \"MODEL_NOT_EXISTS\", {\n id,\n settings\n });\n};\n\nexport const getEntryTitle = (model: CmsModel, entry: CmsEntry): string => {\n const titleFieldId = model.titleFieldId;\n if (!titleFieldId || !entry.values[titleFieldId]) {\n return entry.id;\n }\n return entry.values[titleFieldId];\n};\n\ninterface GetLatestEntryRevisionParams {\n cms: HeadlessCms;\n model: CmsModel;\n entryId: string;\n}\nexport const getLatestEntryRevision = async (\n params: GetLatestEntryRevisionParams\n): Promise<CmsEntry> => {\n const { cms, model, entryId } = params;\n const [item] = await cms.getLatestEntriesByIds(model, [entryId]);\n\n if (!item) {\n throw new WebinyError(\"There is no entry with given ID.\", \"ENTRY_NOT_FOUND\", {\n entryId,\n model: model.modelId\n });\n }\n return item;\n};\n\ninterface UpdateEntryMetaParams {\n meta: Record<string, any>;\n entryId: string;\n cms: HeadlessCms;\n model: CmsModel;\n}\nexport const updateEntryMeta = async (params: UpdateEntryMetaParams): Promise<void> => {\n const { entryId, cms, model, meta } = params;\n\n const entry = await getLatestEntryRevision({\n cms,\n model,\n entryId\n });\n\n await cms.updateEntry(model, entry.id, {}, meta);\n};\n\nconst isWorkflowApplicable = (entry: CmsEntry, workflow: ApwWorkflow): boolean => {\n const application = workflow.app;\n if (application !== ApwWorkflowApplications.CMS) {\n return false;\n }\n\n const scopeType = workflow.scope.type;\n\n if (scopeType === WorkflowScopeTypes.DEFAULT) {\n return true;\n } else if (scopeType === WorkflowScopeTypes.CUSTOM) {\n const models = workflow.scope.data?.models;\n\n if (Array.isArray(models) && models.includes(entry.modelId)) {\n return true;\n }\n\n const entries = workflow.scope.data?.entries || [];\n if (Array.isArray(entries) && entries.some(value => value.id === entry.entryId)) {\n return true;\n }\n return false;\n }\n throw new WebinyError(`Unknown scope type \"${scopeType}\".`, \"UNKNOWN_SCOPE_TYPE\", {\n workflow\n });\n};\n\ninterface AssignWorkflowToEntryParams {\n apw: AdvancedPublishingWorkflow;\n entry: CmsEntry;\n model: CmsModel;\n}\nexport const assignWorkflowToEntry = async (params: AssignWorkflowToEntryParams): Promise<void> => {\n const { apw, entry, model } = params;\n /**\n * Lookup and assign \"workflowId\".\n */\n try {\n /*\n * List all workflows for app cms\n */\n const [entries] = await apw.workflow.list({\n where: {\n app: ApwWorkflowApplications.CMS\n }\n });\n\n console.log(`Found ${entries.length} workflow(s) for model ${model.modelId}.`);\n\n /*\n * Re-order them based on workflow scope and pre-defined rule i.e.\n * \"specific\" entry -> entry for a \"category\" -> \"default\".\n * There can be more than one workflow with same \"scope\" and \"app\".\n * Therefore, we are also sorting the workflows by `createdOn` to get the latest workflow.\n */\n const sortedWorkflows = entries\n .sort(workflowByPrecedenceDesc)\n .sort(workflowByCreatedOnDesc);\n\n /**\n * Assign the first applicable workflow to the page and exit.\n */\n for (const workflow of sortedWorkflows) {\n if (isWorkflowApplicable(entry, workflow) === false) {\n console.log(`Not applying workflow ${workflow.id} to entry ${entry.id}.`);\n continue;\n }\n entry.meta = {\n ...(entry.meta || {}),\n apw: {\n workflowId: workflow.id,\n contentReviewId: null\n }\n };\n return;\n }\n } catch (ex) {\n throw new WebinyError(\n `Failed to assign workflow to CMS entry \"${entry.id}\".`,\n ex.code,\n ex.data\n );\n }\n};\n\nexport const hasEntries = (workflow: ApwWorkflow): Boolean => {\n const { app, scope } = workflow;\n return (\n app === ApwWorkflowApplications.CMS &&\n scope.type === WorkflowScopeTypes.CUSTOM &&\n scope.data &&\n Array.isArray(scope.data.entries)\n );\n};\n\nexport const isApwDisabledOnModel = (model: Pick<CmsModel, \"modelId\" | \"isPrivate\">): boolean => {\n /**\n * We should not run APW on private models as well.\n */\n if (model.isPrivate) {\n return true;\n }\n return [\n CHANGE_REQUEST_MODEL_ID,\n COMMENT_MODEL_ID,\n CONTENT_REVIEW_MODEL_ID,\n REVIEWER_MODEL_ID,\n WORKFLOW_MODEL_ID\n ].includes(model.modelId);\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEO,MAAMQ,UAAU,GAAG,MAAAA,CACtBC,GAAgB,EAChBC,EAAU,EACVC,QAAsC,KAClB;EACpB,IAAI,CAACA,QAAQ,EAAE;IACX,MAAM,IAAIC,cAAW,CAAC,mBAAmB,EAAE,gBAAgB,EAAE;MACzDF;IACJ,CAAC,CAAC;EACN;EACA,MAAMG,OAAO,GAAGF,QAAQ,CAACE,OAAO;EAChC,IAAI,CAACA,OAAO,EAAE;IACV,MAAM,IAAID,cAAW,CAAC,8BAA8B,EAAE,gBAAgB,EAAE;MACpEF,EAAE;MACFC;IACJ,CAAC,CAAC;EACN;EACA,MAAMG,KAAK,GAAG,MAAML,GAAG,CAACM,QAAQ,CAACF,OAAO,CAAC;EACzC,IAAIC,KAAK,EAAE;IACP,OAAOA,KAAK;EAChB;EACA,MAAM,IAAIF,cAAW,CAAC,4CAA4C,EAAE,kBAAkB,EAAE;IACpFF,EAAE;IACFC;EACJ,CAAC,CAAC;AACN,CAAC;AAACK,OAAA,CAAAR,UAAA,GAAAA,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uB,CAACC,GAAG,IACnCE,KAAK,CAACC,IAAI,KAAKC,yBAAkB,CAACE,MAAM,IACxCJ,KAAK,CAACQ,IAAI,IACVC,KAAK,CAACC,OAAO,CAACV,KAAK,CAACQ,IAAI,CAACI,OAAO,CAAC;AAEzC,CAAC;AAAChC,OAAA,CAAAoD,UAAA,GAAAA,UAAA;AAEK,MAAMC,oBAAoB,GAAIvD,KAA8C,IAAc;EAC7F;AACJ;AACA;EACI,IAAIA,KAAK,CAACwD,SAAS,EAAE;IACjB,OAAO,IAAI;EACf;EACA,OAAO,CACHC,sCAAuB,EACvBC,yBAAgB,EAChBC,sCAAuB,EACvBC,2BAAiB,EACjBC,2BAAiB,CACpB,CAAC5B,QAAQ,CAACjC,KAAK,CAACD,OAAO,CAAC;AAC7B,CAAC;AAACG,OAAA,CAAAqD,oBAAA,GAAAA,oBAAA"}
|
package/plugins/context.js
CHANGED
|
@@ -98,4 +98,6 @@ const createApwPageBuilderContext = params => {
|
|
|
98
98
|
context.plugins.register((0, _extendPbPageSettingsSchema.extendPbPageSettingsSchema)());
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
|
-
exports.createApwPageBuilderContext = createApwPageBuilderContext;
|
|
101
|
+
exports.createApwPageBuilderContext = createApwPageBuilderContext;
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=context.js.map
|
package/plugins/graphql.js
CHANGED
|
@@ -77,4 +77,6 @@ var _default = () => {
|
|
|
77
77
|
context.plugins.register([baseSchema, _workflow.default, _contentReview.default, _reviewer.default, _comment.default, _changeRequest.default]);
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
|
-
exports.default = _default;
|
|
80
|
+
exports.default = _default;
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -56,4 +56,6 @@ const deleteChangeRequestsWithContentReview = ({
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
exports.deleteChangeRequestsWithContentReview = deleteChangeRequestsWithContentReview;
|
|
59
|
+
exports.deleteChangeRequestsWithContentReview = deleteChangeRequestsWithContentReview;
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=deleteChangeRequestsAfterContentReview.js.map
|
|
@@ -49,4 +49,6 @@ const deleteCommentsAfterChangeRequest = ({
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
exports.deleteCommentsAfterChangeRequest = deleteCommentsAfterChangeRequest;
|
|
52
|
+
exports.deleteCommentsAfterChangeRequest = deleteCommentsAfterChangeRequest;
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=deleteCommentsAfterChangeRequest.js.map
|
package/plugins/hooks/index.js
CHANGED
|
@@ -57,4 +57,6 @@ new _api.ContextPlugin(async context => {
|
|
|
57
57
|
(0, _listContentReviews.listContentReviews)(context);
|
|
58
58
|
(0, _initializeNotifications.initializeNotifications)(context);
|
|
59
59
|
});
|
|
60
|
-
exports.attachApwHooks = attachApwHooks;
|
|
60
|
+
exports.attachApwHooks = attachApwHooks;
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -76,4 +76,6 @@ const initializeContentReviewSteps = ({
|
|
|
76
76
|
input = (0, _set.default)(input, "steps", updatedSteps);
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
exports.initializeContentReviewSteps = initializeContentReviewSteps;
|
|
79
|
+
exports.initializeContentReviewSteps = initializeContentReviewSteps;
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=initializeContentReviewSteps.js.map
|
|
@@ -12,4 +12,6 @@ const initializeNotifications = context => {
|
|
|
12
12
|
(0, _commentAfterCreate.attachCommentAfterCreate)(context);
|
|
13
13
|
(0, _changeRequestAfterCreate.attachChangeRequestAfterCreate)(context);
|
|
14
14
|
};
|
|
15
|
-
exports.initializeNotifications = initializeNotifications;
|
|
15
|
+
exports.initializeNotifications = initializeNotifications;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=initializeNotifications.js.map
|
|
@@ -53,4 +53,6 @@ const listContentReviews = ({
|
|
|
53
53
|
where.workflowId_in = userWorkflows.map(workflow => workflow.id);
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
exports.listContentReviews = listContentReviews;
|
|
56
|
+
exports.listContentReviews = listContentReviews;
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=listContentReviews.js.map
|
|
@@ -108,4 +108,6 @@ const attachChangeRequestAfterCreate = context => {
|
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
-
exports.attachChangeRequestAfterCreate = attachChangeRequestAfterCreate;
|
|
111
|
+
exports.attachChangeRequestAfterCreate = attachChangeRequestAfterCreate;
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=changeRequestAfterCreate.js.map
|
|
@@ -24,4 +24,6 @@ const createChangeRequestUrl = params => {
|
|
|
24
24
|
} = params;
|
|
25
25
|
return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;
|
|
26
26
|
};
|
|
27
|
-
exports.createChangeRequestUrl = createChangeRequestUrl;
|
|
27
|
+
exports.createChangeRequestUrl = createChangeRequestUrl;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=changeRequestUrl.js.map
|
|
@@ -24,4 +24,6 @@ const createCommentUrl = params => {
|
|
|
24
24
|
} = params;
|
|
25
25
|
return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;
|
|
26
26
|
};
|
|
27
|
-
exports.createCommentUrl = createCommentUrl;
|
|
27
|
+
exports.createCommentUrl = createCommentUrl;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=commentUrl.js.map
|
|
@@ -91,4 +91,6 @@ const attachContentReviewAfterCreate = context => {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
|
-
exports.attachContentReviewAfterCreate = attachContentReviewAfterCreate;
|
|
94
|
+
exports.attachContentReviewAfterCreate = attachContentReviewAfterCreate;
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=contentReviewAfterCreate.js.map
|
|
@@ -23,4 +23,6 @@ const createContentReviewUrl = params => {
|
|
|
23
23
|
} = params;
|
|
24
24
|
return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}`;
|
|
25
25
|
};
|
|
26
|
-
exports.createContentReviewUrl = createContentReviewUrl;
|
|
26
|
+
exports.createContentReviewUrl = createContentReviewUrl;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=contentReviewUrl.js.map
|
|
@@ -18,4 +18,6 @@ const getLastChangeRequestNotificationPlugin = params => {
|
|
|
18
18
|
});
|
|
19
19
|
return plugins.shift();
|
|
20
20
|
};
|
|
21
|
-
exports.getLastChangeRequestNotificationPlugin = getLastChangeRequestNotificationPlugin;
|
|
21
|
+
exports.getLastChangeRequestNotificationPlugin = getLastChangeRequestNotificationPlugin;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=lastChangeRequestNotificationPlugin.js.map
|
|
@@ -18,4 +18,6 @@ const getLastCommentNotificationPlugin = params => {
|
|
|
18
18
|
});
|
|
19
19
|
return plugins.shift();
|
|
20
20
|
};
|
|
21
|
-
exports.getLastCommentNotificationPlugin = getLastCommentNotificationPlugin;
|
|
21
|
+
exports.getLastCommentNotificationPlugin = getLastCommentNotificationPlugin;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=lastCommentNotificationPlugin.js.map
|
|
@@ -18,4 +18,6 @@ const getLastContentReviewNotificationPlugin = params => {
|
|
|
18
18
|
});
|
|
19
19
|
return plugins.shift();
|
|
20
20
|
};
|
|
21
|
-
exports.getLastContentReviewNotificationPlugin = getLastContentReviewNotificationPlugin;
|
|
21
|
+
exports.getLastContentReviewNotificationPlugin = getLastContentReviewNotificationPlugin;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=lastContentReviewNotificationPlugin.js.map
|
|
@@ -38,4 +38,6 @@ const sendChangeRequestNotification = async params => {
|
|
|
38
38
|
}
|
|
39
39
|
console.log("Error while sending e-mail", JSON.stringify(result.error));
|
|
40
40
|
};
|
|
41
|
-
exports.sendChangeRequestNotification = sendChangeRequestNotification;
|
|
41
|
+
exports.sendChangeRequestNotification = sendChangeRequestNotification;
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=sendChangeRequestNotification.js.map
|
|
@@ -38,4 +38,6 @@ const sendCommentNotification = async params => {
|
|
|
38
38
|
}
|
|
39
39
|
console.log("Error while sending e-mail", JSON.stringify(result.error));
|
|
40
40
|
};
|
|
41
|
-
exports.sendCommentNotification = sendCommentNotification;
|
|
41
|
+
exports.sendCommentNotification = sendCommentNotification;
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=sendCommentNotification.js.map
|
|
@@ -38,4 +38,6 @@ const sendContentReviewNotification = async params => {
|
|
|
38
38
|
}
|
|
39
39
|
console.log("Error while sending e-mail", JSON.stringify(result.error));
|
|
40
40
|
};
|
|
41
|
-
exports.sendContentReviewNotification = sendContentReviewNotification;
|
|
41
|
+
exports.sendContentReviewNotification = sendContentReviewNotification;
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=sendContentReviewNotification.js.map
|
|
@@ -83,4 +83,6 @@ const updatePendingChangeRequestsCount = ({
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
exports.updatePendingChangeRequestsCount = updatePendingChangeRequestsCount;
|
|
86
|
+
exports.updatePendingChangeRequestsCount = updatePendingChangeRequestsCount;
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=updatePendingChangeRequests.js.map
|
|
@@ -33,4 +33,6 @@ class PageApwSettingsGetterPlugin extends _ContentApwSettingsPlugin.ContentApwSe
|
|
|
33
33
|
return (_page$settings$apw2 = page.settings.apw) === null || _page$settings$apw2 === void 0 ? void 0 : _page$settings$apw2.contentReviewId;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
exports.PageApwSettingsGetterPlugin = PageApwSettingsGetterPlugin;
|
|
36
|
+
exports.PageApwSettingsGetterPlugin = PageApwSettingsGetterPlugin;
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=PageApwSettingsGetterPlugin.js.map
|
|
@@ -23,4 +23,6 @@ const apwContentPagePlugins = () => new _api.ContextPlugin(async context => {
|
|
|
23
23
|
return true;
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
|
-
exports.apwContentPagePlugins = apwContentPagePlugins;
|
|
26
|
+
exports.apwContentPagePlugins = apwContentPagePlugins;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=apwContentPagePlugins.js.map
|
|
@@ -17,4 +17,6 @@ const extendPbPageSettingsSchema = () => new _plugins.GraphQLSchemaPlugin({
|
|
|
17
17
|
}
|
|
18
18
|
`
|
|
19
19
|
});
|
|
20
|
-
exports.extendPbPageSettingsSchema = extendPbPageSettingsSchema;
|
|
20
|
+
exports.extendPbPageSettingsSchema = extendPbPageSettingsSchema;
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=extendPbPageSettingsSchema.js.map
|
|
@@ -28,4 +28,6 @@ const createChangeRequestNotification = () => {
|
|
|
28
28
|
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
|
29
29
|
return plugin;
|
|
30
30
|
};
|
|
31
|
-
exports.createChangeRequestNotification = createChangeRequestNotification;
|
|
31
|
+
exports.createChangeRequestNotification = createChangeRequestNotification;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=changeRequestNotification.js.map
|
|
@@ -28,4 +28,6 @@ const createCommentNotification = () => {
|
|
|
28
28
|
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
|
29
29
|
return plugin;
|
|
30
30
|
};
|
|
31
|
-
exports.createCommentNotification = createCommentNotification;
|
|
31
|
+
exports.createCommentNotification = createCommentNotification;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=commentNotification.js.map
|
|
@@ -28,4 +28,6 @@ const createContentReviewNotification = () => {
|
|
|
28
28
|
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
|
29
29
|
return plugin;
|
|
30
30
|
};
|
|
31
|
-
exports.createContentReviewNotification = createContentReviewNotification;
|
|
31
|
+
exports.createContentReviewNotification = createContentReviewNotification;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=contentReviewNotification.js.map
|
package/plugins/utils.js
CHANGED
|
@@ -141,4 +141,6 @@ const workflowByCreatedOnDesc = (a, b) => {
|
|
|
141
141
|
*/
|
|
142
142
|
return new Date(createdOnB).getTime() - new Date(createdOnA).getTime();
|
|
143
143
|
};
|
|
144
|
-
exports.workflowByCreatedOnDesc = workflowByCreatedOnDesc;
|
|
144
|
+
exports.workflowByCreatedOnDesc = workflowByCreatedOnDesc;
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -175,4 +175,6 @@ const createExecuteActionLambda = params => {
|
|
|
175
175
|
const executeActionHandlerPlugins = config => [new _api.ContextPlugin(async context => {
|
|
176
176
|
context.plugins.register([new _PageBuilderGraphQL.PageBuilderGraphQL(), new _HeadlessCMSGraphQL.HeadlessCMSGraphQL()]);
|
|
177
177
|
}), (0, _utils.basePlugins)(), createExecuteActionLambda(config)];
|
|
178
|
-
exports.executeActionHandlerPlugins = executeActionHandlerPlugins;
|
|
178
|
+
exports.executeActionHandlerPlugins = executeActionHandlerPlugins;
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -23,4 +23,6 @@ var _types = require("../../../types");
|
|
|
23
23
|
var _utils = require("../../utils");
|
|
24
24
|
class ApplicationGraphQL extends _Plugin.Plugin {}
|
|
25
25
|
exports.ApplicationGraphQL = ApplicationGraphQL;
|
|
26
|
-
(0, _defineProperty2.default)(ApplicationGraphQL, "type", "apw.scheduler.applicationGraphQL");
|
|
26
|
+
(0, _defineProperty2.default)(ApplicationGraphQL, "type", "apw.scheduler.applicationGraphQL");
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=ApplicationGraphQL.js.map
|
|
@@ -145,4 +145,6 @@ const createScheduleActionLambda = params => {
|
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
const scheduleActionHandlerPlugins = config => [(0, _utils.basePlugins)(), createScheduleActionLambda(config)];
|
|
148
|
-
exports.scheduleActionHandlerPlugins = scheduleActionHandlerPlugins;
|
|
148
|
+
exports.scheduleActionHandlerPlugins = scheduleActionHandlerPlugins;
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
package/scheduler/index.js
CHANGED
package/scheduler/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Context } from "@webiny/api/types";
|
|
2
2
|
import { SecurityIdentity, SecurityPermission } from "@webiny/api-security/types";
|
|
3
|
-
import {
|
|
4
|
-
import { Tenant } from "@webiny/api-tenancy/types";
|
|
5
|
-
import { TenancyContext } from "@webiny/api-tenancy/types";
|
|
3
|
+
import { I18NContext, I18NLocale } from "@webiny/api-i18n/types";
|
|
4
|
+
import { TenancyContext, Tenant } from "@webiny/api-tenancy/types";
|
|
6
5
|
import { ApwIdentity } from "../types";
|
|
7
6
|
export interface ListWhere {
|
|
8
7
|
/**
|
package/scheduler/types.js
CHANGED
|
@@ -20,4 +20,6 @@ let InvocationTypes = /*#__PURE__*/function (InvocationTypes) {
|
|
|
20
20
|
InvocationTypes["SCHEDULED"] = "scheduled";
|
|
21
21
|
return InvocationTypes;
|
|
22
22
|
}({});
|
|
23
|
-
exports.InvocationTypes = InvocationTypes;
|
|
23
|
+
exports.InvocationTypes = InvocationTypes;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=types.js.map
|