@webiny/api-apw 0.0.0-unstable.b02d94bba0 → 0.0.0-unstable.c2780f51fe
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/package.json +31 -31
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +3 -8
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +3 -8
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +3 -8
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +15 -14
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +20 -20
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +23 -23
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js +20 -20
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +3 -6
- package/storageOperations/models/contentModelPluginFactory.js +4 -3
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -1
- package/storageOperations/models/index.js +0 -2
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +23 -28
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js +20 -20
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +3 -4
- package/types.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@webiny/api-apw",
|
3
|
-
"version": "0.0.0-unstable.
|
3
|
+
"version": "0.0.0-unstable.c2780f51fe",
|
4
4
|
"keywords": [
|
5
5
|
"apw:base"
|
6
6
|
],
|
@@ -17,27 +17,27 @@
|
|
17
17
|
"@aws-sdk/client-cloudwatch-events": "3.54.1",
|
18
18
|
"@babel/runtime": "7.20.13",
|
19
19
|
"@commodo/fields": "1.1.2-beta.20",
|
20
|
-
"@webiny/api": "0.0.0-unstable.
|
21
|
-
"@webiny/api-admin-settings": "0.0.0-unstable.
|
22
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
23
|
-
"@webiny/api-i18n": "0.0.0-unstable.
|
24
|
-
"@webiny/api-i18n-ddb": "0.0.0-unstable.
|
25
|
-
"@webiny/api-mailer": "0.0.0-unstable.
|
26
|
-
"@webiny/api-page-builder": "0.0.0-unstable.
|
27
|
-
"@webiny/api-security": "0.0.0-unstable.
|
28
|
-
"@webiny/api-tenancy": "0.0.0-unstable.
|
29
|
-
"@webiny/api-wcp": "0.0.0-unstable.
|
30
|
-
"@webiny/db-dynamodb": "0.0.0-unstable.
|
31
|
-
"@webiny/error": "0.0.0-unstable.
|
32
|
-
"@webiny/handler": "0.0.0-unstable.
|
33
|
-
"@webiny/handler-client": "0.0.0-unstable.
|
34
|
-
"@webiny/handler-db": "0.0.0-unstable.
|
35
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
36
|
-
"@webiny/handler-logs": "0.0.0-unstable.
|
37
|
-
"@webiny/plugins": "0.0.0-unstable.
|
38
|
-
"@webiny/pubsub": "0.0.0-unstable.
|
39
|
-
"@webiny/utils": "0.0.0-unstable.
|
40
|
-
"@webiny/validation": "0.0.0-unstable.
|
20
|
+
"@webiny/api": "0.0.0-unstable.c2780f51fe",
|
21
|
+
"@webiny/api-admin-settings": "0.0.0-unstable.c2780f51fe",
|
22
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.c2780f51fe",
|
23
|
+
"@webiny/api-i18n": "0.0.0-unstable.c2780f51fe",
|
24
|
+
"@webiny/api-i18n-ddb": "0.0.0-unstable.c2780f51fe",
|
25
|
+
"@webiny/api-mailer": "0.0.0-unstable.c2780f51fe",
|
26
|
+
"@webiny/api-page-builder": "0.0.0-unstable.c2780f51fe",
|
27
|
+
"@webiny/api-security": "0.0.0-unstable.c2780f51fe",
|
28
|
+
"@webiny/api-tenancy": "0.0.0-unstable.c2780f51fe",
|
29
|
+
"@webiny/api-wcp": "0.0.0-unstable.c2780f51fe",
|
30
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.c2780f51fe",
|
31
|
+
"@webiny/error": "0.0.0-unstable.c2780f51fe",
|
32
|
+
"@webiny/handler": "0.0.0-unstable.c2780f51fe",
|
33
|
+
"@webiny/handler-client": "0.0.0-unstable.c2780f51fe",
|
34
|
+
"@webiny/handler-db": "0.0.0-unstable.c2780f51fe",
|
35
|
+
"@webiny/handler-graphql": "0.0.0-unstable.c2780f51fe",
|
36
|
+
"@webiny/handler-logs": "0.0.0-unstable.c2780f51fe",
|
37
|
+
"@webiny/plugins": "0.0.0-unstable.c2780f51fe",
|
38
|
+
"@webiny/pubsub": "0.0.0-unstable.c2780f51fe",
|
39
|
+
"@webiny/utils": "0.0.0-unstable.c2780f51fe",
|
40
|
+
"@webiny/validation": "0.0.0-unstable.c2780f51fe",
|
41
41
|
"dayjs": "1.11.7",
|
42
42
|
"lodash": "4.17.21",
|
43
43
|
"mdbid": "1.0.0"
|
@@ -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": "^0.0.0-unstable.
|
50
|
-
"@webiny/api-page-builder-so-ddb": "^0.0.0-unstable.
|
51
|
-
"@webiny/api-security-so-ddb": "^0.0.0-unstable.
|
52
|
-
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.
|
53
|
-
"@webiny/cli": "^0.0.0-unstable.
|
54
|
-
"@webiny/handler-aws": "^0.0.0-unstable.
|
55
|
-
"@webiny/project-utils": "^0.0.0-unstable.
|
56
|
-
"@webiny/wcp": "^0.0.0-unstable.
|
49
|
+
"@webiny/api-headless-cms-ddb": "^0.0.0-unstable.c2780f51fe",
|
50
|
+
"@webiny/api-page-builder-so-ddb": "^0.0.0-unstable.c2780f51fe",
|
51
|
+
"@webiny/api-security-so-ddb": "^0.0.0-unstable.c2780f51fe",
|
52
|
+
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.c2780f51fe",
|
53
|
+
"@webiny/cli": "^0.0.0-unstable.c2780f51fe",
|
54
|
+
"@webiny/handler-aws": "^0.0.0-unstable.c2780f51fe",
|
55
|
+
"@webiny/project-utils": "^0.0.0-unstable.c2780f51fe",
|
56
|
+
"@webiny/wcp": "^0.0.0-unstable.c2780f51fe",
|
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": "c2780f51fe628e1ef0f6b55c2bce9b74d3470d79"
|
76
76
|
}
|
@@ -103,14 +103,9 @@ const attachChangeRequestAfterCreate = context => {
|
|
103
103
|
});
|
104
104
|
}
|
105
105
|
};
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
} catch (ex) {
|
110
|
-
throw ex;
|
111
|
-
} finally {
|
112
|
-
context.security.enableAuthorization();
|
113
|
-
}
|
106
|
+
await context.security.withoutAuthorization(async () => {
|
107
|
+
return execute();
|
108
|
+
});
|
114
109
|
});
|
115
110
|
};
|
116
111
|
exports.attachChangeRequestAfterCreate = attachChangeRequestAfterCreate;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["attachChangeRequestAfterCreate","context","apw","changeRequest","onChangeRequestAfterCreate","subscribe","execute","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","WebinyError","settings","getAppUrl","changeRequestUrl","createChangeRequestUrl","baseUrl","appUrl","changeRequestId","contentReview","get","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendChangeRequestNotification","ex","error","message","code","data","stack","security","
|
1
|
+
{"version":3,"names":["attachChangeRequestAfterCreate","context","apw","changeRequest","onChangeRequestAfterCreate","subscribe","execute","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","WebinyError","settings","getAppUrl","changeRequestUrl","createChangeRequestUrl","baseUrl","appUrl","changeRequestId","contentReview","get","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendChangeRequestNotification","ex","error","message","code","data","stack","security","withoutAuthorization"],"sources":["changeRequestAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { sendChangeRequestNotification } from \"./sendChangeRequestNotification\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { createChangeRequestUrl } from \"./changeRequestUrl\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachChangeRequestAfterCreate = (context: ApwContext): void => {\n context.apw.changeRequest.onChangeRequestAfterCreate.subscribe(async ({ changeRequest }) => {\n const execute = async () => {\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const changeRequestUrl = createChangeRequestUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!changeRequestUrl) {\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [changeRequest.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendChangeRequestNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n changeRequestUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send change request notifications.`,\n \"CHANGE_REQUEST_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n changeRequestUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,8BAA8B,GAAIC,OAAmB,IAAW;EACzEA,OAAO,CAACC,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IACxF,MAAMG,OAAO,GAAG,YAAY;MACxB,MAAM;QAAEC,EAAE,EAAEC,eAAe;QAAEC;MAAO,CAAC,GAAG,IAAAC,oCAA6B,EACjEP,aAAa,CAACQ,IAAI,CACrB;MACD,IAAI,CAACF,MAAM,EAAE;QACT,MAAM,IAAIG,cAAW,CAAC,qCAAqC,EAAE,iBAAiB,EAAE;UAC5ED,IAAI,EAAER,aAAa,CAACQ;QACxB,CAAC,CAAC;MACN;MAEA,MAAME,QAA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oB,SAAS,CAACI,MAAM,KAAK,CAAC,EAAE;QACxB;MACJ;MAEA,IAAI;QACA,MAAM,IAAAC,4DAA6B,EAAC;UAChC/B,OAAO;UACP0B,SAAS;UACTxB,aAAa;UACbiB,aAAa;UACbE,QAAQ;UACRP,gBAAgB;UAChBS;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOS,EAAE,EAAE;QACT,MAAM,IAAIrB,cAAW,CAChB,8CAA6C,EAC9C,uCAAuC,EACvC;UACIW,UAAU,EAAED,QAAQ,CAACf,EAAE;UACvBY,eAAe,EAAEhB,aAAa,CAACI,EAAE;UACjCC,eAAe;UACfO,gBAAgB;UAChBS,UAAU;UACVU,KAAK,EAAE;YACHC,OAAO,EAAEF,EAAE,CAACE,OAAO;YACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;YACbC,IAAI,EAAEJ,EAAE,CAACI,IAAI;YACbC,KAAK,EAAEL,EAAE,CAACK;UACd;QACJ,CAAC,CACJ;MACL;IACJ,CAAC;IAED,MAAMrC,OAAO,CAACsC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOlC,OAAO,EAAE;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -114,14 +114,9 @@ const attachCommentAfterCreate = context => {
|
|
114
114
|
});
|
115
115
|
}
|
116
116
|
};
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
} catch (ex) {
|
121
|
-
throw ex;
|
122
|
-
} finally {
|
123
|
-
context.security.enableAuthorization();
|
124
|
-
}
|
117
|
+
await context.security.withoutAuthorization(async () => {
|
118
|
+
return execute();
|
119
|
+
});
|
125
120
|
});
|
126
121
|
};
|
127
122
|
exports.attachCommentAfterCreate = attachCommentAfterCreate;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["attachCommentAfterCreate","context","apw","comment","onCommentAfterCreate","subscribe","execute","changeRequest","get","WebinyError","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","settings","getAppUrl","commentUrl","createCommentUrl","baseUrl","appUrl","changeRequestId","console","log","contentReview","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendCommentNotification","ex","commentId","error","message","code","data","stack","security","
|
1
|
+
{"version":3,"names":["attachCommentAfterCreate","context","apw","comment","onCommentAfterCreate","subscribe","execute","changeRequest","get","WebinyError","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","settings","getAppUrl","commentUrl","createCommentUrl","baseUrl","appUrl","changeRequestId","console","log","contentReview","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendCommentNotification","ex","commentId","error","message","code","data","stack","security","withoutAuthorization"],"sources":["commentAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { createCommentUrl } from \"./commentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendCommentNotification } from \"./sendCommentNotification\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachCommentAfterCreate = (context: ApwContext): void => {\n context.apw.comment.onCommentAfterCreate.subscribe(async ({ comment }) => {\n const execute = async () => {\n const changeRequest = await context.apw.changeRequest.get(comment.changeRequest);\n if (!changeRequest) {\n throw new WebinyError(\"Missing change request.\", \"CHANGE_REQUEST_NOT_FOUND\", {\n changeRequest: comment.changeRequest,\n comment: comment.id\n });\n }\n\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const commentUrl = createCommentUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!commentUrl) {\n console.log(\"No comment url.\");\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n console.log(\"No content url.\");\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [comment.createdBy.id]\n });\n\n if (reviewers.length === 0) {\n console.log(\"No reviewers to send the e-mail notification to.\");\n return;\n }\n\n try {\n await sendCommentNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n commentUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send comment notifications.`,\n \"COMMENT_NOTIFICATIONS_NOT_SENT\",\n {\n commentId: comment.id,\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n commentUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,wBAAwB,GAAIC,OAAmB,IAAW;EACnEA,OAAO,CAACC,GAAG,CAACC,OAAO,CAACC,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAQ,CAAC,KAAK;IACtE,MAAMG,OAAO,GAAG,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J,EAAE,CAACI,IAAI;YACbC,IAAI,EAAEL,EAAE,CAACK,IAAI;YACbC,KAAK,EAAEN,EAAE,CAACM;UACd;QACJ,CAAC,CACJ;MACL;IACJ,CAAC;IAED,MAAMzC,OAAO,CAAC0C,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOtC,OAAO,EAAE;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -86,14 +86,9 @@ const attachContentReviewAfterCreate = context => {
|
|
86
86
|
});
|
87
87
|
}
|
88
88
|
};
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
} catch (ex) {
|
93
|
-
throw ex;
|
94
|
-
} finally {
|
95
|
-
context.security.enableAuthorization();
|
96
|
-
}
|
89
|
+
await context.security.withoutAuthorization(async () => {
|
90
|
+
return execute();
|
91
|
+
});
|
97
92
|
});
|
98
93
|
};
|
99
94
|
exports.attachContentReviewAfterCreate = attachContentReviewAfterCreate;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["attachContentReviewAfterCreate","context","apw","contentReview","onContentReviewAfterCreate","subscribe","execute","steps","length","step","id","settings","getAppUrl","contentReviewUrl","createContentReviewUrl","baseUrl","appUrl","contentReviewId","stepId","workflow","get","workflowId","WebinyError","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","sendContentReviewNotification","ex","error","message","code","data","stack","security","
|
1
|
+
{"version":3,"names":["attachContentReviewAfterCreate","context","apw","contentReview","onContentReviewAfterCreate","subscribe","execute","steps","length","step","id","settings","getAppUrl","contentReviewUrl","createContentReviewUrl","baseUrl","appUrl","contentReviewId","stepId","workflow","get","workflowId","WebinyError","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","sendContentReviewNotification","ex","error","message","code","data","stack","security","withoutAuthorization"],"sources":["contentReviewAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { getAppUrl } from \"./appUrl\";\nimport { createContentReviewUrl } from \"./contentReviewUrl\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendContentReviewNotification } from \"./sendContentReviewNotification\";\n\nexport const attachContentReviewAfterCreate = (context: ApwContext): void => {\n context.apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const execute = async () => {\n if (contentReview.steps.length === 0) {\n return;\n }\n const [step] = contentReview.steps;\n if (!step?.id) {\n return;\n }\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n\n const contentReviewUrl = createContentReviewUrl({\n baseUrl: settings.appUrl,\n contentReviewId: contentReview.id,\n stepId: step.id\n });\n if (!contentReviewUrl) {\n return;\n }\n\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with Id \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [contentReview.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendContentReviewNotification({\n context,\n reviewers,\n contentReview,\n workflow,\n contentReviewUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send content review notifications.`,\n \"CONTENT_REVIEW_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n contentReviewId: contentReview.id,\n contentReviewUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEO,MAAMA,8BAA8B,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AAC,yBAAc,EAAC;QACnC1B,OAAO;QACPkB,QAAQ;QACRS,OAAO,EAAE,CAACzB,aAAa,CAAC0B,SAAS,CAACnB,EAAE;MACxC,CAAC,CAAC;MACF,IAAIgB,SAAS,CAAClB,MAAM,KAAK,CAAC,EAAE;QACxB;MACJ;MAEA,IAAI;QACA,MAAM,IAAAsB,4DAA6B,EAAC;UAChC7B,OAAO;UACPyB,SAAS;UACTvB,aAAa;UACbgB,QAAQ;UACRN,gBAAgB;UAChBU;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOQ,EAAE,EAAE;QACT,MAAM,IAAIT,cAAW,CAChB,8CAA6C,EAC9C,uCAAuC,EACvC;UACID,UAAU,EAAEF,QAAQ,CAACT,EAAE;UACvBO,eAAe,EAAEd,aAAa,CAACO,EAAE;UACjCG,gBAAgB;UAChBU,UAAU;UACVS,KAAK,EAAE;YACHC,OAAO,EAAEF,EAAE,CAACE,OAAO;YACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;YACbC,IAAI,EAAEJ,EAAE,CAACI,IAAI;YACbC,KAAK,EAAEL,EAAE,CAACK;UACd;QACJ,CAAC,CACJ;MACL;IACJ,CAAC;IAED,MAAMnC,OAAO,CAACoC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOhC,OAAO,EAAE;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -25,20 +25,21 @@ const fetchReviewers = async params => {
|
|
25
25
|
exclude
|
26
26
|
} = params;
|
27
27
|
const idList = getReviewerIdList(workflow);
|
28
|
-
context.security.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
28
|
+
return context.security.withoutAuthorization(async () => {
|
29
|
+
const [reviewers] = await context.apw.reviewer.list({
|
30
|
+
where: {
|
31
|
+
id_in: idList
|
32
|
+
},
|
33
|
+
limit: 10000
|
34
|
+
});
|
35
|
+
return reviewers.filter(item => {
|
36
|
+
if (!item.email) {
|
37
|
+
return false;
|
38
|
+
} else if (exclude.includes(item.identityId)) {
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
return true;
|
42
|
+
});
|
42
43
|
});
|
43
44
|
};
|
44
45
|
exports.fetchReviewers = fetchReviewers;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getReviewerIdList","steps","reduce","collection","step","reviewer","reviewers","includes","id","push","fetchReviewers","params","context","workflow","exclude","idList","security","
|
1
|
+
{"version":3,"names":["getReviewerIdList","steps","reduce","collection","step","reviewer","reviewers","includes","id","push","fetchReviewers","params","context","workflow","exclude","idList","security","withoutAuthorization","apw","list","where","id_in","limit","filter","item","email","identityId"],"sources":["reviewers.ts"],"sourcesContent":["import { ApwContext, ApwReviewerWithEmail, ApwWorkflow, ApwWorkflowStep } from \"~/types\";\n\ninterface GetReviewerIdListParams {\n steps: ApwWorkflowStep[];\n}\n\ninterface GetReviewerIdList {\n (params: GetReviewerIdListParams): string[];\n}\n\nexport const getReviewerIdList: GetReviewerIdList = ({ steps }) => {\n return steps.reduce<string[]>((collection, step) => {\n for (const reviewer of step.reviewers) {\n if (collection.includes(reviewer.id)) {\n return collection;\n }\n collection.push(reviewer.id);\n }\n\n return collection;\n }, []);\n};\n\ninterface FetchReviewersParams {\n context: ApwContext;\n workflow: ApwWorkflow;\n exclude: string[];\n}\n\nexport const fetchReviewers = async (\n params: FetchReviewersParams\n): Promise<ApwReviewerWithEmail[]> => {\n const { context, workflow, exclude } = params;\n\n const idList = getReviewerIdList(workflow);\n\n return context.security.withoutAuthorization(async () => {\n const [reviewers] = await context.apw.reviewer.list({\n where: {\n id_in: idList\n },\n limit: 10000\n });\n return reviewers.filter((item): item is ApwReviewerWithEmail => {\n if (!item.email) {\n return false;\n } else if (exclude.includes(item.identityId)) {\n return false;\n }\n\n return true;\n });\n });\n};\n"],"mappings":";;;;;;AAUO,MAAMA,iBAAoC,GAAG,CAAC;EAAEC;AAAM,CAAC,KAAK;EAC/D,OAAOA,KAAK,CAACC,MAAM,CAAW,CAACC,UAAU,EAAEC,IAAI,KAAK;IAChD,KAAK,MAAMC,QAAQ,IAAID,IAAI,CAACE,SAAS,EAAE;MACnC,IAAIH,UAAU,CAACI,QAAQ,CAACF,QAAQ,CAACG,EAAE,CAAC,EAAE;QAClC,OAAOL,UAAU;MACrB;MACAA,UAAU,CAACM,IAAI,CAACJ,QAAQ,CAACG,EAAE,CAAC;IAChC;IAEA,OAAOL,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;AACV,CAAC;AAAC;AAQK,MAAMO,cAAc,GAAG,MAC1BC,MAA4B,IACM;EAClC,MAAM;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GAAGH,MAAM;EAE7C,MAAMI,MAAM,GAAGf,iBAAiB,CAACa,QAAQ,CAAC;EAE1C,OAAOD,OAAO,CAACI,QAAQ,CAACC,oBAAoB,CAAC,YAAY;IACrD,MAAM,CAACX,SAAS,CAAC,GAAG,MAAMM,OAAO,CAACM,GAAG,CAACb,QAAQ,CAACc,IAAI,CAAC;MAChDC,KAAK,EAAE;QACHC,KAAK,EAAEN;MACX,CAAC;MACDO,KAAK,EAAE;IACX,CAAC,CAAC;IACF,OAAOhB,SAAS,CAACiB,MAAM,CAAEC,IAAI,IAAmC;MAC5D,IAAI,CAACA,IAAI,CAACC,KAAK,EAAE;QACb,OAAO,KAAK;MAChB,CAAC,MAAM,IAAIX,OAAO,CAACP,QAAQ,CAACiB,IAAI,CAACE,UAAU,CAAC,EAAE;QAC1C,OAAO,KAAK;MAChB;MAEA,OAAO,IAAI;IACf,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -16,9 +16,9 @@ const createChangeRequestStorageOperations = params => {
|
|
16
16
|
security
|
17
17
|
} = params;
|
18
18
|
const getChangeRequestModel = async () => {
|
19
|
-
security.
|
20
|
-
|
21
|
-
|
19
|
+
const model = await security.withoutAuthorization(async () => {
|
20
|
+
return cms.getModel("apwChangeRequestModelDefinition");
|
21
|
+
});
|
22
22
|
if (!model) {
|
23
23
|
throw new _error.default("Could not find `apwChangeRequestModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
24
24
|
}
|
@@ -28,9 +28,9 @@ const createChangeRequestStorageOperations = params => {
|
|
28
28
|
id
|
29
29
|
}) => {
|
30
30
|
const model = await getChangeRequestModel();
|
31
|
-
security.
|
32
|
-
|
33
|
-
|
31
|
+
const entry = await security.withoutAuthorization(async () => {
|
32
|
+
return cms.getEntryById(model, id);
|
33
|
+
});
|
34
34
|
return (0, _fieldResolver.getFieldValues)({
|
35
35
|
entry,
|
36
36
|
fields: _index.baseFields,
|
@@ -43,11 +43,11 @@ const createChangeRequestStorageOperations = params => {
|
|
43
43
|
getChangeRequest,
|
44
44
|
async listChangeRequests(params) {
|
45
45
|
const model = await getChangeRequestModel();
|
46
|
-
security.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
47
|
+
return cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
48
|
+
where: (0, _objectSpread2.default)({}, params.where)
|
49
|
+
}));
|
50
|
+
});
|
51
51
|
try {
|
52
52
|
const all = await Promise.all(entries.map(entry => (0, _fieldResolver.getFieldValues)({
|
53
53
|
entry,
|
@@ -62,9 +62,9 @@ const createChangeRequestStorageOperations = params => {
|
|
62
62
|
},
|
63
63
|
async createChangeRequest(params) {
|
64
64
|
const model = await getChangeRequestModel();
|
65
|
-
security.
|
66
|
-
|
67
|
-
|
65
|
+
const entry = await security.withoutAuthorization(async () => {
|
66
|
+
return cms.createEntry(model, params.data);
|
67
|
+
});
|
68
68
|
return (0, _fieldResolver.getFieldValues)({
|
69
69
|
entry,
|
70
70
|
fields: _index.baseFields,
|
@@ -81,9 +81,9 @@ const createChangeRequestStorageOperations = params => {
|
|
81
81
|
const existingEntry = await getChangeRequest({
|
82
82
|
id: params.id
|
83
83
|
});
|
84
|
-
security.
|
85
|
-
|
86
|
-
|
84
|
+
const entry = await security.withoutAuthorization(async () => {
|
85
|
+
return cms.updateEntry(model, params.id, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data));
|
86
|
+
});
|
87
87
|
return (0, _fieldResolver.getFieldValues)({
|
88
88
|
entry,
|
89
89
|
fields: _index.baseFields,
|
@@ -93,9 +93,9 @@ const createChangeRequestStorageOperations = params => {
|
|
93
93
|
},
|
94
94
|
async deleteChangeRequest(params) {
|
95
95
|
const model = await getChangeRequestModel();
|
96
|
-
security.
|
97
|
-
|
98
|
-
|
96
|
+
await security.withoutAuthorization(async () => {
|
97
|
+
return cms.deleteEntry(model, params.id);
|
98
|
+
});
|
99
99
|
return true;
|
100
100
|
}
|
101
101
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","
|
1
|
+
{"version":3,"names":["createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","model","withoutAuthorization","getModel","WebinyError","getChangeRequest","id","entry","getEntryById","getFieldValues","fields","baseFields","context","transformers","getTransformer","listChangeRequests","entries","meta","listLatestEntries","where","all","Promise","map","ex","message","code","data","createChangeRequest","createEntry","updateChangeRequest","existingEntry","updateEntry","deleteChangeRequest","deleteEntry"],"sources":["changeRequestStorageOperations.ts"],"sourcesContent":["import { ApwChangeRequestStorageOperations } from \"./types\";\nimport { baseFields, CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { getFieldValues, getTransformer } from \"~/utils/fieldResolver\";\nimport WebinyError from \"@webiny/error\";\nimport { ApwChangeRequest } from \"~/types\";\n\nexport const createChangeRequestStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwChangeRequestStorageOperations => {\n const { cms, getCmsContext, security } = params;\n const getChangeRequestModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(\"apwChangeRequestModelDefinition\");\n });\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwChangeRequestModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getChangeRequest: ApwChangeRequestStorageOperations[\"getChangeRequest\"] = async ({\n id\n }) => {\n const model = await getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n };\n return {\n getChangeRequestModel,\n getChangeRequest,\n async listChangeRequests(params) {\n const model = await getChangeRequestModel();\n\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n });\n try {\n const all = await Promise.all(\n entries.map(entry =>\n getFieldValues<ApwChangeRequest>({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n })\n )\n );\n return [all, meta];\n } catch (ex) {\n throw new WebinyError(ex.message, ex.code, ex.data);\n }\n },\n async createChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, params.data);\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async updateChangeRequest(params) {\n const model = await getChangeRequestModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getChangeRequest({ id: params.id });\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data\n });\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async deleteChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n await security.withoutAuthor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AAG,CAAC,CAAC;MAE/D,MAAMC,KAAK,GAAG,MAAMR,QAAQ,CAACG,oBAAoB,CAAC,YAAY;QAC1D,OAAOL,GAAG,CAACkC,WAAW,CAAC9B,KAAK,EAAEL,MAAM,CAACU,EAAE,8DAChCwB,aAAa,GACblC,MAAM,CAAC8B,IAAI,EAChB;MACN,CAAC,CAAC;MACF,OAAO,IAAAjB,6BAAc,EAAC;QAClBF,KAAK;QACLG,MAAM,EAAEC,iBAAU;QAClBC,OAAO,EAAEd,aAAa,EAAE;QACxBe,YAAY,EAAE,CAAC,IAAAC,6BAAc,EAACb,KAAK,EAAE,MAAM,CAAC;MAChD,CAAC,CAAC;IACN,CAAC;IACD,MAAM+B,mBAAmB,CAACpC,MAAM,EAAE;MAC9B,MAAMK,KAAK,GAAG,MAAMD,qBAAqB,EAAE;MAE3C,MAAMD,QAAQ,CAACG,oBAAoB,CAAC,YAAY;QAC5C,OAAOL,GAAG,CAACoC,WAAW,CAAChC,KAAK,EAAEL,MAAM,CAACU,EAAE,CAAC;MAC5C,CAAC,CAAC;MACF,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAAC"}
|
@@ -24,9 +24,9 @@ const createCommentStorageOperations = ({
|
|
24
24
|
security
|
25
25
|
}) => {
|
26
26
|
const getCommentModel = async () => {
|
27
|
-
security.
|
28
|
-
|
29
|
-
|
27
|
+
const model = await security.withoutAuthorization(async () => {
|
28
|
+
return cms.getModel(_comment.COMMENT_MODEL_ID);
|
29
|
+
});
|
30
30
|
if (!model) {
|
31
31
|
throw new _error.default(`Could not find "${_comment.COMMENT_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
32
32
|
}
|
@@ -36,9 +36,9 @@ const createCommentStorageOperations = ({
|
|
36
36
|
id
|
37
37
|
}) => {
|
38
38
|
const model = await getCommentModel();
|
39
|
-
security.
|
40
|
-
|
41
|
-
|
39
|
+
const entry = await security.withoutAuthorization(async () => {
|
40
|
+
return cms.getEntryById(model, id);
|
41
|
+
});
|
42
42
|
return (0, _fieldResolver.getFieldValues)({
|
43
43
|
entry,
|
44
44
|
fields: _index.baseFields,
|
@@ -54,9 +54,9 @@ const createCommentStorageOperations = ({
|
|
54
54
|
},
|
55
55
|
async listComments(params) {
|
56
56
|
const model = await getCommentModel();
|
57
|
-
security.
|
58
|
-
|
59
|
-
|
57
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
58
|
+
return cms.listLatestEntries(model, params);
|
59
|
+
});
|
60
60
|
const values = await Promise.all(entries.map(entry => (0, _fieldResolver.getFieldValues)({
|
61
61
|
entry,
|
62
62
|
fields: _index.baseFields,
|
@@ -69,14 +69,14 @@ const createCommentStorageOperations = ({
|
|
69
69
|
async createComment(params) {
|
70
70
|
const model = await getCommentModel();
|
71
71
|
const refModel = await this.getChangeRequestModel();
|
72
|
-
security.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
72
|
+
const entry = await security.withoutAuthorization(async () => {
|
73
|
+
return cms.createEntry(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params.data), {}, {
|
74
|
+
changeRequest: {
|
75
|
+
id: params.data.changeRequest,
|
76
|
+
modelId: refModel.modelId
|
77
|
+
}
|
78
|
+
}));
|
79
|
+
});
|
80
80
|
const values = await (0, _fieldResolver.getFieldValues)({
|
81
81
|
entry,
|
82
82
|
fields: _index.baseFields,
|
@@ -94,9 +94,9 @@ const createCommentStorageOperations = ({
|
|
94
94
|
const existingEntry = await getComment({
|
95
95
|
id: params.id
|
96
96
|
});
|
97
|
-
security.
|
98
|
-
|
99
|
-
|
97
|
+
const entry = await security.withoutAuthorization(async () => {
|
98
|
+
return cms.updateEntry(model, params.id, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data));
|
99
|
+
});
|
100
100
|
const values = await (0, _fieldResolver.getFieldValues)({
|
101
101
|
entry,
|
102
102
|
fields: _index.baseFields,
|
@@ -107,9 +107,9 @@ const createCommentStorageOperations = ({
|
|
107
107
|
},
|
108
108
|
async deleteComment(params) {
|
109
109
|
const model = await getCommentModel();
|
110
|
-
security.
|
111
|
-
|
112
|
-
|
110
|
+
await security.withoutAuthorization(async () => {
|
111
|
+
return cms.deleteEntry(model, params.id);
|
112
|
+
});
|
113
113
|
return true;
|
114
114
|
}
|
115
115
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["pickIdFromChangeRequest","obj","rawValue","id","createCommentStorageOperations","cms","getCmsContext","security","getCommentModel","
|
1
|
+
{"version":3,"names":["pickIdFromChangeRequest","obj","rawValue","id","createCommentStorageOperations","cms","getCmsContext","security","getCommentModel","model","withoutAuthorization","getModel","COMMENT_MODEL_ID","WebinyError","getComment","entry","getEntryById","getFieldValues","fields","baseFields","context","transformers","getTransformer","params","values","listComments","entries","meta","listLatestEntries","Promise","all","map","value","createComment","refModel","getChangeRequestModel","createEntry","data","changeRequest","modelId","updateComment","existingEntry","updateEntry","deleteComment","deleteEntry"],"sources":["commentStorageOperations.ts"],"sourcesContent":["import { ApwStorageOperations } from \"./types\";\nimport { ApwCommentStorageOperations } from \"./types\";\nimport { baseFields, CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { getFieldValues, getTransformer } from \"~/utils/fieldResolver\";\nimport WebinyError from \"@webiny/error\";\nimport { ApwComment } from \"~/types\";\nimport { CmsEntryListParams } from \"@webiny/api-headless-cms/types\";\nimport { COMMENT_MODEL_ID } from \"~/storageOperations/models/comment.model\";\n\nconst pickIdFromChangeRequest = (obj: Record<string, any>): ApwComment => {\n const rawValue = obj[\"changeRequest\"];\n if (!rawValue) {\n return obj as unknown as ApwComment;\n }\n obj[\"changeRequest\"] = rawValue.id;\n return obj as unknown as ApwComment;\n};\n\nexport const createCommentStorageOperations = ({\n cms,\n getCmsContext,\n security\n}: CreateApwStorageOperationsParams): ApwCommentStorageOperations => {\n const getCommentModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(COMMENT_MODEL_ID);\n });\n\n if (!model) {\n throw new WebinyError(\n `Could not find \"${COMMENT_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getComment: ApwCommentStorageOperations[\"getComment\"] = async ({ id }) => {\n const model = await getCommentModel();\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n };\n return {\n getCommentModel,\n getComment: async params => {\n const values = await getComment(params);\n return pickIdFromChangeRequest(values);\n },\n async listComments(params) {\n const model = await getCommentModel();\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, params as CmsEntryListParams);\n });\n const values = await Promise.all(\n entries.map(entry =>\n getFieldValues<ApwComment>({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n })\n )\n );\n const all = values.map(value => pickIdFromChangeRequest(value));\n return [all, meta];\n },\n async createComment(this: ApwStorageOperations, params) {\n const model = await getCommentModel();\n const refModel = await this.getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, {\n ...params.data,\n changeRequest: {\n id: params.data.changeRequest,\n modelId: refModel.modelId\n }\n });\n });\n\n const values = await getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n return pickIdFromChangeRequest(values);\n },\n async updateComment(params) {\n const model = await getCommentModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getComment({ id: params.id });\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data\n });\n });\n\n const values = await getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n return pickIdFromChangeRequest(values);\n },\n async deleteComment(params) {\n const model = await getCommentModel();\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;;AAEA;AACA;AACA;AAGA;AAEA,MAAMA,uBAAuB,GAAIC,GAAwB,IAAiB;EACtE,MAAMC,QAAQ,GAAGD,GAAG,CAAC,eAAe,CAAC;EACrC,IAAI,CAACC,QAAQ,EAAE;IACX,OAAOD,GAAG;EACd;EACAA,GAAG,CAAC,eAAe,CAAC,GAAGC,QAAQ,CAACC,EAAE;EAClC,OAAOF,GAAG;AACd,CAAC;AAEM,MAAMG,8BAA8B,GAAG,CAAC;EAC3CC,GAAG;EACHC,aAAa;EACbC;AAC8B,CAAC,KAAkC;EACjE,MAAMC,eAAe,GAAG,YAAY;IAChC,MAAMC,KAAK,GAAG,MAAMF,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOL,GAAG,CAACM,QAAQ,CAACC,yBAAgB,CAAC;IACzC,CAAC,CAAC;IAEF,IAAI,CAACH,KAAK,EAAE;MACR,MAAM,IAAII,cAAW,CAChB,mBAAkBD,yBAAiB,UAAS,EAC7C,uBAAuB,CAC1B;IACL;IACA,OAAOH,KAAK;EAChB,CAAC;EACD,MAAMK,UAAqD,GAAG,OAAO;IAAEX;EAAG,CAAC,KAAK;IAC5E,MAAMM,KAAK,GAAG,MAAMD,eAAe,EAAE;IACrC,MAAMO,KAAK,GAAG,MAAMR,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOL,GAAG,CAACW,YAAY,CAACP,KAAK,EAAEN,EAAE,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,IAAAc,6BAAc,EAAC;MAClBF,KAAK;MACLG,MAAM,EAAEC,iBAAU;MAClBC,OAAO,EAAEd,aAAa,EAAE;MACxBe,YAAY,EAAE,CAAC,IAAAC,6BAAc,EAACb,KAAK,EAAE,MAAM,CAAC;IAChD,CAAC,CAAC;EACN,CAAC;EACD,OAAO;IACHD,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