strapi-plugin-comments 2.0.10 → 2.0.11

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 (261) hide show
  1. package/README.md +39 -5
  2. package/admin/src/translations/fr.json +132 -1
  3. package/build/README.md +818 -0
  4. package/build/admin/src/components/ActionButton/styles.d.ts +2 -0
  5. package/build/admin/src/components/ActionButton/styles.js +17 -0
  6. package/build/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
  7. package/build/admin/src/components/ConfirmationDialog/index.js +104 -0
  8. package/build/admin/src/components/DiscussionStatus/index.d.ts +9 -0
  9. package/build/admin/src/components/DiscussionStatus/index.js +38 -0
  10. package/build/admin/src/components/DiscussionThread/index.d.ts +16 -0
  11. package/build/admin/src/components/DiscussionThread/index.js +99 -0
  12. package/build/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
  13. package/build/admin/src/components/DiscussionThreadItem/index.js +72 -0
  14. package/build/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
  15. package/build/admin/src/components/DiscussionThreadItem/styles.js +27 -0
  16. package/build/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
  17. package/build/admin/src/components/DiscussionThreadItemActions/index.js +414 -0
  18. package/build/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
  19. package/build/admin/src/components/DiscussionThreadItemActions/styles.js +17 -0
  20. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
  21. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +103 -0
  22. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
  23. package/build/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +15 -0
  24. package/build/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
  25. package/build/admin/src/components/DiscussionThreadItemFooter/index.js +73 -0
  26. package/build/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
  27. package/build/admin/src/components/DiscussionThreadItemFooter/styles.js +25 -0
  28. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
  29. package/build/admin/src/components/DiscussionThreadItemReviewAction/index.js +233 -0
  30. package/build/admin/src/components/FormSwitch/index.d.ts +11 -0
  31. package/build/admin/src/components/FormSwitch/index.js +39 -0
  32. package/build/admin/src/components/FormSwitch/styles.d.ts +2 -0
  33. package/build/admin/src/components/FormSwitch/styles.js +16 -0
  34. package/build/admin/src/components/IconButton/styles.d.ts +2 -0
  35. package/build/admin/src/components/IconButton/styles.js +27 -0
  36. package/build/admin/src/components/Initializer/index.d.ts +3 -0
  37. package/build/admin/src/components/Initializer/index.js +14 -0
  38. package/build/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
  39. package/build/admin/src/components/LoadingIndicatorOverlay/index.js +18 -0
  40. package/build/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
  41. package/build/admin/src/components/LoadingIndicatorOverlay/styles.js +32 -0
  42. package/build/admin/src/components/Nav/index.d.ts +7 -0
  43. package/build/admin/src/components/Nav/index.js +72 -0
  44. package/build/admin/src/components/PluginIcon/index.d.ts +3 -0
  45. package/build/admin/src/components/PluginIcon/index.js +13 -0
  46. package/build/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
  47. package/build/admin/src/components/ReportsReviewModal/index.js +72 -0
  48. package/build/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
  49. package/build/admin/src/components/ReportsReviewTable/index.js +321 -0
  50. package/build/admin/src/components/StatusBadge/index.d.ts +11 -0
  51. package/build/admin/src/components/StatusBadge/index.js +22 -0
  52. package/build/admin/src/components/StatusBadge/styles.d.ts +2 -0
  53. package/build/admin/src/components/StatusBadge/styles.js +25 -0
  54. package/build/admin/src/components/TableFilters/index.d.ts +10 -0
  55. package/build/admin/src/components/TableFilters/index.js +109 -0
  56. package/build/admin/src/components/TablePagination/index.d.ts +15 -0
  57. package/build/admin/src/components/TablePagination/index.js +45 -0
  58. package/build/admin/src/components/icons/comments.d.ts +9 -0
  59. package/build/admin/src/components/icons/comments.js +23 -0
  60. package/build/admin/src/components/icons/index.d.ts +6 -0
  61. package/build/admin/src/components/icons/index.js +21 -0
  62. package/build/admin/src/components/icons/lock.d.ts +11 -0
  63. package/build/admin/src/components/icons/lock.js +29 -0
  64. package/build/admin/src/components/icons/review.d.ts +11 -0
  65. package/build/admin/src/components/icons/review.js +31 -0
  66. package/build/admin/src/components/icons/unlock.d.ts +11 -0
  67. package/build/admin/src/components/icons/unlock.js +29 -0
  68. package/build/admin/src/hooks/useConfig.d.ts +8 -0
  69. package/build/admin/src/hooks/useConfig.js +52 -0
  70. package/build/admin/src/index.d.ts +7 -0
  71. package/build/admin/src/index.js +137 -0
  72. package/build/admin/src/pages/App/index.d.ts +4 -0
  73. package/build/admin/src/pages/App/index.js +90 -0
  74. package/build/admin/src/pages/App/reducer/actions.d.ts +8 -0
  75. package/build/admin/src/pages/App/reducer/actions.js +12 -0
  76. package/build/admin/src/pages/App/reducer/constants.d.ts +4 -0
  77. package/build/admin/src/pages/App/reducer/constants.js +7 -0
  78. package/build/admin/src/pages/App/reducer/index.d.ts +14 -0
  79. package/build/admin/src/pages/App/reducer/index.js +31 -0
  80. package/build/admin/src/pages/App/reducer/init.d.ts +3 -0
  81. package/build/admin/src/pages/App/reducer/init.js +9 -0
  82. package/build/admin/src/pages/App/reducer/selectors.d.ts +6 -0
  83. package/build/admin/src/pages/App/reducer/selectors.js +20 -0
  84. package/build/admin/src/pages/App/utils/api.d.ts +2 -0
  85. package/build/admin/src/pages/App/utils/api.js +16 -0
  86. package/build/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
  87. package/build/admin/src/pages/ComingSoonPage/index.js +78 -0
  88. package/build/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
  89. package/build/admin/src/pages/Details/components/DetailsEntity/index.js +132 -0
  90. package/build/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
  91. package/build/admin/src/pages/Details/components/DetailsFilters/index.js +48 -0
  92. package/build/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
  93. package/build/admin/src/pages/Details/components/DetailsFilters/styles.js +16 -0
  94. package/build/admin/src/pages/Details/index.d.ts +4 -0
  95. package/build/admin/src/pages/Details/index.js +216 -0
  96. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
  97. package/build/admin/src/pages/Discover/components/DiscoverTableRow/index.js +344 -0
  98. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
  99. package/build/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +16 -0
  100. package/build/admin/src/pages/Discover/index.d.ts +4 -0
  101. package/build/admin/src/pages/Discover/index.js +332 -0
  102. package/build/admin/src/pages/Discover/utils/api.d.ts +2 -0
  103. package/build/admin/src/pages/Discover/utils/api.js +23 -0
  104. package/build/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
  105. package/build/admin/src/pages/Discover/utils/filtersSchema.js +11 -0
  106. package/build/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
  107. package/build/admin/src/pages/Settings/components/RestartAlert/styles.js +16 -0
  108. package/build/admin/src/pages/Settings/index.d.ts +3 -0
  109. package/build/admin/src/pages/Settings/index.js +712 -0
  110. package/build/admin/src/pages/Settings/utils/api.d.ts +7 -0
  111. package/build/admin/src/pages/Settings/utils/api.js +80 -0
  112. package/build/admin/src/pages/utils/api.d.ts +12 -0
  113. package/build/admin/src/pages/utils/api.js +83 -0
  114. package/build/admin/src/permissions.d.ts +28 -0
  115. package/build/admin/src/permissions.js +65 -0
  116. package/build/admin/src/pluginId.d.ts +2 -0
  117. package/build/admin/src/pluginId.js +50 -0
  118. package/build/admin/src/reducers.d.ts +12 -0
  119. package/build/admin/src/reducers.js +14 -0
  120. package/build/admin/src/translations/en.json +132 -0
  121. package/build/admin/src/translations/fr.json +1 -0
  122. package/build/admin/src/translations/pt-BR.json +132 -0
  123. package/build/admin/src/utils/axiosInstance.d.ts +3 -0
  124. package/build/admin/src/utils/axiosInstance.js +37 -0
  125. package/build/admin/src/utils/constants.d.ts +25 -0
  126. package/build/admin/src/utils/constants.js +30 -0
  127. package/build/admin/src/utils/getApiUrl.d.ts +3 -0
  128. package/build/admin/src/utils/getApiUrl.js +6 -0
  129. package/build/admin/src/utils/getMessage.d.ts +4 -0
  130. package/build/admin/src/utils/getMessage.js +25 -0
  131. package/build/admin/src/utils/getRelatedGroups.d.ts +4 -0
  132. package/build/admin/src/utils/getRelatedGroups.js +6 -0
  133. package/build/admin/src/utils/getUrl.d.ts +3 -0
  134. package/build/admin/src/utils/getUrl.js +6 -0
  135. package/build/admin/src/utils/handleAPIError.d.ts +4 -0
  136. package/build/admin/src/utils/handleAPIError.js +20 -0
  137. package/build/admin/src/utils/index.d.ts +12 -0
  138. package/build/admin/src/utils/index.js +97 -0
  139. package/build/admin/src/utils/parseRegExp.d.ts +6 -0
  140. package/build/admin/src/utils/parseRegExp.js +11 -0
  141. package/build/admin/src/utils/renderEntryTitle.d.ts +4 -0
  142. package/build/admin/src/utils/renderEntryTitle.js +16 -0
  143. package/build/admin/src/utils/renderInitials.d.ts +3 -0
  144. package/build/admin/src/utils/renderInitials.js +11 -0
  145. package/build/admin/src/utils/resolveCommentStatus.d.ts +4 -0
  146. package/build/admin/src/utils/resolveCommentStatus.js +32 -0
  147. package/build/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
  148. package/build/admin/src/utils/resolveCommentStatusColor.js +22 -0
  149. package/build/content-types/comment.d.ts +91 -0
  150. package/build/content-types/comment.js +92 -0
  151. package/build/content-types/index.d.ts +143 -0
  152. package/build/content-types/index.js +18 -0
  153. package/build/content-types/report.d.ts +48 -0
  154. package/build/content-types/report.js +49 -0
  155. package/build/package.json +94 -0
  156. package/build/permissions.d.ts +18 -0
  157. package/build/permissions.js +18 -0
  158. package/build/server/bootstrap.d.ts +4 -0
  159. package/build/server/bootstrap.js +65 -0
  160. package/build/server/config/index.d.ts +4 -0
  161. package/build/server/config/index.js +19 -0
  162. package/build/server/controllers/admin.d.ts +4 -0
  163. package/build/server/controllers/admin.js +124 -0
  164. package/build/server/controllers/client.d.ts +4 -0
  165. package/build/server/controllers/client.js +111 -0
  166. package/build/server/controllers/index.d.ts +6 -0
  167. package/build/server/controllers/index.js +15 -0
  168. package/build/server/controllers/utils/functions.d.ts +7 -0
  169. package/build/server/controllers/utils/functions.js +24 -0
  170. package/build/server/controllers/utils/parsers.d.ts +15 -0
  171. package/build/server/controllers/utils/parsers.js +25 -0
  172. package/build/server/destroy.d.ts +3 -0
  173. package/build/server/destroy.js +3 -0
  174. package/build/server/graphql/index.d.ts +4 -0
  175. package/build/server/graphql/index.js +37 -0
  176. package/build/server/graphql/mutations/createAbuseReport.d.ts +11 -0
  177. package/build/server/graphql/mutations/createAbuseReport.js +27 -0
  178. package/build/server/graphql/mutations/createComment.d.ts +14 -0
  179. package/build/server/graphql/mutations/createComment.js +26 -0
  180. package/build/server/graphql/mutations/index.d.ts +4 -0
  181. package/build/server/graphql/mutations/index.js +28 -0
  182. package/build/server/graphql/mutations/removeComment.d.ts +11 -0
  183. package/build/server/graphql/mutations/removeComment.js +27 -0
  184. package/build/server/graphql/mutations/updateComment.d.ts +11 -0
  185. package/build/server/graphql/mutations/updateComment.js +27 -0
  186. package/build/server/graphql/queries/findAllFlat.d.ts +19 -0
  187. package/build/server/graphql/queries/findAllFlat.js +47 -0
  188. package/build/server/graphql/queries/findAllInHierarchy.d.ts +18 -0
  189. package/build/server/graphql/queries/findAllInHierarchy.js +38 -0
  190. package/build/server/graphql/queries/index.d.ts +4 -0
  191. package/build/server/graphql/queries/index.js +24 -0
  192. package/build/server/graphql/resolvers-config.d.ts +23 -0
  193. package/build/server/graphql/resolvers-config.js +13 -0
  194. package/build/server/graphql/types/comment-author.d.ts +4 -0
  195. package/build/server/graphql/types/comment-author.js +12 -0
  196. package/build/server/graphql/types/comment-nested.d.ts +4 -0
  197. package/build/server/graphql/types/comment-nested.js +19 -0
  198. package/build/server/graphql/types/comment.d.ts +4 -0
  199. package/build/server/graphql/types/comment.js +18 -0
  200. package/build/server/graphql/types/create-comment-author.d.ts +4 -0
  201. package/build/server/graphql/types/create-comment-author.js +12 -0
  202. package/build/server/graphql/types/create-comment.d.ts +4 -0
  203. package/build/server/graphql/types/create-comment.js +12 -0
  204. package/build/server/graphql/types/create-report.d.ts +4 -0
  205. package/build/server/graphql/types/create-report.js +12 -0
  206. package/build/server/graphql/types/id.d.ts +4 -0
  207. package/build/server/graphql/types/id.js +26 -0
  208. package/build/server/graphql/types/identify-comment-author.d.ts +4 -0
  209. package/build/server/graphql/types/identify-comment-author.js +9 -0
  210. package/build/server/graphql/types/index.d.ts +4 -0
  211. package/build/server/graphql/types/index.js +44 -0
  212. package/build/server/graphql/types/remove-comment.d.ts +4 -0
  213. package/build/server/graphql/types/remove-comment.js +11 -0
  214. package/build/server/graphql/types/report-reason.d.ts +4 -0
  215. package/build/server/graphql/types/report-reason.js +12 -0
  216. package/build/server/graphql/types/report.d.ts +4 -0
  217. package/build/server/graphql/types/report.js +14 -0
  218. package/build/server/graphql/types/response-find-all.d.ts +4 -0
  219. package/build/server/graphql/types/response-find-all.js +10 -0
  220. package/build/server/graphql/types/response-meta.d.ts +4 -0
  221. package/build/server/graphql/types/response-meta.js +9 -0
  222. package/build/server/graphql/types/response-pagination.d.ts +4 -0
  223. package/build/server/graphql/types/response-pagination.js +14 -0
  224. package/build/server/graphql/types/update-comment.d.ts +4 -0
  225. package/build/server/graphql/types/update-comment.js +12 -0
  226. package/build/server/index.d.ts +26 -0
  227. package/build/server/index.js +25 -0
  228. package/build/server/register.d.ts +3 -0
  229. package/build/server/register.js +3 -0
  230. package/build/server/routes/admin.d.ts +4 -0
  231. package/build/server/routes/admin.js +118 -0
  232. package/build/server/routes/client.d.ts +4 -0
  233. package/build/server/routes/client.js +54 -0
  234. package/build/server/routes/index.d.ts +11 -0
  235. package/build/server/routes/index.js +21 -0
  236. package/build/server/services/admin.d.ts +5 -0
  237. package/build/server/services/admin.js +296 -0
  238. package/build/server/services/client.d.ts +5 -0
  239. package/build/server/services/client.js +247 -0
  240. package/build/server/services/common.d.ts +5 -0
  241. package/build/server/services/common.js +266 -0
  242. package/build/server/services/graphql.d.ts +5 -0
  243. package/build/server/services/graphql.js +136 -0
  244. package/build/server/services/index.d.ts +8 -0
  245. package/build/server/services/index.js +16 -0
  246. package/build/server/services/utils/functions.d.ts +13 -0
  247. package/build/server/services/utils/functions.js +141 -0
  248. package/build/server/utils/constants.d.ts +9 -0
  249. package/build/server/utils/constants.js +23 -0
  250. package/build/server/utils/error.d.ts +23 -0
  251. package/build/server/utils/error.js +29 -0
  252. package/build/server/utils/functions.d.ts +14 -0
  253. package/build/server/utils/functions.js +50 -0
  254. package/build/strapi-admin.d.ts +3 -0
  255. package/build/strapi-admin.js +10 -0
  256. package/build/strapi-server.d.ts +177 -0
  257. package/build/strapi-server.js +46 -0
  258. package/build/tsconfig.tsbuildinfo +1 -0
  259. package/build/types/contentTypes.d.ts +46 -0
  260. package/build/types/contentTypes.js +3 -0
  261. package/package.json +3 -3
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const axios_1 = __importDefault(require("axios"));
9
+ const helper_plugin_1 = require("@strapi/helper-plugin");
10
+ const instance = axios_1.default.create({
11
+ baseURL: process.env.STRAPI_ADMIN_BACKEND_URL,
12
+ });
13
+ instance.interceptors.request.use(
14
+ async (config) => {
15
+ config.headers = {
16
+ Authorization: `Bearer ${helper_plugin_1.auth.getToken()}`,
17
+ Accept: "application/json",
18
+ "Content-Type": "application/json",
19
+ };
20
+ return config;
21
+ },
22
+ (error) => {
23
+ Promise.reject(error);
24
+ }
25
+ );
26
+ instance.interceptors.response.use(
27
+ (response) => response,
28
+ (error) => {
29
+ if (error.response?.status === 401) {
30
+ helper_plugin_1.auth.clearAppStorage();
31
+ window.location.reload();
32
+ }
33
+ throw error;
34
+ }
35
+ );
36
+ exports.default = instance;
37
+ //# sourceMappingURL=axiosInstance.js.map
@@ -0,0 +1,25 @@
1
+ export declare const APPROVAL_STATUS: {
2
+ PENDING: string;
3
+ APPROVED: string;
4
+ REJECTED: string;
5
+ };
6
+ export declare const REPORT_STATUS: {
7
+ RESOLVED: string;
8
+ OPEN: string;
9
+ };
10
+ export declare const REPORT_REASON: {
11
+ BAD_LANGUAGE: string;
12
+ DISCRIMINATION: string;
13
+ OTHER: string;
14
+ };
15
+ export declare const COMMENT_STATUS: {
16
+ PENDING: string;
17
+ APPROVED: string;
18
+ REJECTED: string;
19
+ UNKNOWN: string;
20
+ BLOCKED: string;
21
+ OPEN: string;
22
+ REMOVED: string;
23
+ TO_REVIEW: string;
24
+ };
25
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COMMENT_STATUS =
4
+ exports.REPORT_REASON =
5
+ exports.REPORT_STATUS =
6
+ exports.APPROVAL_STATUS =
7
+ void 0;
8
+ exports.APPROVAL_STATUS = {
9
+ PENDING: "PENDING",
10
+ APPROVED: "APPROVED",
11
+ REJECTED: "REJECTED",
12
+ };
13
+ exports.REPORT_STATUS = {
14
+ RESOLVED: "RESOLVED",
15
+ OPEN: "OPEN",
16
+ };
17
+ exports.REPORT_REASON = {
18
+ BAD_LANGUAGE: "BAD_LANGUAGE",
19
+ DISCRIMINATION: "DISCRIMINATION",
20
+ OTHER: "OTHER",
21
+ };
22
+ exports.COMMENT_STATUS = {
23
+ UNKNOWN: "UNKNOWN",
24
+ BLOCKED: "BLOCKED",
25
+ OPEN: "OPEN",
26
+ REMOVED: "REMOVED",
27
+ TO_REVIEW: "TO_REVIEW",
28
+ ...exports.APPROVAL_STATUS,
29
+ };
30
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,3 @@
1
+ declare const getApiURL: (endPoint: string) => string;
2
+ export default getApiURL;
3
+ //# sourceMappingURL=getApiUrl.d.ts.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pluginId_1 = require("../pluginId");
4
+ const getApiURL = (endPoint) => `/${pluginId_1.pluginId}/${endPoint}`;
5
+ exports.default = getApiURL;
6
+ //# sourceMappingURL=getApiUrl.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const getMessage: (input: ToBeFixed, defaultMessage?: string, inPluginScope?: boolean) => any;
3
+ export default getMessage;
4
+ //# sourceMappingURL=getMessage.d.ts.map
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_intl_1 = require("react-intl");
4
+ const lodash_1 = require("lodash");
5
+ const pluginId_1 = require("../pluginId");
6
+ const getMessage = (input, defaultMessage = "", inPluginScope = true) => {
7
+ const { formatMessage } = (0, react_intl_1.useIntl)();
8
+ let formattedId = "";
9
+ if ((0, lodash_1.isString)(input)) {
10
+ formattedId = input;
11
+ } else {
12
+ formattedId = input?.id;
13
+ }
14
+ return formatMessage(
15
+ {
16
+ id: `${
17
+ inPluginScope ? pluginId_1.pluginId : "app.components"
18
+ }.${formattedId}`,
19
+ defaultMessage,
20
+ },
21
+ input?.props || undefined
22
+ );
23
+ };
24
+ exports.default = getMessage;
25
+ //# sourceMappingURL=getMessage.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const getRelatedGroups: (related: string, config: ToBeFixed) => string[];
3
+ export default getRelatedGroups;
4
+ //# sourceMappingURL=getRelatedGroups.d.ts.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getRelatedGroups = (related, config) =>
4
+ related.split(config.regex.relatedUid).filter((s) => s && s.length > 0);
5
+ exports.default = getRelatedGroups;
6
+ //# sourceMappingURL=getRelatedGroups.js.map
@@ -0,0 +1,3 @@
1
+ declare const getUrl: (path?: string) => string;
2
+ export default getUrl;
3
+ //# sourceMappingURL=getUrl.d.ts.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pluginId_1 = require("../pluginId");
4
+ const getUrl = (path = "") => `/plugins/${pluginId_1.pluginId}/${path}`;
5
+ exports.default = getUrl;
6
+ //# sourceMappingURL=getUrl.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const handleAPIError: (err?: null, toggleNotification?: ToBeFixed, message?: string) => never;
3
+ export default handleAPIError;
4
+ //# sourceMappingURL=handleAPIError.d.ts.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pluginId_1 = require("../pluginId");
4
+ const handleAPIError = (
5
+ err = null,
6
+ toggleNotification = null,
7
+ message = "app.components.notification.error"
8
+ ) => {
9
+ toggleNotification({
10
+ type: "warning",
11
+ message: `${pluginId_1.pluginId}.${message}`,
12
+ });
13
+ if (err) {
14
+ throw err;
15
+ } else {
16
+ throw new Error("error");
17
+ }
18
+ };
19
+ exports.default = handleAPIError;
20
+ //# sourceMappingURL=handleAPIError.js.map
@@ -0,0 +1,12 @@
1
+ export { default as axiosInstance } from "./axiosInstance";
2
+ export { default as getApiURL } from "./getApiUrl";
3
+ export { default as getUrl } from "./getUrl";
4
+ export { default as getMessage } from "./getMessage";
5
+ export { default as handleAPIError } from "./handleAPIError";
6
+ export { default as getRelatedGroups } from "./getRelatedGroups";
7
+ export { default as renderEntryTitle } from "./renderEntryTitle";
8
+ export { default as renderInitials } from "./renderInitials";
9
+ export { default as resolveCommentStatus } from "./resolveCommentStatus";
10
+ export { default as resolveCommentStatusColor } from "./resolveCommentStatusColor";
11
+ export { default as parseRegExp } from "./parseRegExp";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.parseRegExp =
9
+ exports.resolveCommentStatusColor =
10
+ exports.resolveCommentStatus =
11
+ exports.renderInitials =
12
+ exports.renderEntryTitle =
13
+ exports.getRelatedGroups =
14
+ exports.handleAPIError =
15
+ exports.getMessage =
16
+ exports.getUrl =
17
+ exports.getApiURL =
18
+ exports.axiosInstance =
19
+ void 0;
20
+ var axiosInstance_1 = require("./axiosInstance");
21
+ Object.defineProperty(exports, "axiosInstance", {
22
+ enumerable: true,
23
+ get: function () {
24
+ return __importDefault(axiosInstance_1).default;
25
+ },
26
+ });
27
+ var getApiUrl_1 = require("./getApiUrl");
28
+ Object.defineProperty(exports, "getApiURL", {
29
+ enumerable: true,
30
+ get: function () {
31
+ return __importDefault(getApiUrl_1).default;
32
+ },
33
+ });
34
+ var getUrl_1 = require("./getUrl");
35
+ Object.defineProperty(exports, "getUrl", {
36
+ enumerable: true,
37
+ get: function () {
38
+ return __importDefault(getUrl_1).default;
39
+ },
40
+ });
41
+ var getMessage_1 = require("./getMessage");
42
+ Object.defineProperty(exports, "getMessage", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return __importDefault(getMessage_1).default;
46
+ },
47
+ });
48
+ var handleAPIError_1 = require("./handleAPIError");
49
+ Object.defineProperty(exports, "handleAPIError", {
50
+ enumerable: true,
51
+ get: function () {
52
+ return __importDefault(handleAPIError_1).default;
53
+ },
54
+ });
55
+ var getRelatedGroups_1 = require("./getRelatedGroups");
56
+ Object.defineProperty(exports, "getRelatedGroups", {
57
+ enumerable: true,
58
+ get: function () {
59
+ return __importDefault(getRelatedGroups_1).default;
60
+ },
61
+ });
62
+ var renderEntryTitle_1 = require("./renderEntryTitle");
63
+ Object.defineProperty(exports, "renderEntryTitle", {
64
+ enumerable: true,
65
+ get: function () {
66
+ return __importDefault(renderEntryTitle_1).default;
67
+ },
68
+ });
69
+ var renderInitials_1 = require("./renderInitials");
70
+ Object.defineProperty(exports, "renderInitials", {
71
+ enumerable: true,
72
+ get: function () {
73
+ return __importDefault(renderInitials_1).default;
74
+ },
75
+ });
76
+ var resolveCommentStatus_1 = require("./resolveCommentStatus");
77
+ Object.defineProperty(exports, "resolveCommentStatus", {
78
+ enumerable: true,
79
+ get: function () {
80
+ return __importDefault(resolveCommentStatus_1).default;
81
+ },
82
+ });
83
+ var resolveCommentStatusColor_1 = require("./resolveCommentStatusColor");
84
+ Object.defineProperty(exports, "resolveCommentStatusColor", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return __importDefault(resolveCommentStatusColor_1).default;
88
+ },
89
+ });
90
+ var parseRegExp_1 = require("./parseRegExp");
91
+ Object.defineProperty(exports, "parseRegExp", {
92
+ enumerable: true,
93
+ get: function () {
94
+ return __importDefault(parseRegExp_1).default;
95
+ },
96
+ });
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ declare const parseRegExp: (regexpString: string) => {
2
+ value: string;
3
+ flags: string;
4
+ };
5
+ export default parseRegExp;
6
+ //# sourceMappingURL=parseRegExp.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const parseRegExp = (regexpString) => {
4
+ const [value, flags] = regexpString.split("/").filter((_) => _.length > 0);
5
+ return {
6
+ value,
7
+ flags,
8
+ };
9
+ };
10
+ exports.default = parseRegExp;
11
+ //# sourceMappingURL=parseRegExp.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const renderEntryTitle: (entry: ToBeFixed, config?: ToBeFixed) => any;
3
+ export default renderEntryTitle;
4
+ //# sourceMappingURL=renderEntryTitle.d.ts.map
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const renderEntryTitle = (entry, config = {}) => {
5
+ const { entryLabel } = config;
6
+ const rule =
7
+ entry.uid in entryLabel ? entryLabel[entry.uid] : entryLabel["*"];
8
+ return (0, lodash_1.first)(
9
+ Object.keys(entry)
10
+ .filter((_) => rule === _ || rule.includes(_))
11
+ .map((_) => entry[_])
12
+ .filter((_) => _)
13
+ );
14
+ };
15
+ exports.default = renderEntryTitle;
16
+ //# sourceMappingURL=renderEntryTitle.js.map
@@ -0,0 +1,3 @@
1
+ declare const renderInitials: (value?: string) => string;
2
+ export default renderInitials;
3
+ //# sourceMappingURL=renderInitials.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const renderInitials = (value = "") =>
5
+ value
6
+ .split(" ")
7
+ .map((_) => (0, lodash_1.first)(_))
8
+ .join("")
9
+ .toUpperCase();
10
+ exports.default = renderInitials;
11
+ //# sourceMappingURL=renderInitials.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const resolveCommentStatus: ({ removed, blocked, blockedThread, approvalStatus, reviewFlowEnabled, }: ToBeFixed) => any;
3
+ export default resolveCommentStatus;
4
+ //# sourceMappingURL=resolveCommentStatus.d.ts.map
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const constants_1 = require("./constants");
5
+ const resolveCommentStatus = ({
6
+ removed,
7
+ blocked,
8
+ blockedThread,
9
+ approvalStatus,
10
+ reviewFlowEnabled,
11
+ }) => {
12
+ const gotApprovalFlow = !(0, lodash_1.isNil)(approvalStatus);
13
+ if (removed) {
14
+ return constants_1.COMMENT_STATUS.REMOVED;
15
+ }
16
+ if (blocked || blockedThread) {
17
+ return constants_1.COMMENT_STATUS.BLOCKED;
18
+ }
19
+ if (reviewFlowEnabled) {
20
+ return constants_1.COMMENT_STATUS.TO_REVIEW;
21
+ }
22
+ if (gotApprovalFlow) {
23
+ const status = approvalStatus.toUpperCase();
24
+ if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
25
+ return status;
26
+ }
27
+ return constants_1.COMMENT_STATUS.UNKNOWN;
28
+ }
29
+ return constants_1.COMMENT_STATUS.OPEN;
30
+ };
31
+ exports.default = resolveCommentStatus;
32
+ //# sourceMappingURL=resolveCommentStatus.js.map
@@ -0,0 +1,4 @@
1
+ import { ToBeFixed } from "../../../types";
2
+ declare const resolveCommentStatusColor: (status: ToBeFixed) => "warning" | "secondary" | "danger" | "success";
3
+ export default resolveCommentStatusColor;
4
+ //# sourceMappingURL=resolveCommentStatusColor.d.ts.map
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("./constants");
4
+ const resolveCommentStatusColor = (status) => {
5
+ if (Object.keys(constants_1.COMMENT_STATUS).includes(status)) {
6
+ switch (status) {
7
+ case constants_1.COMMENT_STATUS.REMOVED:
8
+ return "secondary";
9
+ case constants_1.COMMENT_STATUS.TO_REVIEW:
10
+ case constants_1.COMMENT_STATUS.REJECTED:
11
+ return "warning";
12
+ case constants_1.COMMENT_STATUS.BLOCKED:
13
+ return "danger";
14
+ case constants_1.COMMENT_STATUS.OPEN:
15
+ case constants_1.COMMENT_STATUS.APPROVED:
16
+ return "success";
17
+ }
18
+ }
19
+ return "secondary";
20
+ };
21
+ exports.default = resolveCommentStatusColor;
22
+ //# sourceMappingURL=resolveCommentStatusColor.js.map
@@ -0,0 +1,91 @@
1
+ declare const _default: {
2
+ info: {
3
+ tableName: string;
4
+ singularName: string;
5
+ pluralName: string;
6
+ displayName: string;
7
+ description: string;
8
+ kind: string;
9
+ };
10
+ options: {
11
+ draftAndPublish: boolean;
12
+ };
13
+ pluginOptions: {
14
+ "content-manager": {
15
+ visible: boolean;
16
+ };
17
+ "content-type-builder": {
18
+ visible: boolean;
19
+ };
20
+ };
21
+ attributes: {
22
+ content: {
23
+ type: string;
24
+ configurable: boolean;
25
+ required: boolean;
26
+ };
27
+ blocked: {
28
+ type: string;
29
+ default: boolean;
30
+ configurable: boolean;
31
+ };
32
+ blockedThread: {
33
+ type: string;
34
+ default: boolean;
35
+ configurable: boolean;
36
+ };
37
+ blockReason: {
38
+ type: string;
39
+ configurable: boolean;
40
+ };
41
+ authorUser: {
42
+ type: string;
43
+ relation: string;
44
+ target: string;
45
+ configurable: boolean;
46
+ };
47
+ authorId: {
48
+ type: string;
49
+ configurable: boolean;
50
+ };
51
+ authorName: {
52
+ type: string;
53
+ configurable: boolean;
54
+ };
55
+ authorEmail: {
56
+ type: string;
57
+ configurable: boolean;
58
+ };
59
+ authorAvatar: {
60
+ type: string;
61
+ configurable: boolean;
62
+ };
63
+ removed: {
64
+ type: string;
65
+ configurable: boolean;
66
+ };
67
+ approvalStatus: {
68
+ type: string;
69
+ configurable: boolean;
70
+ };
71
+ related: {
72
+ type: string;
73
+ configurable: boolean;
74
+ };
75
+ reports: {
76
+ type: string;
77
+ relation: string;
78
+ target: string;
79
+ mappedBy: string;
80
+ configurable: boolean;
81
+ };
82
+ threadOf: {
83
+ type: string;
84
+ relation: string;
85
+ target: string;
86
+ configurable: boolean;
87
+ };
88
+ };
89
+ };
90
+ export default _default;
91
+ //# sourceMappingURL=comment.d.ts.map
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ info: {
5
+ tableName: "plugin-comments-comments",
6
+ singularName: "comment",
7
+ pluralName: "comments",
8
+ displayName: "Comment",
9
+ description: "Comment content type",
10
+ kind: "collectionType",
11
+ },
12
+ options: {
13
+ draftAndPublish: false,
14
+ },
15
+ pluginOptions: {
16
+ "content-manager": {
17
+ visible: false,
18
+ },
19
+ "content-type-builder": {
20
+ visible: false,
21
+ },
22
+ },
23
+ attributes: {
24
+ content: {
25
+ type: "text",
26
+ configurable: false,
27
+ required: true,
28
+ },
29
+ blocked: {
30
+ type: "boolean",
31
+ default: false,
32
+ configurable: false,
33
+ },
34
+ blockedThread: {
35
+ type: "boolean",
36
+ default: false,
37
+ configurable: false,
38
+ },
39
+ blockReason: {
40
+ type: "string",
41
+ configurable: false,
42
+ },
43
+ authorUser: {
44
+ type: "relation",
45
+ relation: "oneToOne",
46
+ target: "plugin::users-permissions.user",
47
+ configurable: false,
48
+ },
49
+ authorId: {
50
+ type: "string",
51
+ configurable: false,
52
+ },
53
+ authorName: {
54
+ type: "string",
55
+ configurable: false,
56
+ },
57
+ authorEmail: {
58
+ type: "email",
59
+ configurable: false,
60
+ },
61
+ authorAvatar: {
62
+ type: "string",
63
+ configurable: false,
64
+ },
65
+ removed: {
66
+ type: "boolean",
67
+ configurable: false,
68
+ },
69
+ approvalStatus: {
70
+ type: "string",
71
+ configurable: false,
72
+ },
73
+ related: {
74
+ type: "string",
75
+ configurable: false,
76
+ },
77
+ reports: {
78
+ type: "relation",
79
+ relation: "oneToMany",
80
+ target: "plugin::comments.comment-report",
81
+ mappedBy: "related",
82
+ configurable: false,
83
+ },
84
+ threadOf: {
85
+ type: "relation",
86
+ relation: "oneToOne",
87
+ target: "plugin::comments.comment",
88
+ configurable: false,
89
+ },
90
+ },
91
+ };
92
+ //# sourceMappingURL=comment.js.map