strapi-plugin-comments 2.0.10 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +204 -124
  2. package/admin/src/components/ActionButton/styles.d.ts +2 -0
  3. package/admin/src/components/ActionButton/styles.js +13 -8
  4. package/admin/src/components/Avatar/index.d.ts +12 -0
  5. package/admin/src/components/Avatar/index.js +26 -0
  6. package/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  7. package/admin/src/components/ConfirmationDialog/index.js +36 -55
  8. package/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  9. package/admin/src/components/DiscussionStatus/index.js +22 -31
  10. package/admin/src/components/DiscussionThread/index.d.ts +16 -0
  11. package/admin/src/components/DiscussionThread/index.js +39 -56
  12. package/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  13. package/admin/src/components/DiscussionThreadItem/index.js +28 -52
  14. package/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  15. package/admin/src/components/DiscussionThreadItem/styles.js +16 -11
  16. package/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  17. package/admin/src/components/DiscussionThreadItemActions/index.js +121 -158
  18. package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  19. package/admin/src/components/DiscussionThreadItemActions/styles.js +13 -7
  20. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  21. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +38 -48
  22. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  23. package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +12 -6
  24. package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  25. package/admin/src/components/DiscussionThreadItemFooter/index.js +34 -42
  26. package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  27. package/admin/src/components/DiscussionThreadItemFooter/styles.js +17 -12
  28. package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  29. package/admin/src/components/DiscussionThreadItemReviewAction/index.js +77 -91
  30. package/admin/src/components/FormSwitch/index.d.ts +7 -0
  31. package/admin/src/components/FormSwitch/index.js +15 -18
  32. package/admin/src/components/FormSwitch/styles.d.ts +2 -0
  33. package/admin/src/components/FormSwitch/styles.js +14 -8
  34. package/admin/src/components/IconButton/styles.d.ts +2 -0
  35. package/admin/src/components/IconButton/styles.js +16 -9
  36. package/admin/src/components/Initializer/index.d.ts +5 -0
  37. package/admin/src/components/Initializer/index.js +12 -24
  38. package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  39. package/admin/src/components/LoadingIndicatorOverlay/index.js +12 -15
  40. package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  41. package/admin/src/components/LoadingIndicatorOverlay/styles.js +22 -17
  42. package/admin/src/components/Nav/index.d.ts +7 -0
  43. package/admin/src/components/Nav/index.js +25 -48
  44. package/admin/src/components/PluginIcon/index.d.ts +3 -0
  45. package/admin/src/components/PluginIcon/index.js +10 -12
  46. package/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  47. package/admin/src/components/ReportsReviewModal/index.js +31 -46
  48. package/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  49. package/admin/src/components/ReportsReviewTable/index.js +120 -140
  50. package/admin/src/components/StatusBadge/index.d.ts +7 -0
  51. package/admin/src/components/StatusBadge/index.js +12 -17
  52. package/admin/src/components/StatusBadge/styles.d.ts +2 -0
  53. package/admin/src/components/StatusBadge/styles.js +19 -13
  54. package/admin/src/components/TableFilters/index.d.ts +10 -0
  55. package/admin/src/components/TableFilters/index.js +52 -49
  56. package/admin/src/components/TablePagination/index.d.ts +17 -0
  57. package/admin/src/components/TablePagination/index.js +27 -29
  58. package/admin/src/components/icons/comments.d.ts +6 -0
  59. package/admin/src/components/icons/comments.js +11 -8
  60. package/admin/src/components/icons/index.d.ts +6 -0
  61. package/admin/src/components/icons/index.js +15 -6
  62. package/admin/src/components/icons/lock.d.ts +7 -0
  63. package/admin/src/components/icons/lock.js +11 -21
  64. package/admin/src/components/icons/review.d.ts +7 -0
  65. package/admin/src/components/icons/review.js +11 -17
  66. package/admin/src/components/icons/unlock.d.ts +7 -0
  67. package/admin/src/components/icons/unlock.js +11 -19
  68. package/admin/src/hooks/useConfig.d.ts +8 -0
  69. package/admin/src/hooks/useConfig.js +40 -45
  70. package/admin/src/index.d.ts +7 -0
  71. package/admin/src/index.js +98 -92
  72. package/admin/src/pages/App/index.d.ts +4 -0
  73. package/admin/src/pages/App/index.js +43 -67
  74. package/admin/src/pages/App/reducer/actions.d.ts +8 -0
  75. package/admin/src/pages/App/reducer/actions.js +11 -7
  76. package/admin/src/pages/App/reducer/constants.d.ts +4 -0
  77. package/admin/src/pages/App/reducer/constants.js +7 -4
  78. package/admin/src/pages/App/reducer/index.d.ts +9 -0
  79. package/admin/src/pages/App/reducer/index.js +24 -22
  80. package/admin/src/pages/App/reducer/init.d.ts +3 -0
  81. package/admin/src/pages/App/reducer/init.js +6 -4
  82. package/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  83. package/admin/src/pages/App/reducer/selectors.js +17 -34
  84. package/admin/src/pages/App/utils/api.d.ts +2 -0
  85. package/admin/src/pages/App/utils/api.js +14 -11
  86. package/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  87. package/admin/src/pages/ComingSoonPage/index.js +42 -24
  88. package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  89. package/admin/src/pages/Details/components/DetailsEntity/index.js +49 -77
  90. package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  91. package/admin/src/pages/Details/components/DetailsFilters/index.js +19 -26
  92. package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  93. package/admin/src/pages/Details/components/DetailsFilters/styles.js +14 -8
  94. package/admin/src/pages/Details/index.d.ts +4 -0
  95. package/admin/src/pages/Details/index.js +94 -133
  96. package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  97. package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +128 -139
  98. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  99. package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +14 -8
  100. package/admin/src/pages/Discover/index.d.ts +4 -0
  101. package/admin/src/pages/Discover/index.js +129 -170
  102. package/admin/src/pages/Discover/utils/api.d.ts +2 -0
  103. package/admin/src/pages/Discover/utils/api.js +15 -13
  104. package/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  105. package/admin/src/pages/Discover/utils/filtersSchema.js +8 -6
  106. package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  107. package/admin/src/pages/Settings/components/RestartAlert/styles.js +14 -8
  108. package/admin/src/pages/Settings/index.d.ts +3 -0
  109. package/admin/src/pages/Settings/index.js +225 -391
  110. package/admin/src/pages/Settings/utils/api.d.ts +7 -0
  111. package/admin/src/pages/Settings/utils/api.js +60 -55
  112. package/admin/src/pages/utils/api.d.ts +12 -0
  113. package/admin/src/pages/utils/api.js +58 -53
  114. package/admin/src/permissions.d.ts +28 -0
  115. package/admin/src/permissions.js +31 -17
  116. package/admin/src/pluginId.d.ts +2 -0
  117. package/admin/src/pluginId.js +29 -5
  118. package/admin/src/reducers.d.ts +7 -0
  119. package/admin/src/reducers.js +10 -6
  120. package/admin/src/translations/en.json +131 -131
  121. package/admin/src/translations/fr.json +132 -1
  122. package/admin/src/translations/pt-BR.json +130 -130
  123. package/admin/src/utils/axiosInstance.d.ts +3 -0
  124. package/admin/src/utils/axiosInstance.js +21 -27
  125. package/admin/src/utils/constants.d.ts +25 -0
  126. package/admin/src/utils/constants.js +23 -22
  127. package/admin/src/utils/getApiUrl.d.ts +3 -0
  128. package/admin/src/utils/getApiUrl.js +6 -5
  129. package/admin/src/utils/getMessage.d.ts +4 -0
  130. package/admin/src/utils/getMessage.js +15 -15
  131. package/admin/src/utils/getRelatedGroups.d.ts +4 -0
  132. package/admin/src/utils/getRelatedGroups.js +5 -3
  133. package/admin/src/utils/getUrl.d.ts +3 -0
  134. package/admin/src/utils/getUrl.js +6 -5
  135. package/admin/src/utils/handleAPIError.d.ts +4 -0
  136. package/admin/src/utils/handleAPIError.js +12 -11
  137. package/admin/src/utils/index.d.ts +12 -0
  138. package/admin/src/utils/index.js +29 -11
  139. package/admin/src/utils/parseRegExp.d.ts +6 -0
  140. package/admin/src/utils/parseRegExp.js +6 -5
  141. package/admin/src/utils/renderEntryTitle.d.ts +4 -0
  142. package/admin/src/utils/renderEntryTitle.js +11 -12
  143. package/admin/src/utils/renderInitials.d.ts +3 -0
  144. package/admin/src/utils/renderInitials.js +10 -5
  145. package/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  146. package/admin/src/utils/resolveCommentStatus.js +17 -21
  147. package/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  148. package/admin/src/utils/resolveCommentStatusColor.js +19 -19
  149. package/content-types/comment.d.ts +91 -0
  150. package/content-types/comment.js +87 -88
  151. package/content-types/index.d.ts +143 -0
  152. package/content-types/index.js +15 -10
  153. package/content-types/report.d.ts +48 -0
  154. package/content-types/report.js +44 -49
  155. package/package.json +24 -19
  156. package/permissions.d.ts +18 -0
  157. package/permissions.js +12 -13
  158. package/server/bootstrap.d.ts +4 -0
  159. package/server/bootstrap.js +56 -62
  160. package/server/config/index.d.ts +4 -0
  161. package/server/config/index.js +17 -15
  162. package/server/controllers/admin.d.ts +4 -0
  163. package/server/controllers/admin.js +134 -167
  164. package/server/controllers/client.d.ts +4 -0
  165. package/server/controllers/client.js +120 -112
  166. package/server/controllers/index.d.ts +6 -0
  167. package/server/controllers/index.js +12 -8
  168. package/server/controllers/utils/functions.d.ts +7 -0
  169. package/server/controllers/utils/functions.js +22 -17
  170. package/server/controllers/utils/parsers.d.ts +10 -0
  171. package/server/controllers/utils/parsers.js +47 -19
  172. package/server/destroy.d.ts +3 -0
  173. package/server/destroy.js +3 -4
  174. package/server/graphql/index.d.ts +4 -0
  175. package/server/graphql/index.js +27 -25
  176. package/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  177. package/server/graphql/mutations/createAbuseReport.js +22 -24
  178. package/server/graphql/mutations/createComment.d.ts +14 -0
  179. package/server/graphql/mutations/createComment.js +22 -24
  180. package/server/graphql/mutations/index.d.ts +4 -0
  181. package/server/graphql/mutations/index.js +24 -19
  182. package/server/graphql/mutations/removeComment.d.ts +11 -0
  183. package/server/graphql/mutations/removeComment.js +22 -24
  184. package/server/graphql/mutations/updateComment.d.ts +11 -0
  185. package/server/graphql/mutations/updateComment.js +22 -24
  186. package/server/graphql/queries/findAllFlat.d.ts +19 -0
  187. package/server/graphql/queries/findAllFlat.js +36 -34
  188. package/server/graphql/queries/findAllInHierarchy.d.ts +17 -0
  189. package/server/graphql/queries/findAllInHierarchy.js +30 -30
  190. package/server/graphql/queries/index.d.ts +4 -0
  191. package/server/graphql/queries/index.js +20 -17
  192. package/server/graphql/resolvers-config.d.ts +23 -0
  193. package/server/graphql/resolvers-config.js +11 -11
  194. package/server/graphql/types/comment-author.d.ts +4 -0
  195. package/server/graphql/types/comment-author.js +10 -8
  196. package/server/graphql/types/comment-nested.d.ts +4 -0
  197. package/server/graphql/types/comment-nested.js +17 -15
  198. package/server/graphql/types/comment.d.ts +4 -0
  199. package/server/graphql/types/comment.js +16 -14
  200. package/server/graphql/types/create-comment-author.d.ts +4 -0
  201. package/server/graphql/types/create-comment-author.js +10 -8
  202. package/server/graphql/types/create-comment.d.ts +4 -0
  203. package/server/graphql/types/create-comment.js +10 -8
  204. package/server/graphql/types/create-report.d.ts +4 -0
  205. package/server/graphql/types/create-report.js +10 -8
  206. package/server/graphql/types/id.d.ts +4 -0
  207. package/server/graphql/types/id.js +24 -23
  208. package/server/graphql/types/identify-comment-author.d.ts +4 -0
  209. package/server/graphql/types/identify-comment-author.js +7 -5
  210. package/server/graphql/types/index.d.ts +4 -0
  211. package/server/graphql/types/index.js +36 -17
  212. package/server/graphql/types/remove-comment.d.ts +4 -0
  213. package/server/graphql/types/remove-comment.js +9 -7
  214. package/server/graphql/types/report-reason.d.ts +4 -0
  215. package/server/graphql/types/report-reason.js +10 -8
  216. package/server/graphql/types/report.d.ts +4 -0
  217. package/server/graphql/types/report.js +12 -10
  218. package/server/graphql/types/response-find-all.d.ts +4 -0
  219. package/server/graphql/types/response-find-all.js +8 -6
  220. package/server/graphql/types/response-meta.d.ts +4 -0
  221. package/server/graphql/types/response-meta.js +7 -5
  222. package/server/graphql/types/response-pagination.d.ts +4 -0
  223. package/server/graphql/types/response-pagination.js +12 -10
  224. package/server/graphql/types/update-comment.d.ts +4 -0
  225. package/server/graphql/types/update-comment.js +10 -8
  226. package/server/index.d.ts +26 -0
  227. package/server/index.js +24 -21
  228. package/server/register.d.ts +3 -0
  229. package/server/register.js +3 -4
  230. package/server/routes/admin.d.ts +4 -0
  231. package/server/routes/admin.js +103 -109
  232. package/server/routes/client.d.ts +4 -0
  233. package/server/routes/client.js +84 -46
  234. package/server/routes/index.d.ts +11 -0
  235. package/server/routes/index.js +18 -14
  236. package/server/services/admin.d.ts +5 -0
  237. package/server/services/admin.js +134 -161
  238. package/server/services/client.d.ts +5 -0
  239. package/server/services/client.js +164 -168
  240. package/server/services/common.d.ts +5 -0
  241. package/server/services/common.js +192 -202
  242. package/server/services/graphql.d.ts +5 -0
  243. package/server/services/graphql.js +117 -182
  244. package/server/services/index.d.ts +8 -0
  245. package/server/services/index.js +15 -12
  246. package/server/services/utils/functions.d.ts +13 -0
  247. package/server/services/utils/functions.js +105 -109
  248. package/server/utils/constants.d.ts +9 -0
  249. package/server/utils/constants.js +19 -23
  250. package/server/utils/error.d.ts +19 -0
  251. package/server/utils/error.js +23 -18
  252. package/server/utils/functions.d.ts +6 -0
  253. package/server/utils/functions.js +35 -18
  254. package/strapi-admin.d.ts +3 -0
  255. package/strapi-admin.js +8 -3
  256. package/strapi-server.d.ts +177 -0
  257. package/strapi-server.js +43 -46
  258. package/tsconfig.tsbuildinfo +1 -0
  259. package/types/contentTypes.d.ts +48 -0
  260. package/types/contentTypes.js +3 -0
  261. package/.husky/pre-commit +0 -4
  262. package/LICENSE.md +0 -7
  263. package/__mocks__/initSetup.js +0 -108
  264. package/jest.config.js +0 -7
  265. package/server/controllers/utils/__tests__/functions.test.js +0 -43
  266. package/server/controllers/utils/__tests__/parsers.test.js +0 -94
  267. package/server/services/__tests__/common.test.js +0 -399
  268. package/server/services/utils/__tests__/functions.test.js +0 -53
  269. package/server/utils/__tests__/functions.test.js +0 -17
