strapi-plugin-comments 3.2.4 → 3.2.6

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.
Files changed (144) hide show
  1. package/LICENSE.md +18 -4
  2. package/README.md +379 -26
  3. package/dist/_chunks/{en-CT6Rt2uf.mjs → en-B_ywmALc.mjs} +3 -0
  4. package/dist/_chunks/{en-Tdlz6WoL.js → en-CTX-vxI-.js} +1 -1
  5. package/dist/_chunks/{fr-BlaISu0-.js → fr-CJZ1I0cO.js} +1 -1
  6. package/dist/_chunks/{fr-CTKzDZoe.mjs → fr-CzgABcR9.mjs} +3 -0
  7. package/dist/_chunks/index-BE4WKyKM.js +44 -0
  8. package/dist/_chunks/{index-D9B_m9fB.mjs → index-BF9v7878.mjs} +185 -146
  9. package/dist/_chunks/index-Bp-bmc3E.js +1 -0
  10. package/dist/_chunks/{index-CqWqvu-C.mjs → index-CSGHz1Ar.mjs} +10679 -11434
  11. package/dist/_chunks/{index-CgbBtemc.js → index-C_4LXdQ6.js} +134 -91
  12. package/dist/_chunks/{index-CynNsAVf.mjs → index-CdDH4b25.mjs} +45 -23
  13. package/dist/_chunks/index-Dfe55Tn-.mjs +6042 -0
  14. package/dist/_chunks/index-zjD2IIJE.js +5 -0
  15. package/dist/_chunks/{pl-BE9Xc2Tq.mjs → pl-Ca-o0rE-.mjs} +3 -0
  16. package/dist/_chunks/{pl-r2tJzCYX.js → pl-clljrMvo.js} +1 -1
  17. package/dist/_chunks/{pt-BR-BntmApbV.js → pt-BR-DV48_kX8.js} +1 -1
  18. package/dist/_chunks/{pt-BR-ZzKZqryk.mjs → pt-BR-XHO5Olrb.mjs} +3 -0
  19. package/dist/_chunks/{ru-DdjjIy0c.js → ru-BK78F2Vt.js} +1 -1
  20. package/dist/_chunks/{ru-NqAiywiG.mjs → ru-zKH0YOjJ.mjs} +3 -0
  21. package/dist/_chunks/{tr-v1mNvsod.js → tr-BMe1cFKp.js} +1 -1
  22. package/dist/_chunks/{tr-6Vivmm9L.mjs → tr-BaczzuT6.mjs} +3 -0
  23. package/dist/_chunks/{zh-Hans-B3CCaxs8.mjs → zh-Hans-CPSQ76Y3.mjs} +3 -0
  24. package/dist/_chunks/{zh-Hans-_ImAlhp2.js → zh-Hans-xMRxrXVG.js} +1 -1
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +1 -1
  27. package/dist/admin/src/api/client.d.ts +67 -58
  28. package/dist/admin/src/api/schemas.d.ts +169 -2797
  29. package/dist/admin/src/components/ActionButton/index.d.ts +2 -4
  30. package/dist/admin/src/components/CommentReactionsSummary/index.d.ts +8 -0
  31. package/dist/admin/src/components/CommentStatusFilters/index.d.ts +2 -1
  32. package/dist/admin/src/components/CustomInjectionZone/index.d.ts +6 -0
  33. package/dist/admin/src/components/CustomInjectionZoneCell/index.d.ts +7 -0
  34. package/dist/admin/src/components/DiscussionThreadItem/DiscussionThreadItemFooter.d.ts +1 -1
  35. package/dist/admin/src/components/DiscussionThreadItem/index.d.ts +3 -3
  36. package/dist/admin/src/components/IconButtonGroup/index.d.ts +2 -5
  37. package/dist/admin/src/components/LoadingIndicatorOverlay/index.d.ts +2 -1
  38. package/dist/admin/src/components/PluginIcon/index.d.ts +2 -1
  39. package/dist/admin/src/components/ReactionCounter/index.d.ts +7 -0
  40. package/dist/admin/src/components/ReactionCounter/styled.d.ts +16 -0
  41. package/dist/admin/src/components/SideNav/index.d.ts +2 -1
  42. package/dist/admin/src/components/StatusBadge/index.d.ts +3 -5
  43. package/dist/admin/src/components/Wysiwyg/EditorLayout.d.ts +2 -2
  44. package/dist/admin/src/components/Wysiwyg/PreviewWysiwyg.d.ts +2 -1
  45. package/dist/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +2 -1
  46. package/dist/admin/src/components/Wysiwyg/WysiwygNav.d.ts +1 -1
  47. package/dist/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +4 -4
  48. package/dist/admin/src/components/icons/comments.d.ts +2 -1
  49. package/dist/admin/src/components/icons/strapiIcons.d.ts +2 -1
  50. package/dist/admin/src/contexts/UserContext.d.ts +7 -7
  51. package/dist/admin/src/hooks/useAPI.d.ts +74 -65
  52. package/dist/admin/src/hooks/useCommentMutations.d.ts +18 -18
  53. package/dist/admin/src/hooks/useCommentsAll.d.ts +8 -6
  54. package/dist/admin/src/hooks/useConfig.d.ts +2 -0
  55. package/dist/admin/src/hooks/useReactionCounts.d.ts +2 -0
  56. package/dist/admin/src/hooks/useReactionTypes.d.ts +8 -0
  57. package/dist/admin/src/hooks/useReports.d.ts +13 -11
  58. package/dist/admin/src/hooks/useUserContext.d.ts +7 -7
  59. package/dist/admin/src/pages/AiEvaluations/index.d.ts +2 -0
  60. package/dist/admin/src/pages/App/index.d.ts +2 -1
  61. package/dist/admin/src/pages/Details/DetailsEntry.d.ts +2 -1
  62. package/dist/admin/src/pages/Discover/index.d.ts +2 -1
  63. package/dist/admin/src/pages/Settings/hooks/useSettingsAPI.d.ts +9 -7
  64. package/dist/admin/src/pages/Settings/index.d.ts +2 -1
  65. package/dist/admin/src/translations/en.d.ts +3 -0
  66. package/dist/admin/src/translations/fr.d.ts +3 -0
  67. package/dist/admin/src/translations/pl.d.ts +3 -0
  68. package/dist/admin/src/translations/pt-BR.d.ts +3 -0
  69. package/dist/admin/src/translations/ru.d.ts +3 -0
  70. package/dist/admin/src/translations/tr.d.ts +3 -0
  71. package/dist/admin/src/translations/zh-Hans.d.ts +3 -0
  72. package/dist/admin/src/utils/functions.d.ts +3 -0
  73. package/dist/admin/src/utils/reactionsIntegration.d.ts +24 -0
  74. package/dist/admin/src/utils/resolveCommentStatusColor.d.ts +1 -1
  75. package/dist/admin/src/utils/resolveReportStatusColor.d.ts +1 -1
  76. package/dist/server/index.js +69 -88
  77. package/dist/server/index.mjs +9727 -7544
  78. package/dist/server/src/config/index.d.ts +37 -112
  79. package/dist/server/src/const/REPORT_SOURCE.d.ts +4 -0
  80. package/dist/server/src/const/index.d.ts +1 -0
  81. package/dist/server/src/content-types/index.d.ts +7 -0
  82. package/dist/server/src/content-types/report/index.d.ts +7 -0
  83. package/dist/server/src/content-types/report/schema.d.ts +8 -1
  84. package/dist/server/src/controllers/admin.controller.d.ts +920 -888
  85. package/dist/server/src/controllers/client.controller.d.ts +1595 -709
  86. package/dist/server/src/controllers/index.d.ts +2784 -6208
  87. package/dist/server/src/controllers/settings.controller.d.ts +110 -94
  88. package/dist/server/src/graphql/getResolversConfig.d.ts +33 -0
  89. package/dist/server/src/graphql/mutations/getApproveComment.d.ts +149 -0
  90. package/dist/server/src/graphql/mutations/getBlockComment.d.ts +149 -0
  91. package/dist/server/src/graphql/mutations/getBlockCommentThread.d.ts +149 -0
  92. package/dist/server/src/graphql/mutations/getCreateAbuseReport.d.ts +81 -78
  93. package/dist/server/src/graphql/mutations/getCreateComment.d.ts +74 -72
  94. package/dist/server/src/graphql/mutations/getRejectComment.d.ts +149 -0
  95. package/dist/server/src/graphql/mutations/getRemoveComment.d.ts +74 -72
  96. package/dist/server/src/graphql/mutations/getResolveAbuseReport.d.ts +25 -0
  97. package/dist/server/src/graphql/mutations/getResolveAllAbuseReportsForComment.d.ts +16 -0
  98. package/dist/server/src/graphql/mutations/getResolveAllAbuseReportsForThread.d.ts +16 -0
  99. package/dist/server/src/graphql/mutations/getResolveCommentMultipleAbuseReports.d.ts +17 -0
  100. package/dist/server/src/graphql/mutations/getResolveMultipleAbuseReports.d.ts +16 -0
  101. package/dist/server/src/graphql/mutations/getUnblockComment.d.ts +149 -0
  102. package/dist/server/src/graphql/mutations/getUnblockCommentThread.d.ts +149 -0
  103. package/dist/server/src/graphql/mutations/getUpdateComment.d.ts +74 -72
  104. package/dist/server/src/graphql/queries/findAllFlat.d.ts +162 -155
  105. package/dist/server/src/graphql/queries/findAllInHierarchy.d.ts +9 -1
  106. package/dist/server/src/graphql/queries/findAllPerAuthor.d.ts +161 -154
  107. package/dist/server/src/graphql/types/getCommentReactionCount.d.ts +2 -0
  108. package/dist/server/src/graphql/types/getCommentReactionsMetaEntry.d.ts +2 -0
  109. package/dist/server/src/graphql/types/getModerateCommentInput.d.ts +2 -0
  110. package/dist/server/src/graphql/types/getReportsResolveBatch.d.ts +2 -0
  111. package/dist/server/src/graphql/types/getResolveAbuseReportInput.d.ts +2 -0
  112. package/dist/server/src/graphql/types/getResolveCommentMultipleAbuseReportsInput.d.ts +2 -0
  113. package/dist/server/src/graphql/types/getResolveMultipleAbuseReportsInput.d.ts +2 -0
  114. package/dist/server/src/graphql/types/index.d.ts +1 -1
  115. package/dist/server/src/index.d.ts +17 -35339
  116. package/dist/server/src/repositories/report.comment.repository.d.ts +87 -83
  117. package/dist/server/src/repositories/store.repository.d.ts +144 -124
  118. package/dist/server/src/services/admin/admin.service.d.ts +14597 -8230
  119. package/dist/server/src/services/client.service.d.ts +11410 -7681
  120. package/dist/server/src/services/common.service.d.ts +3548 -471
  121. package/dist/server/src/services/email.service.d.ts +11 -0
  122. package/dist/server/src/services/index.d.ts +17 -27339
  123. package/dist/server/src/services/reactions.service.d.ts +11976 -0
  124. package/dist/server/src/services/settings.service.d.ts +85 -73
  125. package/dist/server/src/services/utils/functions.d.ts +2 -2
  126. package/dist/server/src/services/utils/reactions.d.ts +12 -0
  127. package/dist/server/src/utils/constants.d.ts +1 -0
  128. package/dist/server/src/utils/getConfig.d.ts +1 -1
  129. package/dist/server/src/utils/getPluginService.d.ts +1 -1
  130. package/dist/server/src/utils/types.d.ts +5 -3
  131. package/dist/server/src/validators/api/controllers/admin.controller.validator.d.ts +234 -1322
  132. package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +2051 -2013
  133. package/dist/server/src/validators/api/controllers/settings.controller.validator.d.ts +15 -13
  134. package/dist/server/src/validators/repositories/comment.schema.d.ts +15 -439
  135. package/dist/server/src/validators/repositories/comment.validator.d.ts +240 -7397
  136. package/dist/server/src/validators/repositories/reports.validator.d.ts +89 -2940
  137. package/dist/server/src/validators/repositories/utils.d.ts +5 -13
  138. package/dist/server/src/validators/utils.d.ts +164 -1875
  139. package/dist/shared/constants.d.ts +1 -0
  140. package/package.json +49 -49
  141. package/dist/_chunks/index-BIaTg-pL.mjs +0 -5682
  142. package/dist/_chunks/index-BIivsuhp.js +0 -44
  143. package/dist/_chunks/index-Dz3cg8MA.js +0 -1
  144. package/dist/_chunks/index-sPxsE9Y1.js +0 -5
