@webiny/api-apw 0.0.0-unstable.5e7233243f
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/ContentApwSettingsPlugin.d.ts +10 -0
- package/ContentApwSettingsPlugin.js +17 -0
- package/ContentApwSettingsPlugin.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/crud/createChangeRequestMethods.d.ts +2 -0
- package/crud/createChangeRequestMethods.js +95 -0
- package/crud/createChangeRequestMethods.js.map +1 -0
- package/crud/createCommentMethods.d.ts +2 -0
- package/crud/createCommentMethods.js +96 -0
- package/crud/createCommentMethods.js.map +1 -0
- package/crud/createContentReviewMethods.d.ts +10 -0
- package/crud/createContentReviewMethods.js +552 -0
- package/crud/createContentReviewMethods.js.map +1 -0
- package/crud/createReviewerMethods.d.ts +2 -0
- package/crud/createReviewerMethods.js +96 -0
- package/crud/createReviewerMethods.js.map +1 -0
- package/crud/createWorkflowMethods.d.ts +2 -0
- package/crud/createWorkflowMethods.js +96 -0
- package/crud/createWorkflowMethods.js.map +1 -0
- package/crud/index.d.ts +2 -0
- package/crud/index.js +100 -0
- package/crud/index.js.map +1 -0
- package/crud/utils.d.ts +21 -0
- package/crud/utils.js +142 -0
- package/crud/utils.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +34 -0
- package/index.js.map +1 -0
- package/package.json +75 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +10 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +51 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/cms/README.md +49 -0
- package/plugins/cms/apwEntryPlugins.d.ts +8 -0
- package/plugins/cms/apwEntryPlugins.js +50 -0
- package/plugins/cms/apwEntryPlugins.js.map +1 -0
- package/plugins/cms/index.d.ts +12 -0
- package/plugins/cms/index.js +37 -0
- package/plugins/cms/index.js.map +1 -0
- package/plugins/cms/linkContentReviewToEntry.d.ts +8 -0
- package/plugins/cms/linkContentReviewToEntry.js +108 -0
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -0
- package/plugins/cms/linkWorkflowToEntry.d.ts +8 -0
- package/plugins/cms/linkWorkflowToEntry.js +166 -0
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -0
- package/plugins/cms/triggerContentReview.d.ts +8 -0
- package/plugins/cms/triggerContentReview.js +59 -0
- package/plugins/cms/triggerContentReview.js.map +1 -0
- package/plugins/cms/updateContentReviewStatus.d.ts +10 -0
- package/plugins/cms/updateContentReviewStatus.js +101 -0
- package/plugins/cms/updateContentReviewStatus.js.map +1 -0
- package/plugins/cms/utils.d.ts +27 -0
- package/plugins/cms/utils.js +211 -0
- package/plugins/cms/utils.js.map +1 -0
- package/plugins/context.d.ts +5 -0
- package/plugins/context.js +146 -0
- package/plugins/context.js.map +1 -0
- package/plugins/graphql/changeRequest.gql.d.ts +4 -0
- package/plugins/graphql/changeRequest.gql.js +155 -0
- package/plugins/graphql/changeRequest.gql.js.map +1 -0
- package/plugins/graphql/comment.gql.d.ts +4 -0
- package/plugins/graphql/comment.gql.js +160 -0
- package/plugins/graphql/comment.gql.js.map +1 -0
- package/plugins/graphql/contentReview.gql.d.ts +4 -0
- package/plugins/graphql/contentReview.gql.js +382 -0
- package/plugins/graphql/contentReview.gql.js.map +1 -0
- package/plugins/graphql/reviewer.gql.d.ts +4 -0
- package/plugins/graphql/reviewer.gql.js +114 -0
- package/plugins/graphql/reviewer.gql.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +4 -0
- package/plugins/graphql/workflow.gql.js +205 -0
- package/plugins/graphql/workflow.gql.js.map +1 -0
- package/plugins/graphql.d.ts +4 -0
- package/plugins/graphql.js +95 -0
- package/plugins/graphql.js.map +1 -0
- package/plugins/hooks/createReviewerFromIdentity.d.ts +2 -0
- package/plugins/hooks/createReviewerFromIdentity.js +62 -0
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +2 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +67 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +2 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +59 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -0
- package/plugins/hooks/index.d.ts +3 -0
- package/plugins/hooks/index.js +68 -0
- package/plugins/hooks/index.js.map +1 -0
- package/plugins/hooks/initializeContentReviewSteps.d.ts +2 -0
- package/plugins/hooks/initializeContentReviewSteps.js +89 -0
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -0
- package/plugins/hooks/updatePendingChangeRequests.d.ts +2 -0
- package/plugins/hooks/updatePendingChangeRequests.js +98 -0
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -0
- package/plugins/hooks/updateTotalComments.d.ts +3 -0
- package/plugins/hooks/updateTotalComments.js +157 -0
- package/plugins/hooks/updateTotalComments.js.map +1 -0
- package/plugins/hooks/validateChangeRequest.d.ts +2 -0
- package/plugins/hooks/validateChangeRequest.js +64 -0
- package/plugins/hooks/validateChangeRequest.js.map +1 -0
- package/plugins/hooks/validateComment.d.ts +2 -0
- package/plugins/hooks/validateComment.js +47 -0
- package/plugins/hooks/validateComment.js.map +1 -0
- package/plugins/hooks/validateContentReview.d.ts +2 -0
- package/plugins/hooks/validateContentReview.js +38 -0
- package/plugins/hooks/validateContentReview.js.map +1 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +9 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +51 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +3 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js +30 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +3 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +25 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -0
- package/plugins/pageBuilder/index.d.ts +11 -0
- package/plugins/pageBuilder/index.js +45 -0
- package/plugins/pageBuilder/index.js.map +1 -0
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js +93 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -0
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js +182 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -0
- package/plugins/pageBuilder/triggerContentReview.d.ts +8 -0
- package/plugins/pageBuilder/triggerContentReview.js +50 -0
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -0
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +10 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js +83 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -0
- package/plugins/pageBuilder/utils.d.ts +22 -0
- package/plugins/pageBuilder/utils.js +184 -0
- package/plugins/pageBuilder/utils.js.map +1 -0
- package/plugins/utils.d.ts +35 -0
- package/plugins/utils.js +197 -0
- package/plugins/utils.js.map +1 -0
- package/scheduler/createScheduleActionMethods.d.ts +2 -0
- package/scheduler/createScheduleActionMethods.js +146 -0
- package/scheduler/createScheduleActionMethods.js.map +1 -0
- package/scheduler/handlers/executeAction/index.d.ts +13 -0
- package/scheduler/handlers/executeAction/index.js +172 -0
- package/scheduler/handlers/executeAction/index.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +13 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +17 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +126 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +163 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/security.d.ts +4 -0
- package/scheduler/handlers/executeAction/security.js +68 -0
- package/scheduler/handlers/executeAction/security.js.map +1 -0
- package/scheduler/handlers/scheduleAction/index.d.ts +22 -0
- package/scheduler/handlers/scheduleAction/index.js +165 -0
- package/scheduler/handlers/scheduleAction/index.js.map +1 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +24 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +176 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -0
- package/scheduler/handlers/utils.d.ts +33 -0
- package/scheduler/handlers/utils.js +168 -0
- package/scheduler/handlers/utils.js.map +1 -0
- package/scheduler/index.d.ts +2 -0
- package/scheduler/index.js +27 -0
- package/scheduler/index.js.map +1 -0
- package/scheduler/types.d.ts +171 -0
- package/scheduler/types.js +34 -0
- package/scheduler/types.js.map +1 -0
- package/storageOperations/changeRequestStorageOperations.d.ts +3 -0
- package/storageOperations/changeRequestStorageOperations.js +126 -0
- package/storageOperations/changeRequestStorageOperations.js.map +1 -0
- package/storageOperations/commentStorageOperations.d.ts +3 -0
- package/storageOperations/commentStorageOperations.js +142 -0
- package/storageOperations/commentStorageOperations.js.map +1 -0
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -0
- package/storageOperations/contentReviewStorageOperations.js +97 -0
- package/storageOperations/contentReviewStorageOperations.js.map +1 -0
- package/storageOperations/index.d.ts +15 -0
- package/storageOperations/index.js +52 -0
- package/storageOperations/index.js.map +1 -0
- package/storageOperations/models/changeRequest.model.d.ts +3 -0
- package/storageOperations/models/changeRequest.model.js +59 -0
- package/storageOperations/models/changeRequest.model.js.map +1 -0
- package/storageOperations/models/comment.model.d.ts +7 -0
- package/storageOperations/models/comment.model.js +60 -0
- package/storageOperations/models/comment.model.js.map +1 -0
- package/storageOperations/models/contentModelPluginFactory.d.ts +15 -0
- package/storageOperations/models/contentModelPluginFactory.js +32 -0
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -0
- package/storageOperations/models/contentReview.model.d.ts +7 -0
- package/storageOperations/models/contentReview.model.js +257 -0
- package/storageOperations/models/contentReview.model.js.map +1 -0
- package/storageOperations/models/index.d.ts +2 -0
- package/storageOperations/models/index.js +115 -0
- package/storageOperations/models/index.js.map +1 -0
- package/storageOperations/models/reviewer.model.d.ts +3 -0
- package/storageOperations/models/reviewer.model.js +55 -0
- package/storageOperations/models/reviewer.model.js.map +1 -0
- package/storageOperations/models/utils.d.ts +3 -0
- package/storageOperations/models/utils.js +36 -0
- package/storageOperations/models/utils.js.map +1 -0
- package/storageOperations/models/workflow.model.d.ts +12 -0
- package/storageOperations/models/workflow.model.js +208 -0
- package/storageOperations/models/workflow.model.js.map +1 -0
- package/storageOperations/reviewerStorageOperations.d.ts +3 -0
- package/storageOperations/reviewerStorageOperations.js +93 -0
- package/storageOperations/reviewerStorageOperations.js.map +1 -0
- package/storageOperations/types.d.ts +34 -0
- package/storageOperations/types.js +5 -0
- package/storageOperations/types.js.map +1 -0
- package/storageOperations/workflowStorageOperations.d.ts +3 -0
- package/storageOperations/workflowStorageOperations.js +115 -0
- package/storageOperations/workflowStorageOperations.js.map +1 -0
- package/types.d.ts +737 -0
- package/types.js +69 -0
- package/types.js.map +1 -0
- package/utils/contentApwSettingsPlugin.d.ts +9 -0
- package/utils/contentApwSettingsPlugin.js +26 -0
- package/utils/contentApwSettingsPlugin.js.map +1 -0
- package/utils/errors.d.ts +16 -0
- package/utils/errors.js +75 -0
- package/utils/errors.js.map +1 -0
- package/utils/fieldResolver.d.ts +16 -0
- package/utils/fieldResolver.js +60 -0
- package/utils/fieldResolver.js.map +1 -0
- package/utils/resolve.d.ts +3 -0
- package/utils/resolve.js +18 -0
- package/utils/resolve.js.map +1 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Plugin } from "@webiny/plugins/Plugin";
|
2
|
+
import { ApwContentTypes } from "./types";
|
3
|
+
export declare abstract class ContentApwSettingsPlugin extends Plugin {
|
4
|
+
static type: string;
|
5
|
+
abstract canUse(type: ApwContentTypes): boolean;
|
6
|
+
abstract setWorkflowId(content: any, id: string | null): void;
|
7
|
+
abstract getWorkflowId(content: any): string | null;
|
8
|
+
abstract setContentReviewId(content: any, id: string | null): void;
|
9
|
+
abstract getContentReviewId(content: any): string | null;
|
10
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.ContentApwSettingsPlugin = void 0;
|
9
|
+
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
+
|
12
|
+
var _Plugin = require("@webiny/plugins/Plugin");
|
13
|
+
|
14
|
+
class ContentApwSettingsPlugin extends _Plugin.Plugin {}
|
15
|
+
|
16
|
+
exports.ContentApwSettingsPlugin = ContentApwSettingsPlugin;
|
17
|
+
(0, _defineProperty2.default)(ContentApwSettingsPlugin, "type", "apw.contentApwSettings");
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ContentApwSettingsPlugin","Plugin"],"sources":["ContentApwSettingsPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAGO,MAAeA,wBAAf,SAAgDC,cAAhD,CAAuD;;;8BAAxCD,wB,UACY,wB"}
|
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Webiny
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# @webiny/api-awp
|
2
|
+
|
3
|
+
[](https://www.npmjs.com/package/@webiny/api-awp)
|
4
|
+
[](https://www.npmjs.com/package/@webiny/api-awp)
|
5
|
+
[](https://github.com/prettier/prettier)
|
6
|
+
[](http://makeapullrequest.com)
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
```
|
11
|
+
npm install --save @webiny/api-awp
|
12
|
+
```
|
13
|
+
|
14
|
+
Or if you prefer yarn:
|
15
|
+
|
16
|
+
```
|
17
|
+
yarn add @webiny/api-awp
|
18
|
+
```
|
19
|
+
|
20
|
+
## Testing
|
21
|
+
|
22
|
+
To run tests api-apw tests with targeted storage operations loaded use:
|
23
|
+
|
24
|
+
#### DynamoDB
|
25
|
+
|
26
|
+
```
|
27
|
+
yarn test packages/api-apw --keyword=apw:ddb --keyword=apw:base
|
28
|
+
```
|
29
|
+
|
30
|
+
#### Note
|
31
|
+
|
32
|
+
> All the tests in `@webiny/api-apw` package are being tested against ddb-only storage operations because
|
33
|
+
current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
|
34
|
+
We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
|
@@ -0,0 +1,95 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createChangeRequestMethods = createChangeRequestMethods;
|
7
|
+
|
8
|
+
var _pubsub = require("@webiny/pubsub");
|
9
|
+
|
10
|
+
function createChangeRequestMethods({
|
11
|
+
storageOperations
|
12
|
+
}) {
|
13
|
+
const onBeforeChangeRequestCreate = (0, _pubsub.createTopic)();
|
14
|
+
const onAfterChangeRequestCreate = (0, _pubsub.createTopic)();
|
15
|
+
const onBeforeChangeRequestUpdate = (0, _pubsub.createTopic)();
|
16
|
+
const onAfterChangeRequestUpdate = (0, _pubsub.createTopic)();
|
17
|
+
const onBeforeChangeRequestDelete = (0, _pubsub.createTopic)();
|
18
|
+
const onAfterChangeRequestDelete = (0, _pubsub.createTopic)();
|
19
|
+
return {
|
20
|
+
async get(id) {
|
21
|
+
return storageOperations.getChangeRequest({
|
22
|
+
id
|
23
|
+
});
|
24
|
+
},
|
25
|
+
|
26
|
+
async list(params) {
|
27
|
+
return storageOperations.listChangeRequests(params);
|
28
|
+
},
|
29
|
+
|
30
|
+
async create(data) {
|
31
|
+
await onBeforeChangeRequestCreate.publish({
|
32
|
+
input: data
|
33
|
+
});
|
34
|
+
const changeRequest = await storageOperations.createChangeRequest({
|
35
|
+
data
|
36
|
+
});
|
37
|
+
await onAfterChangeRequestCreate.publish({
|
38
|
+
changeRequest
|
39
|
+
});
|
40
|
+
return changeRequest;
|
41
|
+
},
|
42
|
+
|
43
|
+
async update(id, data) {
|
44
|
+
const original = await storageOperations.getChangeRequest({
|
45
|
+
id
|
46
|
+
});
|
47
|
+
await onBeforeChangeRequestUpdate.publish({
|
48
|
+
original,
|
49
|
+
input: {
|
50
|
+
id,
|
51
|
+
data
|
52
|
+
}
|
53
|
+
});
|
54
|
+
const changeRequest = await storageOperations.updateChangeRequest({
|
55
|
+
id,
|
56
|
+
data
|
57
|
+
});
|
58
|
+
await onAfterChangeRequestUpdate.publish({
|
59
|
+
original,
|
60
|
+
input: {
|
61
|
+
id,
|
62
|
+
data
|
63
|
+
},
|
64
|
+
changeRequest
|
65
|
+
});
|
66
|
+
return changeRequest;
|
67
|
+
},
|
68
|
+
|
69
|
+
async delete(id) {
|
70
|
+
const changeRequest = await storageOperations.getChangeRequest({
|
71
|
+
id
|
72
|
+
});
|
73
|
+
await onBeforeChangeRequestDelete.publish({
|
74
|
+
changeRequest
|
75
|
+
});
|
76
|
+
await storageOperations.deleteChangeRequest({
|
77
|
+
id
|
78
|
+
});
|
79
|
+
await onAfterChangeRequestDelete.publish({
|
80
|
+
changeRequest
|
81
|
+
});
|
82
|
+
return true;
|
83
|
+
},
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Lifecycle events
|
87
|
+
*/
|
88
|
+
onBeforeChangeRequestCreate,
|
89
|
+
onAfterChangeRequestCreate,
|
90
|
+
onBeforeChangeRequestUpdate,
|
91
|
+
onAfterChangeRequestUpdate,
|
92
|
+
onBeforeChangeRequestDelete,
|
93
|
+
onAfterChangeRequestDelete
|
94
|
+
};
|
95
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createChangeRequestMethods","storageOperations","onBeforeChangeRequestCreate","createTopic","onAfterChangeRequestCreate","onBeforeChangeRequestUpdate","onAfterChangeRequestUpdate","onBeforeChangeRequestDelete","onAfterChangeRequestDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnAfterChangeRequestCreateTopicParams,\n OnAfterChangeRequestDeleteTopicParams,\n OnAfterChangeRequestUpdateTopicParams,\n OnBeforeChangeRequestCreateTopicParams,\n OnBeforeChangeRequestDeleteTopicParams,\n OnBeforeChangeRequestUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n const onBeforeChangeRequestCreate = createTopic<OnBeforeChangeRequestCreateTopicParams>();\n const onAfterChangeRequestCreate = createTopic<OnAfterChangeRequestCreateTopicParams>();\n const onBeforeChangeRequestUpdate = createTopic<OnBeforeChangeRequestUpdateTopicParams>();\n const onAfterChangeRequestUpdate = createTopic<OnAfterChangeRequestUpdateTopicParams>();\n const onBeforeChangeRequestDelete = createTopic<OnBeforeChangeRequestDeleteTopicParams>();\n const onAfterChangeRequestDelete = createTopic<OnAfterChangeRequestDeleteTopicParams>();\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onBeforeChangeRequestCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onAfterChangeRequestCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onBeforeChangeRequestUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onAfterChangeRequestUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onBeforeChangeRequestDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onAfterChangeRequestDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onBeforeChangeRequestCreate,\n onAfterChangeRequestCreate,\n onBeforeChangeRequestUpdate,\n onAfterChangeRequestUpdate,\n onBeforeChangeRequestDelete,\n onAfterChangeRequestDelete\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAYO,SAASA,0BAAT,CAAoC;EACvCC;AADuC,CAApC,EAEmC;EACtC,MAAMC,2BAA2B,GAAG,IAAAC,mBAAA,GAApC;EACA,MAAMC,0BAA0B,GAAG,IAAAD,mBAAA,GAAnC;EACA,MAAME,2BAA2B,GAAG,IAAAF,mBAAA,GAApC;EACA,MAAMG,0BAA0B,GAAG,IAAAH,mBAAA,GAAnC;EACA,MAAMI,2BAA2B,GAAG,IAAAJ,mBAAA,GAApC;EACA,MAAMK,0BAA0B,GAAG,IAAAL,mBAAA,GAAnC;EAEA,OAAO;IACH,MAAMM,GAAN,CAAUC,EAAV,EAAc;MACV,OAAOT,iBAAiB,CAACU,gBAAlB,CAAmC;QAAED;MAAF,CAAnC,CAAP;IACH,CAHE;;IAIH,MAAME,IAAN,CAAWC,MAAX,EAAmB;MACf,OAAOZ,iBAAiB,CAACa,kBAAlB,CAAqCD,MAArC,CAAP;IACH,CANE;;IAOH,MAAME,MAAN,CAAaC,IAAb,EAAmB;MACf,MAAMd,2BAA2B,CAACe,OAA5B,CAAoC;QAAEC,KAAK,EAAEF;MAAT,CAApC,CAAN;MAEA,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACmB,mBA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+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createCommentMethods = createCommentMethods;
|
7
|
+
|
8
|
+
var _pubsub = require("@webiny/pubsub");
|
9
|
+
|
10
|
+
function createCommentMethods({
|
11
|
+
storageOperations
|
12
|
+
}) {
|
13
|
+
const onBeforeCommentCreate = (0, _pubsub.createTopic)();
|
14
|
+
const onAfterCommentCreate = (0, _pubsub.createTopic)();
|
15
|
+
const onBeforeCommentUpdate = (0, _pubsub.createTopic)();
|
16
|
+
const onAfterCommentUpdate = (0, _pubsub.createTopic)();
|
17
|
+
const onBeforeCommentDelete = (0, _pubsub.createTopic)();
|
18
|
+
const onAfterCommentDelete = (0, _pubsub.createTopic)();
|
19
|
+
return {
|
20
|
+
/**
|
21
|
+
* Lifecycle events
|
22
|
+
*/
|
23
|
+
onBeforeCommentCreate,
|
24
|
+
onAfterCommentCreate,
|
25
|
+
onBeforeCommentUpdate,
|
26
|
+
onAfterCommentUpdate,
|
27
|
+
onBeforeCommentDelete,
|
28
|
+
onAfterCommentDelete,
|
29
|
+
|
30
|
+
async get(id) {
|
31
|
+
return storageOperations.getComment({
|
32
|
+
id
|
33
|
+
});
|
34
|
+
},
|
35
|
+
|
36
|
+
async list(params) {
|
37
|
+
return storageOperations.listComments(params);
|
38
|
+
},
|
39
|
+
|
40
|
+
async create(data) {
|
41
|
+
await onBeforeCommentCreate.publish({
|
42
|
+
input: data
|
43
|
+
});
|
44
|
+
const comment = await storageOperations.createComment({
|
45
|
+
data
|
46
|
+
});
|
47
|
+
await onAfterCommentCreate.publish({
|
48
|
+
comment
|
49
|
+
});
|
50
|
+
return comment;
|
51
|
+
},
|
52
|
+
|
53
|
+
async update(id, data) {
|
54
|
+
const original = await storageOperations.getComment({
|
55
|
+
id
|
56
|
+
});
|
57
|
+
await onBeforeCommentUpdate.publish({
|
58
|
+
original,
|
59
|
+
input: {
|
60
|
+
id,
|
61
|
+
data
|
62
|
+
}
|
63
|
+
});
|
64
|
+
const comment = await storageOperations.updateComment({
|
65
|
+
id,
|
66
|
+
data
|
67
|
+
});
|
68
|
+
await onAfterCommentUpdate.publish({
|
69
|
+
original,
|
70
|
+
comment,
|
71
|
+
input: {
|
72
|
+
id,
|
73
|
+
data
|
74
|
+
}
|
75
|
+
});
|
76
|
+
return comment;
|
77
|
+
},
|
78
|
+
|
79
|
+
async delete(id) {
|
80
|
+
const comment = await storageOperations.getComment({
|
81
|
+
id
|
82
|
+
});
|
83
|
+
await onBeforeCommentDelete.publish({
|
84
|
+
comment
|
85
|
+
});
|
86
|
+
await storageOperations.deleteComment({
|
87
|
+
id
|
88
|
+
});
|
89
|
+
await onAfterCommentDelete.publish({
|
90
|
+
comment
|
91
|
+
});
|
92
|
+
return true;
|
93
|
+
}
|
94
|
+
|
95
|
+
};
|
96
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createCommentMethods","storageOperations","onBeforeCommentCreate","createTopic","onAfterCommentCreate","onBeforeCommentUpdate","onAfterCommentUpdate","onBeforeCommentDelete","onAfterCommentDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwCommentCrud,\n CreateApwParams,\n OnBeforeCommentCreateTopicParams,\n OnAfterCommentCreateTopicParams,\n OnBeforeCommentUpdateTopicParams,\n OnAfterCommentUpdateTopicParams,\n OnBeforeCommentDeleteTopicParams,\n OnAfterCommentDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n const onBeforeCommentCreate = createTopic<OnBeforeCommentCreateTopicParams>();\n const onAfterCommentCreate = createTopic<OnAfterCommentCreateTopicParams>();\n const onBeforeCommentUpdate = createTopic<OnBeforeCommentUpdateTopicParams>();\n const onAfterCommentUpdate = createTopic<OnAfterCommentUpdateTopicParams>();\n const onBeforeCommentDelete = createTopic<OnBeforeCommentDeleteTopicParams>();\n const onAfterCommentDelete = createTopic<OnAfterCommentDeleteTopicParams>();\n\n return {\n /**\n * Lifecycle events\n */\n onBeforeCommentCreate,\n onAfterCommentCreate,\n onBeforeCommentUpdate,\n onAfterCommentUpdate,\n onBeforeCommentDelete,\n onAfterCommentDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onBeforeCommentCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onAfterCommentCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onBeforeCommentUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onAfterCommentUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onBeforeCommentDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onAfterCommentDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAYO,SAASA,oBAAT,CAA8B;EAAEC;AAAF,CAA9B,EAAsF;EACzF,MAAMC,qBAAqB,GAAG,IAAAC,mBAAA,GAA9B;EACA,MAAMC,oBAAoB,GAAG,IAAAD,mBAAA,GAA7B;EACA,MAAME,qBAAqB,GAAG,IAAAF,mBAAA,GAA9B;EACA,MAAMG,oBAAoB,GAAG,IAAAH,mBAAA,GAA7B;EACA,MAAMI,qBAAqB,GAAG,IAAAJ,mBAAA,GAA9B;EACA,MAAMK,oBAAoB,GAAG,IAAAL,mBAAA,GAA7B;EAEA,OAAO;IACH;AACR;AACA;IACQD,qBAJG;IAKHE,oBALG;IAMHC,qBANG;IAOHC,oBAPG;IAQHC,qBARG;IASHC,oBATG;;IAUH,MAAMC,GAAN,CAAUC,EAAV,EAAc;MACV,OAAOT,iBAAiB,CAACU,UAAlB,CAA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,CAAgC;QAAEf;MAAF,CAAhC,CAAN;MAEA,MAAMF,oBAAoB,CAACS,OAArB,CAA6B;QAAEE;MAAF,CAA7B,CAAN;MAEA,OAAO,IAAP;IACH;;EA/CE,CAAP;AAiDH"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { AdvancedPublishingWorkflow, ApwContentReviewCrud, ApwReviewerCrud, CreateApwParams } from "../types";
|
2
|
+
import { PluginsContainer } from "@webiny/plugins";
|
3
|
+
export interface CreateContentReviewMethodsParams extends CreateApwParams {
|
4
|
+
getReviewer: ApwReviewerCrud["get"];
|
5
|
+
getContentGetter: AdvancedPublishingWorkflow["getContentGetter"];
|
6
|
+
getContentPublisher: AdvancedPublishingWorkflow["getContentPublisher"];
|
7
|
+
getContentUnPublisher: AdvancedPublishingWorkflow["getContentUnPublisher"];
|
8
|
+
plugins: PluginsContainer;
|
9
|
+
}
|
10
|
+
export declare function createContentReviewMethods(params: CreateContentReviewMethodsParams): ApwContentReviewCrud;
|