@@ -1,54 +1,49 @@
1
- /**
2
- * Comments Collection Type
3
- */
4
-
5
- module.exports = {
6
- info: {
7
- tableName: 'plugin-comments-reports',
8
- singularName: 'comment-report',
9
- pluralName: 'comment-reports',
10
- displayName: 'Reports',
11
- description: 'Reports content type',
12
- kind: 'collectionType',
13
- },
14
- options: {
15
- draftAndPublish: false,
16
- },
17
- pluginOptions: {
18
- 'content-manager': {
19
- visible: false
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ info: {
5
+ tableName: "plugin-comments-reports",
6
+ singularName: "comment-report",
7
+ pluralName: "comment-reports",
8
+ displayName: "Reports",
9
+ description: "Reports content type",
10
+ kind: "collectionType",
20
11
  },
21
- 'content-type-builder': {
22
- visible: false
23
- }
24
- },
25
- attributes: {
26
- content: {
27
- type: 'text',
28
- configurable: false
12
+ options: {
13
+ draftAndPublish: false,
29
14
  },
30
- reason: {
31
- type: 'enumeration',
32
- enum: [
33
- 'BAD_LANGUAGE',
34
- 'DISCRIMINATION',
35
- 'OTHER'
36
- ],
37
- default: 'OTHER',
38
- configurable: false,
39
- required: true
15
+ pluginOptions: {
16
+ "content-manager": {
17
+ visible: false,
18
+ },
19
+ "content-type-builder": {
20
+ visible: false,
21
+ },
40
22
  },
41
- resolved: {
42
- type: 'boolean',
43
- default: false,
44
- configurable: false
23
+ attributes: {
24
+ content: {
25
+ type: "text",
26
+ configurable: false,
27
+ },
28
+ reason: {
29
+ type: "enumeration",
30
+ enum: ["BAD_LANGUAGE", "DISCRIMINATION", "OTHER"],
31
+ default: "OTHER",
32
+ configurable: false,
33
+ required: true,
34
+ },
35
+ resolved: {
36
+ type: "boolean",
37
+ default: false,
38
+ configurable: false,
39
+ },
40
+ related: {
41
+ type: "relation",
42
+ relation: "manyToOne",
43
+ target: "plugin::comments.comment",
44
+ inversedBy: "reports",
45
+ configurable: false,
46
+ },
45
47
  },
46
- related: {
47
- type: 'relation',
48
- relation: 'manyToOne',
49
- target: 'plugin::comments.comment',
50
- inversedBy: 'reports',
51
- configurable: false,
52
- },
53
- },
54
48
  };
49
+ //# sourceMappingURL=report.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-comments",
3
- "version": "2.0.10",
3
+ "version": "2.1.0",
4
4
  "description": "Strapi - Comments plugin",
5
5
  "strapi": {
6
6
  "name": "comments",
@@ -8,32 +8,33 @@
8
8
  "description": "Powerful Strapi based comments moderation tool for you and your users",
9
9
  "kind": "plugin"
10
10
  },
11
- "scripts": {
12
- "prepare": "husky install",
13
- "publish:latest": "npm publish --tag latest",
14
- "test:unit": "jest --verbose --coverage"
15
- },
11
+ "scripts": {},
16
12
  "repository": {
17
13
  "type": "git",
18
14
  "url": "https://github.com/VirtusLab-Open-Source/strapi-plugin-comments"
19
15
  },
20
16
  "dependencies": {
21
- "@strapi/utils": "^4.1.2",
22
- "@strapi/plugin-graphql": "^4.1.2",
17
+ "@strapi/utils": "^4.1.8",
18
+ "@strapi/plugin-graphql": "^4.1.8",
23
19
  "bad-words": "^3.0.4"
24
20
  },
25
- "devDependencies": {
26
- "codecov": "^3.7.2",
27
- "jest": "^26.0.1",
28
- "jest-cli": "^26.0.1",
29
- "jest-styled-components": "^7.0.2",
30
- "koa": "2.13.3",
31
- "husky": "7.0.4",
32
- "prettier": "2.5.1"
33
- },
21
+ "devDependencies": {},
34
22
  "peerDependencies": {
35
23
  "@strapi/strapi": "4.x"
36
24
  },
25
+ "nodemonConfig": {
26
+ "ignore": [
27
+ "./build/**/*",
28
+ "./__mocks__/*",
29
+ "./**/__tests__/*"
30
+ ],
31
+ "ext": "js,json,ts"
32
+ },
33
+ "husky": {
34
+ "hooks": {
35
+ "pre-commit": "yarn format && yarn test:unit"
36
+ }
37
+ },
37
38
  "author": {
38
39
  "name": "VirtusLab",
39
40
  "email": "strapi@virtuslab.com",
@@ -55,6 +56,10 @@
55
56
  "node": ">=14.x.x <=17.x.x",
56
57
  "npm": ">=7.x.x"
57
58
  },
58
- "keywords": ["strapi", "plugin", "comments"],
59
+ "keywords": [
60
+ "strapi",
61
+ "plugin",
62
+ "comments"
63
+ ],
59
64
  "license": "MIT"
60
- }
65
+ }
@@ -0,0 +1,18 @@
1
+ import { ToBeFixed } from "./types/common";
2
+ declare const _default: {
3
+ render: (uid: ToBeFixed) => string;
4
+ comments: {
5
+ read: string;
6
+ moderate: string;
7
+ };
8
+ reports: {
9
+ read: string;
10
+ action: string;
11
+ };
12
+ settings: {
13
+ read: string;
14
+ change: string;
15
+ };
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=permissions.d.ts.map
package/permissions.js CHANGED
@@ -1,19 +1,18 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- render: function(uid) {
5
- return `plugin::comments.${uid}`;
6
- },
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ render: (uid) => `plugin::comments.${uid}`,
7
5
  comments: {
8
- read: 'read',
9
- moderate: 'moderate',
6
+ read: "read",
7
+ moderate: "moderate",
10
8
  },
11
9
  reports: {
12
- read: 'reports.read',
13
- action: 'reports.action',
10
+ read: "reports.read",
11
+ action: "reports.action",
14
12
  },
15
13
  settings: {
16
- read: 'settings.read',
17
- change: 'settings.change',
14
+ read: "settings.read",
15
+ change: "settings.change",
18
16
  },
19
- };
17
+ };
18
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1,4 @@
1
+ import { StrapiContext } from "strapi-typed";
2
+ declare const _default: ({ strapi }: StrapiContext) => Promise<void>;
3
+ export = _default;
4
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -1,65 +1,59 @@
1
- 'use strict';
2
-
3
- const { isEmpty } = require('lodash');
4
- const permissions = require('./../permissions');
5
- const { getPluginService } = require('./utils/functions');
6
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const lodash_1 = require("lodash");
6
+ const permissions_1 = __importDefault(require("./../permissions"));
7
+ const functions_1 = require("./utils/functions");
7
8
  module.exports = async ({ strapi }) => {
8
-
9
- // Provide GQL support
10
- if (strapi.plugin('graphql')) {
11
- const config = await getPluginService('common').getConfig();
12
- const { enabledCollections } = config;
13
- if (!isEmpty(enabledCollections)) {
14
- await require('./graphql')({ strapi, config });
9
+ if (strapi.plugin("graphql")) {
10
+ const config = await (0, functions_1.getPluginService)("common").getConfig();
11
+ const { enabledCollections } = config;
12
+ if (!(0, lodash_1.isEmpty)(enabledCollections)) {
13
+ await require("./graphql")({ strapi, config });
14
+ }
15
+ }
16
+ if (Object.keys(strapi.plugins).indexOf("users-permissions") === -1) {
17
+ throw new Error("In order to make the comments plugin work the users-permissions plugin is required");
15
18
  }
16
- }
17
-
18
- // Check if the plugin users-permissions is installed because the navigation needs it
19
- if (Object.keys(strapi.plugins).indexOf("users-permissions") === -1) {
20
- throw new Error(
21
- "In order to make the comments plugin work the users-permissions plugin is required",
22
- );
23
- }
24
- // Add permissions
25
- const actions = [
26
- {
27
- section: "plugins",
28
- displayName: "Comments: Read",
29
- uid: permissions.comments.read,
30
- pluginName: "comments",
31
- },
32
- {
33
- section: "plugins",
34
- displayName: "Comments: Moderate",
35
- uid: permissions.comments.moderate,
36
- pluginName: "comments",
37
- },
38
- {
39
- section: "plugins",
40
- displayName: "Reports: Read",
41
- uid: permissions.reports.read,
42
- pluginName: "comments",
43
- },
44
- {
45
- section: "plugins",
46
- displayName: "Reports: Moderate",
47
- uid: permissions.reports.action,
48
- pluginName: "comments",
49
- },
50
- {
51
- section: "plugins",
52
- displayName: "Settings: Read",
53
- uid: permissions.settings.read,
54
- pluginName: "comments",
55
- },
56
- {
57
- section: "plugins",
58
- displayName: "Settings: Change",
59
- uid: permissions.settings.change,
60
- pluginName: "comments",
61
- },
62
- ];
63
-
64
- await strapi.admin.services.permission.actionProvider.registerMany(actions);
19
+ const actions = [
20
+ {
21
+ section: "plugins",
22
+ displayName: "Comments: Read",
23
+ uid: permissions_1.default.comments.read,
24
+ pluginName: "comments",
25
+ },
26
+ {
27
+ section: "plugins",
28
+ displayName: "Comments: Moderate",
29
+ uid: permissions_1.default.comments.moderate,
30
+ pluginName: "comments",
31
+ },
32
+ {
33
+ section: "plugins",
34
+ displayName: "Reports: Read",
35
+ uid: permissions_1.default.reports.read,
36
+ pluginName: "comments",
37
+ },
38
+ {
39
+ section: "plugins",
40
+ displayName: "Reports: Moderate",
41
+ uid: permissions_1.default.reports.action,
42
+ pluginName: "comments",
43
+ },
44
+ {
45
+ section: "plugins",
46
+ displayName: "Settings: Read",
47
+ uid: permissions_1.default.settings.read,
48
+ pluginName: "comments",
49
+ },
50
+ {
51
+ section: "plugins",
52
+ displayName: "Settings: Change",
53
+ uid: permissions_1.default.settings.change,
54
+ pluginName: "comments",
55
+ },
56
+ ];
57
+ await strapi.admin.services.permission.actionProvider.registerMany(actions);
65
58
  };
59
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1,4 @@
1
+ import { StrapiConfig } from "../../types";
2
+ declare const config: StrapiConfig;
3
+ export default config;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,19 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- default: {
5
- enabledCollections: [],
6
- moderatorRoles: [],
7
- approvalFlow: [],
8
- entryLabel: {
9
- '*': ['Title', 'title', 'Name', 'name', 'Subject', 'subject']
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config = {
4
+ default: {
5
+ enabledCollections: [],
6
+ moderatorRoles: [],
7
+ approvalFlow: [],
8
+ entryLabel: {
9
+ "*": ["Title", "title", "Name", "name", "Subject", "subject"],
10
+ },
11
+ reportReasons: {
12
+ BAD_LANGUAGE: "BAD_LANGUAGE",
13
+ DISCRIMINATION: "DISCRIMINATION",
14
+ OTHER: "OTHER",
15
+ },
10
16
  },
11
- reportReasons: {
12
- 'BAD_LANGUAGE': 'BAD_LANGUAGE',
13
- 'DISCRIMINATION': 'DISCRIMINATION',
14
- 'OTHER': 'OTHER',
15
- },
16
- }
17
17
  };
18
+ exports.default = config;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import { IControllerAdmin } from "../../types";
2
+ declare const controllers: IControllerAdmin;
3
+ export default controllers;
4
+ //# sourceMappingURL=admin.d.ts.map