package/LICENSE.md CHANGED
@@ -1,7 +1,21 @@
1
- Copyright (c) 2021 VirtusLab Sp. z o.o. & Strapi Solutions.
1
+ MIT License
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Copyright (c) 2026 Sensinum Sp. z o.o.
4
4
 
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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:
6
11
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 CHANGED
@@ -5,16 +5,16 @@
5
5
  <h1>Strapi - Comments plugin</h1>
6
6
  <p>Powerful Strapi based comments moderation tool for you and your users</p>
7
7
  <a href="https://www.npmjs.org/package/strapi-plugin-comments">
8
- <img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/VirtusLab-Open-Source/strapi-plugin-comments?label=npm&logo=npm">
8
+ <img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/Sensinum/strapi-plugin-comments?label=npm&logo=npm">
9
9
  </a>
10
10
  <a href="https://www.npmjs.org/package/strapi-plugin-comments">
11
11
  <img src="https://img.shields.io/npm/dm/strapi-plugin-comments.svg" alt="Monthly download on NPM" />
12
12
  </a>
13
- <a href="https://circleci.com/gh/VirtusLab-Open-Source/strapi-plugin-comments">
14
- <img src="https://circleci.com/gh/VirtusLab-Open-Source/strapi-plugin-comments.svg?style=shield" alt="CircleCI" />
13
+ <a href="https://github.com/Sensinum/strapi-plugin-comments/actions/workflows/ci.yml">
14
+ <img src="https://github.com/Sensinum/strapi-plugin-comments/actions/workflows/ci.yml/badge.svg" alt="CI" />
15
15
  </a>
16
- <a href="https://codecov.io/gh/VirtusLab-Open-Source/strapi-plugin-comments">
17
- <img src="https://codecov.io/gh/VirtusLab-Open-Source/strapi-plugin-comments/coverage.svg?branch=master" alt="codecov.io" />
16
+ <a href="https://codecov.io/gh/Sensinum/strapi-plugin-comments">
17
+ <img src="https://codecov.io/gh/Sensinum/strapi-plugin-comments/coverage.svg?branch=master" alt="codecov.io" />
18
18
  </a>
19
19
  </div>
20
20
 
@@ -46,9 +46,9 @@ A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) that provid
46
46
 
47
47
  ## 💎 Versions
48
48
 
49
- - **Strapi v5** - (current) [v3.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments)
50
- - **Strapi v4** - [v2.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments/tree/strapi-v4)
51
- - **Strapi v3** - [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments/tree/strapi-v3)
49
+ - **Strapi v5** - (current) [v3.x](https://github.com/Sensinum/strapi-plugin-comments)
50
+ - **Strapi v4** - [v2.x](https://github.com/Sensinum/strapi-plugin-comments/tree/strapi-v4)
51
+ - **Strapi v3** - [v1.x](https://github.com/Sensinum/strapi-plugin-comments/tree/strapi-v3)
52
52
 
53
53
  ## ✨ Features
54
54
 
@@ -59,6 +59,7 @@ A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) that provid
59
59
  - **Moderation Panel:** Search & Filter through the bucket with your auditory comments. Manage them by blocking single ones or full threads. All in combined list &amp; hierarchical tree view of threads.
60
60
  - **Automated Bad Words filtering:** By default end users are not allowed to post abusing comments where bad words have been used.
61
61
  - **Abuse Reporting & Reviewing:** Don't allow inferior language, react to reports from your community, send email notifications about issued reports
62
+ - **Reactions plugin integration:** Optional integration with [`strapi-plugin-reactions`](https://github.com/VirtusLab-Open-Source/strapi-plugin-reactions) to expose reaction counts on comments in REST & GraphQL APIs and in the moderation panel (see [Reactions integration](#reactions-integration)).
62
63
 
63
64
  ## ⏳ Installation
64
65
 
@@ -97,14 +98,14 @@ Complete installation requirements are exact same as for Strapi itself and can b
97
98
 
98
99
  **Minimum environment requirements**
99
100
 
100
- - Node.js `>=18.0.0 <=22.x.x`
101
+ - Node.js `>=22.0.0 <=26.x.x`
101
102
  - NPM `>=6.x.x`
102
103
 
103
104
  In our minimum support we're following [official Node.js releases timelines](https://nodejs.org/en/about/releases/).
104
105
 
105
106
  **Supported Strapi versions**:
106
107
 
107
- - Strapi v5.10.3 (recently tested)
108
+ - Strapi v5.52.3 (recently tested)
108
109
  - Strapi v5.x
109
110
 
110
111
  > This plugin is designed for **Strapi v5**. To get support for other Strapi versions, please follow the [versions](#-versions) section.
@@ -113,6 +114,10 @@ In our minimum support we're following [official Node.js releases timelines](htt
113
114
 
114
115
  - `@strapi/plugin-graphql` - required to run GraphQL handled by this plugin
115
116
 
117
+ **Optional plugin integrations**
118
+
119
+ - [`strapi-plugin-reactions`](https://github.com/VirtusLab-Open-Source/strapi-plugin-reactions) - required only if you want comment reaction counts in public APIs and the admin UI. Enable it with **`reactionsEnabled`** on the Comments **Settings** page (see [Reactions integration](#reactions-integration)).
120
+
116
121
  **We recommend always using the latest version of Strapi to start your new projects**.
117
122
 
118
123
  ## 🔧 Configuration
@@ -123,6 +128,8 @@ To start your journey with **Comments plugin** you must first setup it using the
123
128
 
124
129
  On the dedicated page, you will be able to set up all crucial properties which drive the plugin and customize each individual collection for which **Comments plugin** should be enabled.
125
130
 
131
+ When [`strapi-plugin-reactions`](https://github.com/VirtusLab-Open-Source/strapi-plugin-reactions) is installed, an additional **Reactions integration** toggle (`reactionsEnabled`) appears in the global settings section. It controls whether comment payloads include reaction counts (see [Reactions integration](#reactions-integration)).
132
+
126
133
  <div style="margin: 20px 0" align="center">
127
134
  <img style="width: 100%; height: auto;" src="https://www.sensinum.com/img/open-source/strapi-plugin-comments/configuration.png" alt="Plugin configuration" />
128
135
  </div>
@@ -170,6 +177,7 @@ module.exports = ({ env }) => ({
170
177
  - `reportReasons` - set of enums you would like to use for issuing abuse reports. Provided by default `'BAD_LANGUAGE'`, `'DISCRIMINATION'` and `'OTHER'`.
171
178
  - `gql` - specific configuration for GraphQL. See [Additional GQL Configuration](#additional-gql-configuration)
172
179
  - `blockedAuthorProps` - list of author's entity properties removed from a response for client side
180
+ - `reactionsEnabled` - stored in the plugin settings (Comments → **Settings**). When `true` and the [Reactions plugin](#reactions-integration) is installed and enabled, comment responses in REST and GraphQL include reaction counts. If the setting is missing or the Reactions plugin is not present, integration stays off regardless of other defaults.
173
181
 
174
182
  ## Additional GQL Configuration
175
183
 
@@ -244,7 +252,11 @@ Feature / Capability focused permissions:
244
252
  "createdAt": "2020-07-14T20:13:01.649Z",
245
253
  "updatedAt": "2020-07-14T20:13:01.670Z",
246
254
  "related": {}, // Related content type entity
247
- "reports": [] // Reports issued against this comment
255
+ "reports": [], // Reports issued against this comment
256
+ "reactions": {
257
+ "like": 2,
258
+ "love": 1
259
+ } // Present only when reactionsEnabled is on and strapi-plugin-reactions is installed
248
260
  }
249
261
  ```
250
262
 
@@ -318,7 +330,11 @@ Return a flat structure of comments for specified instance of Content Type like
318
330
  "meta": {
319
331
  "pagination": {
320
332
  // payload based on Strapi REST Pagination specification
321
- }
333
+ },
334
+ "reactions": {
335
+ "njx99iv4p4txuqp307ye8625": { "like": 2 },
336
+ "another-comment-document-id": { "like": 1, "love": 3 }
337
+ } // Present only when reactionsEnabled is on (map keyed by comment documentId)
322
338
  }
323
339
  }
324
340
  ```
@@ -335,6 +351,8 @@ Return a flat structure of comments for specified instance of Content Type like
335
351
  - [sorting](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#sorting)
336
352
  - [pagination](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#pagination)
337
353
 
354
+ > **Reactions:** With [Reactions integration](#reactions-integration) enabled, each item in `data` includes a `reactions` object; paginated flat responses may also include `meta.reactions` as above.
355
+
338
356
  ### Get Comments (by Author)
339
357
 
340
358
  _GraphQL equivalent: [Public GraphQL API -> Get Comments (by Author)](#get-comments-by-author-1)_
@@ -542,7 +560,7 @@ Reports abuse in specified Comment content based on it `commentId` and related t
542
560
  }
543
561
  ```
544
562
 
545
- _Available reason enums:_ `BAD_WORDS`, `OTHER`, `DISCRIMINATION` (want more? See [configuration section](#configuration).)
563
+ _Available reason enums:_ `BAD_LANGUAGE`, `OTHER`, `DISCRIMINATION` (want more? See [configuration section](#configuration).)
546
564
 
547
565
  **Example response body**
548
566
 
@@ -557,6 +575,104 @@ _Available reason enums:_ `BAD_WORDS`, `OTHER`, `DISCRIMINATION` (want more? See
557
575
  - `200` - Successful. Response with reported abuse.
558
576
  - `409` - Conflict. Occurs when trying to report an abuse to a non existing comment.
559
577
 
578
+ ### Moderate comments (Content API)
579
+
580
+ Use these endpoints when you need to moderate comments or abuse reports from your own app or integration instead of only from the Strapi admin panel. They cover blocking, approval workflow, and marking abuse reports as resolved. Paths are grouped under `moderate/single` (one comment), `moderate/thread` (thread-wide block), `moderate/all` (bulk resolve on a comment or thread), and `moderate/multiple` (bulk resolve by report id). The relation prefix is the same as elsewhere: `/api/comments/api::<collection name>.<content type name>:<entity document id>/…`.
581
+
582
+ #### Block or unblock a comment
583
+
584
+ Sets or clears the `blocked` flag on one comment (does not change nested replies by itself).
585
+
586
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/block`
587
+
588
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/unblock`
589
+
590
+ **Example URL (block)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/block`
591
+
592
+ **Example URL (unblock)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/unblock`
593
+
594
+ ### Block or unblock a comment thread
595
+
596
+ Marks the root comment and its nested replies as blocked or unblocked (`blocked` / `blockedThread` and descendants).
597
+
598
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/thread/<commentId>/block`
599
+
600
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/thread/<commentId>/unblock`
601
+
602
+ **Example URL (block thread)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/thread/2/block`
603
+
604
+ **Example URL (unblock thread)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/thread/2/unblock`
605
+
606
+ ### Approve or reject a comment
607
+
608
+ For approval-flow content types: sets `approvalStatus` to approved or rejected.
609
+
610
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/approve`
611
+
612
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/reject`
613
+
614
+ **Example URL (approve)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/approve`
615
+
616
+ **Example URL (reject)**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/reject`
617
+
618
+ ### Resolve a single abuse report
619
+
620
+ Marks one report as resolved for the given comment (`reportId` must belong to that comment).
621
+
622
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/report/<reportId>/resolve`
623
+
624
+ **Example URL**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/report/15/resolve`
625
+
626
+ ### Resolve selected abuse reports for one comment
627
+
628
+ Resolves only the listed report ids; all must exist and be tied to this comment or the request fails.
629
+
630
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/single/<commentId>/report/resolve`
631
+
632
+ Send a **JSON body** with `Content-Type: application/json`. The comment id is taken only from the URL (`reportIds` is required in the body).
633
+
634
+ **Example URL**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/single/2/report/resolve`
635
+
636
+ **Example request body**
637
+
638
+ ```json
639
+ {
640
+ "reportIds": [15, 16]
641
+ }
642
+ ```
643
+
644
+ ### Resolve all abuse reports for a comment
645
+
646
+ Marks every unresolved abuse report for this comment as resolved (does not include replies in the thread).
647
+
648
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/all/<commentId>/reports/resolve-all`
649
+
650
+ **Example URL**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/all/2/reports/resolve-all`
651
+
652
+ ### Resolve all abuse reports for a comment and its thread
653
+
654
+ Resolves unresolved reports for this comment and for all comments in its thread (direct and nested replies).
655
+
656
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/all/<commentId>/reports/resolve-thread`
657
+
658
+ **Example URL**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/all/2/reports/resolve-thread`
659
+
660
+ #### Resolve multiple abuse reports by id
661
+
662
+ Bulk-resolve by report primary keys only. The relation segment in the URL still scopes the request to your enabled collection; reports may belong to different comments.
663
+
664
+ `PUT <host>/api/comments/api::<collection name>.<content type name>:<entity document id>/moderate/multiple/reports/resolve-multiple`
665
+
666
+ **Example URL**: `https://localhost:1337/api/comments/api::page.page:njx99iv4p4txuqp307ye8625/moderate/multiple/reports/resolve-multiple`
667
+
668
+ **Example request body**
669
+
670
+ ```json
671
+ {
672
+ "reportIds": [15, 18, 22]
673
+ }
674
+ ```
675
+
560
676
  ## 🕸️ Public GraphQL specification
561
677
 
562
678
  **Strapi Users vs. Generic authors**
@@ -590,10 +706,16 @@ query {
590
706
  id
591
707
  name
592
708
  }
709
+ reactions {
710
+ slug
711
+ count
712
+ }
593
713
  }
594
714
  }
595
715
  ```
596
716
 
717
+ > **Reactions:** The `reactions` field is available on comment types when [Reactions integration](#reactions-integration) is enabled. Each entry is `{ slug, count }`.
718
+
597
719
  **Example response**
598
720
 
599
721
  ```json
@@ -639,20 +761,37 @@ query {
639
761
  relation: "api::page.page:njx99iv4p4txuqp307ye8625"
640
762
  filters: { content: { contains: "Test" } }
641
763
  ) {
642
- id
643
- content
644
- blocked
645
- threadOf {
764
+ data {
646
765
  id
766
+ content
767
+ blocked
768
+ threadOf {
769
+ id
770
+ }
771
+ author {
772
+ id
773
+ name
774
+ }
775
+ reactions {
776
+ slug
777
+ count
778
+ }
647
779
  }
648
- author {
649
- id
650
- name
780
+ meta {
781
+ reactions {
782
+ documentId
783
+ counts {
784
+ slug
785
+ count
786
+ }
787
+ }
651
788
  }
652
789
  }
653
790
  }
654
791
  ```
655
792
 
793
+ > **Reactions:** With integration enabled, `findAllFlat` returns the same per-comment `reactions` list plus optional `meta.reactions` for the current result set.
794
+
656
795
  **Example response**
657
796
 
658
797
  ```json
@@ -832,6 +971,215 @@ mutation updateComment {
832
971
  }
833
972
  ```
834
973
 
974
+ ### Block or unblock a comment
975
+
976
+ _REST API equivalent: [Moderate comments (Content API) → Block or unblock a comment](#block-or-unblock-a-comment)_
977
+
978
+ Same validation and behavior as the Content API `PUT …/moderate/single/:commentId/block` and `…/unblock` routes: `id` is the comment id, `relation` identifies the entry (same string as queries use).
979
+
980
+ **Example request (block)**
981
+
982
+ ```graphql
983
+ mutation blockComment {
984
+ blockComment(
985
+ input: {
986
+ id: "2"
987
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
988
+ }
989
+ ) {
990
+ id
991
+ blocked
992
+ content
993
+ }
994
+ }
995
+ ```
996
+
997
+ **Example request (unblock)**
998
+
999
+ ```graphql
1000
+ mutation unblockComment {
1001
+ unblockComment(
1002
+ input: {
1003
+ id: "2"
1004
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1005
+ }
1006
+ ) {
1007
+ id
1008
+ blocked
1009
+ }
1010
+ }
1011
+ ```
1012
+
1013
+ ### Block or unblock a comment thread
1014
+
1015
+ _REST API equivalent: [Moderate comments (Content API) → Block or unblock a comment thread](#block-or-unblock-a-comment-thread)_
1016
+
1017
+ Same validation as the Content API `…/moderate/thread/:commentId/block` and `…/unblock` routes. `id` is the comment that heads the thread.
1018
+
1019
+ **Example request (block thread)**
1020
+
1021
+ ```graphql
1022
+ mutation blockCommentThread {
1023
+ blockCommentThread(
1024
+ input: {
1025
+ id: "2"
1026
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1027
+ }
1028
+ ) {
1029
+ id
1030
+ blockedThread
1031
+ blocked
1032
+ }
1033
+ }
1034
+ ```
1035
+
1036
+ **Example request (unblock thread)**
1037
+
1038
+ ```graphql
1039
+ mutation unblockCommentThread {
1040
+ unblockCommentThread(
1041
+ input: {
1042
+ id: "2"
1043
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1044
+ }
1045
+ ) {
1046
+ id
1047
+ blockedThread
1048
+ }
1049
+ }
1050
+ ```
1051
+
1052
+ ### Approve or reject a comment
1053
+
1054
+ _REST API equivalent: [Moderate comments (Content API) → Approve or reject a comment](#approve-or-reject-a-comment)_
1055
+
1056
+ For content types that use the approval workflow.
1057
+
1058
+ **Example request (approve)**
1059
+
1060
+ ```graphql
1061
+ mutation approveComment {
1062
+ approveComment(
1063
+ input: {
1064
+ id: "2"
1065
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1066
+ }
1067
+ ) {
1068
+ id
1069
+ approvalStatus
1070
+ }
1071
+ }
1072
+ ```
1073
+
1074
+ **Example request (reject)**
1075
+
1076
+ ```graphql
1077
+ mutation rejectComment {
1078
+ rejectComment(
1079
+ input: {
1080
+ id: "2"
1081
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1082
+ }
1083
+ ) {
1084
+ id
1085
+ approvalStatus
1086
+ }
1087
+ }
1088
+ ```
1089
+
1090
+ ### Resolve abuse reports (GraphQL)
1091
+
1092
+ Batch resolve mutations return `ReportsResolveBatch { count }` (rows updated). `resolveAbuseReport` returns a `Report` entity, like `createAbuseReport`.
1093
+
1094
+ #### Resolve a single abuse report
1095
+
1096
+ _REST API equivalent: [Moderate comments (Content API) → Resolve a single abuse report](#resolve-a-single-abuse-report)_
1097
+
1098
+ ```graphql
1099
+ mutation resolveAbuseReport {
1100
+ resolveAbuseReport(
1101
+ input: {
1102
+ id: "2"
1103
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1104
+ reportId: 15
1105
+ }
1106
+ ) {
1107
+ id
1108
+ content
1109
+ updatedAt
1110
+ }
1111
+ }
1112
+ ```
1113
+
1114
+ #### Resolve selected abuse reports for one comment
1115
+
1116
+ _REST API equivalent: [Moderate comments (Content API) → Resolve selected abuse reports for one comment](#resolve-selected-abuse-reports-for-one-comment)_
1117
+
1118
+ ```graphql
1119
+ mutation resolveCommentMultipleAbuseReports {
1120
+ resolveCommentMultipleAbuseReports(
1121
+ input: {
1122
+ id: "2"
1123
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1124
+ reportIds: [15, 16]
1125
+ }
1126
+ ) {
1127
+ count
1128
+ }
1129
+ }
1130
+ ```
1131
+
1132
+ #### Resolve all abuse reports for a comment
1133
+
1134
+ _REST API equivalent: [Moderate comments (Content API) → Resolve all abuse reports for a comment](#resolve-all-abuse-reports-for-a-comment)_
1135
+
1136
+ ```graphql
1137
+ mutation resolveAllAbuseReportsForComment {
1138
+ resolveAllAbuseReportsForComment(
1139
+ input: {
1140
+ id: "2"
1141
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1142
+ }
1143
+ ) {
1144
+ count
1145
+ }
1146
+ }
1147
+ ```
1148
+
1149
+ #### Resolve all abuse reports for a comment and its thread
1150
+
1151
+ _REST API equivalent: [Moderate comments (Content API) → Resolve all abuse reports for a comment and its thread](#resolve-all-abuse-reports-for-a-comment-and-its-thread)_
1152
+
1153
+ ```graphql
1154
+ mutation resolveAllAbuseReportsForThread {
1155
+ resolveAllAbuseReportsForThread(
1156
+ input: {
1157
+ id: "2"
1158
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1159
+ }
1160
+ ) {
1161
+ count
1162
+ }
1163
+ }
1164
+ ```
1165
+
1166
+ #### Resolve multiple abuse reports by id
1167
+
1168
+ _REST API equivalent: [Moderate comments (Content API) → Resolve multiple abuse reports by id](#resolve-multiple-abuse-reports-by-id)_
1169
+
1170
+ ```graphql
1171
+ mutation resolveMultipleAbuseReports {
1172
+ resolveMultipleAbuseReports(
1173
+ input: {
1174
+ relation: "api::page.page:njx99iv4p4txuqp307ye8625"
1175
+ reportIds: [15, 18, 22]
1176
+ }
1177
+ ) {
1178
+ count
1179
+ }
1180
+ }
1181
+ ```
1182
+
835
1183
  ### Delete Comment
836
1184
 
837
1185
  _REST API equivalent: [Public REST API -> Delete Comment](#delete-comment)_
@@ -921,7 +1269,7 @@ _Available reason enums:_ `BAD_WORDS`, `OTHER`, `DISCRIMINATION` (want more? See
921
1269
 
922
1270
  ## 🧩 Examples
923
1271
 
924
- Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-comments) repository.
1272
+ Live example of plugin usage can be found in the [Sensinum Strapi Examples](https://github.com/Sensinum/strapi-examples/tree/master/strapi-plugin-comments) repository.
925
1273
 
926
1274
  ## ⚗️ Custom fields
927
1275
 
@@ -984,6 +1332,12 @@ module.exports = {
984
1332
 
985
1333
  If you already got it, make sure that `comments` plugin is inserted before `graphql`. That should do the job.
986
1334
 
1335
+ ### Reactions integration
1336
+
1337
+ **Q:** I installed `strapi-plugin-reactions` but comment APIs do not return `reactions`. What should I check?
1338
+
1339
+ **A:** Confirm both plugins are enabled, then open **Comments → Settings**, enable **Reactions integration** (`reactionsEnabled`), save, and restart Strapi if required. The toggle is hidden until the Reactions plugin is loaded. Reaction counts appear only on read endpoints (listing comments); users still create or remove reactions through the Reactions plugin API.
1340
+
987
1341
  ## 🤝 Contributing to the plugin
988
1342
 
989
1343
  Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!
@@ -992,11 +1346,10 @@ Feel free to fork and make a Pull Request to this plugin project. All the input
992
1346
 
993
1347
  For general help using Strapi, please refer to [the official Strapi documentation](https://strapi.io/documentation/). For additional help, you can use one of these channels to ask a question:
994
1348
 
995
- - [Discord](https://discord.strapi.io/) We're present on official Strapi Discord workspace. Find us by `[VirtusLab]` prefix and DM.
996
- - [Slack - VirtusLab Open Source](https://virtuslab-oss.slack.com) We're present on a public channel #strapi-molecules
997
- - [GitHub](https://github.com/VirtusLab-Open-Source/strapi-plugin-comments/issues) (Bug reports, Contributions, Questions and Discussions)
998
- - [E-mail](mailto:strapi@virtuslab.com) - we will respond back as soon as possible
1349
+ - [Discord](https://discord.strapi.io/) We're present on official Strapi Discord workspace. Find us by `[Sensinum]` prefix and DM.
1350
+ - [GitHub](https://github.com/Sensinum/strapi-plugin-comments/issues) (Bug reports, Contributions, Questions and Discussions)
1351
+ - [E-mail](mailto:hello@sensinum.com) - we will respond back as soon as possible
999
1352
 
1000
1353
  ## 📝 License
1001
1354
 
1002
- [MIT License](LICENSE.md) Copyright (c) [VirtusLab Sp. z o.o.](https://virtuslab.com/) &amp; [Strapi Solutions](https://strapi.io/).
1355
+ [MIT License](LICENSE.md) Copyright (c) [Sensinum Sp. z o.o.](https://www.sensinum.com/).
@@ -146,6 +146,8 @@ const e = {
146
146
  "page.settings.form.badWords.hint": "If enabled, every post / update of comment is going to be checked against bad wording",
147
147
  "page.settings.form.gqlAuth.label": "GraphQL queries authorization",
148
148
  "page.settings.form.gqlAuth.hint": "If enabled, GraphQL API queries & mutations can be triggered only by Authenticated Strapi users. Otherwise API remains open.",
149
+ "page.settings.form.reactionsEnabled.label": "Reactions integration",
150
+ "page.settings.form.reactionsEnabled.hint": "If enabled, comment responses in REST and GraphQL APIs include reaction counts. Requires the Reactions plugin to be installed and enabled.",
149
151
  "page.settings.form.approvalFlow.label": "Approval flow",
150
152
  "page.settings.form.approvalFlow.hint": 'Comments associated with content type "{name}" are going to be taken through manual approval flow',
151
153
  "page.settings.form.entryLabel.label": "Title fields",
@@ -169,6 +171,7 @@ const e = {
169
171
  "page.settings.notification.restart.success": "Application has been restarted successfully",
170
172
  "page.settings.notification.restart.error": "Failed to restart your application. Try to do it manually.",
171
173
  "page.settings.loading": "Fetching configuration...",
174
+ "page.settings.error": "Failed to fetch configuration. Check console for details.",
172
175
  "page.settings.form.author.blockedProps.label": "Blocked author details",
173
176
  "page.settings.form.author.blockedProps.hint": "Specified properties will be filtered out from author's details (comma-separated)",
174
177
  "components.confirmation.dialog.header": "Confirmation",