strapi-plugin-comments 2.3.2 → 3.0.0-beta.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.
- package/LICENSE.md +7 -0
- package/README.md +21 -19
- package/dist/_chunks/en-D1Rj1A_i.js +195 -0
- package/{admin/src/translations/en.json → dist/_chunks/en-DZljqkLz.mjs} +17 -14
- package/dist/_chunks/fr-DbxNAr65.js +146 -0
- package/{admin/src/translations/fr.json → dist/_chunks/fr-oAh2cU0E.mjs} +15 -11
- package/dist/_chunks/index-B6Q4U8YQ.js +51665 -0
- package/dist/_chunks/index-BQERo8pN.mjs +8340 -0
- package/dist/_chunks/index-BVj8EXjI.js +8356 -0
- package/dist/_chunks/index-Bpbf7RON.mjs +51643 -0
- package/dist/_chunks/index-CTjupB9v.js +375 -0
- package/dist/_chunks/index-fAgatqD0.js +50888 -0
- package/dist/_chunks/index-fSb-gYwg.mjs +373 -0
- package/dist/_chunks/index-h-TB6Qu2.mjs +50873 -0
- package/{admin/src/translations/pl.json → dist/_chunks/pl-BUVUFx9r.mjs} +14 -11
- package/dist/_chunks/pl-CuTgrHph.js +195 -0
- package/dist/_chunks/pt-BR-2Z9CtgSm.js +145 -0
- package/{admin/src/translations/pt-BR.json → dist/_chunks/pt-BR-Bchhsf7B.mjs} +14 -11
- package/{admin/src/translations/ru.json → dist/_chunks/ru-BQ54P0xr.mjs} +17 -14
- package/dist/_chunks/ru-gtnRlbuP.js +195 -0
- package/{admin/src/translations/tr.json → dist/_chunks/tr-CkGcBRUv.mjs} +14 -11
- package/dist/_chunks/tr-Ucl3IKMX.js +193 -0
- package/{admin/src/translations/zh-Hans.json → dist/_chunks/zh-Hans-Buh0iPWA.mjs} +17 -14
- package/dist/_chunks/zh-Hans-Dhk3gIYb.js +195 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/src/api/client.d.ts +413 -0
- package/dist/admin/src/api/index.d.ts +1 -0
- package/dist/admin/src/api/schemas.d.ts +3463 -0
- package/dist/admin/src/components/ActionButton/index.d.ts +4 -0
- package/dist/admin/src/components/ApproveFlow/index.d.ts +7 -0
- package/dist/admin/src/components/CommentReportStatusBadge/index.d.ts +4 -0
- package/dist/admin/src/components/CommentRow/index.d.ts +7 -0
- package/dist/admin/src/components/CommentStatusBadge/index.d.ts +7 -0
- package/dist/admin/src/components/ConfirmationDialog/index.d.ts +14 -0
- package/dist/admin/src/components/DiscussionThreadItem/DiscussionThreadItemActions.d.ts +3 -0
- package/dist/admin/src/components/DiscussionThreadItem/DiscussionThreadItemFooter.d.ts +4 -0
- package/dist/admin/src/components/DiscussionThreadItem/index.d.ts +6 -0
- package/dist/admin/src/components/DiscussionThreadItem/props.d.ts +12 -0
- package/dist/admin/src/components/IconButtonGroup/index.d.ts +5 -0
- package/dist/admin/src/components/LoadingIndicatorOverlay/index.d.ts +1 -0
- package/dist/admin/src/components/ModeratorResponseModal/index.d.ts +9 -0
- package/dist/admin/src/components/PluginIcon/index.d.ts +7 -0
- package/dist/admin/src/components/RenderIf/index.d.ts +7 -0
- package/dist/admin/src/components/ReportReasonBadge/index.d.ts +3 -0
- package/dist/admin/src/components/ReportStatusBadge/index.d.ts +5 -0
- package/dist/admin/src/components/ReportsTableRow/BlockMenu.d.ts +8 -0
- package/dist/admin/src/components/ReportsTableRow/CommentReviewModal.d.ts +7 -0
- package/dist/admin/src/components/ReportsTableRow/ReportsActions.d.ts +7 -0
- package/dist/admin/src/components/ReportsTableRow/index.d.ts +9 -0
- package/dist/admin/src/components/ReviewFlow/ReportReviewTable.d.ts +13 -0
- package/dist/admin/src/components/ReviewFlow/index.d.ts +7 -0
- package/dist/admin/src/components/SideNav/index.d.ts +1 -0
- package/dist/admin/src/components/StatusBadge/index.d.ts +3 -0
- package/dist/admin/src/components/UserAvatar/AdminAvatar.d.ts +2 -0
- package/dist/admin/src/components/UserAvatar/index.d.ts +8 -0
- package/{admin → dist/admin}/src/components/Wysiwyg/Editor.d.ts +2 -14
- package/dist/admin/src/components/Wysiwyg/EditorLayout.d.ts +12 -0
- package/{admin → dist/admin}/src/components/Wysiwyg/PreviewWysiwyg.d.ts +1 -2
- package/dist/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +6 -0
- package/{admin → dist/admin}/src/components/Wysiwyg/WysiwygNav.d.ts +4 -3
- package/dist/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +5 -0
- package/dist/admin/src/components/Wysiwyg/index.d.ts +13 -0
- package/{admin → dist/admin}/src/components/Wysiwyg/utils/continueList.d.ts +1 -4
- package/{admin → dist/admin}/src/components/Wysiwyg/utils/mdRenderer.d.ts +0 -1
- package/dist/admin/src/components/Wysiwyg/utils/urls.d.ts +2 -0
- package/{admin → dist/admin}/src/components/Wysiwyg/utils/utils.d.ts +0 -1
- package/{admin → dist/admin}/src/components/icons/comments.d.ts +1 -2
- package/dist/admin/src/components/icons/index.d.ts +2 -0
- package/dist/admin/src/components/icons/lock.d.ts +8 -0
- package/dist/admin/src/components/icons/review.d.ts +7 -0
- package/dist/admin/src/components/icons/strapiIcons.d.ts +1 -0
- package/dist/admin/src/components/icons/unlock.d.ts +8 -0
- package/dist/admin/src/contexts/UserContext.d.ts +23 -0
- package/dist/admin/src/hooks/useAPI.d.ts +430 -0
- package/dist/admin/src/hooks/useCommentMutations.d.ts +72 -0
- package/dist/admin/src/hooks/useCommentsAll.d.ts +59 -0
- package/dist/admin/src/hooks/useConfig.d.ts +28 -0
- package/dist/admin/src/hooks/useElementOnScreen.d.ts +2 -0
- package/dist/admin/src/hooks/usePermissions.d.ts +9 -0
- package/dist/admin/src/hooks/useReports.d.ts +60 -0
- package/dist/admin/src/hooks/useResizeObserver.d.ts +2 -0
- package/dist/admin/src/hooks/useUserContext.d.ts +21 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App/index.d.ts +2 -0
- package/dist/admin/src/pages/Details/DetailsEntry.d.ts +11 -0
- package/dist/admin/src/pages/Details/DiscussionThread.d.ts +11 -0
- package/dist/admin/src/pages/Details/ModeratorResponse.d.ts +7 -0
- package/dist/admin/src/pages/Details/index.d.ts +5 -0
- package/dist/admin/src/pages/Discover/index.d.ts +5 -0
- package/dist/admin/src/pages/Reports/index.d.ts +5 -0
- package/dist/admin/src/pages/Settings/hooks/useSettingsAPI.d.ts +70 -0
- package/dist/admin/src/pages/Settings/index.d.ts +2 -0
- package/{admin → dist/admin}/src/permissions.d.ts +0 -1
- package/{admin → dist/admin}/src/pluginId.d.ts +0 -1
- package/dist/admin/src/providers/CommonProviders/index.d.ts +4 -0
- package/dist/admin/src/store/settings.store.d.ts +7 -0
- package/dist/admin/src/translations/en.d.ts +194 -0
- package/dist/admin/src/translations/fr.d.ts +143 -0
- package/dist/admin/src/translations/index.d.ts +11 -0
- package/dist/admin/src/translations/pl.d.ts +193 -0
- package/dist/admin/src/translations/pt-BR.d.ts +143 -0
- package/dist/admin/src/translations/ru.d.ts +193 -0
- package/dist/admin/src/translations/tr.d.ts +191 -0
- package/dist/admin/src/translations/zh-Hans.d.ts +193 -0
- package/dist/admin/src/types/index.d.ts +5 -0
- package/dist/admin/src/utils/constants.d.ts +28 -0
- package/{admin → dist/admin}/src/utils/errors.d.ts +0 -1
- package/{admin → dist/admin}/src/utils/functions.d.ts +0 -1
- package/{admin → dist/admin}/src/utils/getApiUrl.d.ts +0 -1
- package/dist/admin/src/utils/getMessage.d.ts +2 -0
- package/{admin → dist/admin}/src/utils/getRelatedGroups.d.ts +0 -1
- package/{admin → dist/admin}/src/utils/getUrl.d.ts +0 -1
- package/dist/admin/src/utils/handleAPIError.d.ts +2 -0
- package/{admin → dist/admin}/src/utils/index.d.ts +0 -2
- package/{admin → dist/admin}/src/utils/parseRegExp.d.ts +0 -1
- package/dist/admin/src/utils/renderEntryTitle.d.ts +2 -0
- package/{admin → dist/admin}/src/utils/renderInitials.d.ts +0 -1
- package/dist/admin/src/utils/resolveCommentStatus.d.ts +7 -0
- package/dist/admin/src/utils/resolveCommentStatusColor.d.ts +3 -0
- package/dist/admin/src/utils/resolveReportStatus.d.ts +4 -0
- package/dist/admin/src/utils/resolveReportStatusColor.d.ts +3 -0
- package/dist/assets/configuration.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/assets/marketplace.png +0 -0
- package/dist/assets/preview.png +0 -0
- package/dist/server/index.js +8121 -0
- package/dist/server/index.mjs +8122 -0
- package/dist/server/src/@types-v5/controllers.d.ts +17 -0
- package/dist/server/src/@types-v5/index.d.ts +5 -0
- package/dist/server/src/@types-v5/repositories.d.ts +28 -0
- package/dist/server/src/@types-v5/routes.d.ts +18 -0
- package/{types/contentTypes.d.ts → dist/server/src/@types-v5/utils.d.ts} +23 -6
- package/dist/server/src/bootstrap.d.ts +3 -0
- package/dist/server/src/config/index.d.ts +101 -0
- package/dist/server/src/const/REGEX.d.ts +19 -0
- package/dist/server/src/const/REPORT_REASON.d.ts +5 -0
- package/dist/server/src/const/index.d.ts +3 -0
- package/dist/server/src/content-types/comments/index.d.ts +98 -0
- package/{content-types/comment.d.ts → dist/server/src/content-types/comments/schema.d.ts} +3 -1
- package/{content-types → dist/server/src/content-types}/index.d.ts +14 -8
- package/dist/server/src/content-types/report/index.d.ts +50 -0
- package/{content-types/report.d.ts → dist/server/src/content-types/report/schema.d.ts} +4 -3
- package/dist/server/src/controllers/admin.controller.d.ts +964 -0
- package/dist/server/src/controllers/client.controller.d.ts +839 -0
- package/dist/server/src/controllers/index.d.ts +2641 -0
- package/dist/server/src/controllers/settings.controller.d.ts +123 -0
- package/dist/server/src/controllers/utils/parsers.d.ts +1 -0
- package/dist/server/src/index.d.ts +9448 -0
- package/{permissions.d.ts → dist/server/src/permissions.d.ts} +2 -4
- package/{server → dist/server/src}/register/custom-fields/comments.d.ts +0 -1
- package/dist/server/src/register/custom-fields/index.d.ts +2 -0
- package/{server → dist/server/src}/register/index.d.ts +1 -2
- package/dist/server/src/repositories/comment.repository.d.ts +13 -0
- package/dist/server/src/repositories/index.d.ts +5 -0
- package/dist/server/src/repositories/report.comment.repository.d.ts +41 -0
- package/dist/server/src/repositories/store.repository.d.ts +106 -0
- package/dist/server/src/repositories/utils.d.ts +11 -0
- package/dist/server/src/routes/admin.routes.d.ts +3 -0
- package/dist/server/src/routes/client.routes.d.ts +3 -0
- package/dist/server/src/routes/index.d.ts +11 -0
- package/dist/server/src/services/admin/admin.service.d.ts +2570 -0
- package/dist/server/src/services/admin/utils.d.ts +72 -0
- package/dist/server/src/services/client.service.d.ts +2056 -0
- package/dist/server/src/services/common.service.d.ts +523 -0
- package/dist/server/src/services/index.d.ts +6606 -0
- package/dist/server/src/services/settings.service.d.ts +93 -0
- package/dist/server/src/services/utils/functions.d.ts +12 -0
- package/dist/server/src/utils/Either.d.ts +16 -0
- package/dist/server/src/utils/PluginError.d.ts +11 -0
- package/dist/server/src/utils/constants.d.ts +25 -0
- package/{server → dist/server/src}/utils/error.d.ts +0 -1
- package/dist/server/src/utils/getConfig.d.ts +3 -0
- package/dist/server/src/utils/getPluginService.d.ts +3 -0
- package/dist/server/src/utils/throwError.d.ts +3 -0
- package/dist/server/src/utils/tryCatch.d.ts +1 -0
- package/{server → dist/server/src}/utils/types.d.ts +3 -5
- package/dist/server/src/validators/api/controllers/admin.controller.validator.d.ts +119 -0
- package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +586 -0
- package/dist/server/src/validators/api/controllers/index.d.ts +3 -0
- package/dist/server/src/validators/api/controllers/settings.controller.validator.d.ts +18 -0
- package/dist/server/src/validators/api/index.d.ts +1 -0
- package/dist/server/src/validators/repositories/comment.schema.d.ts +62 -0
- package/dist/server/src/validators/repositories/comment.validator.d.ts +2944 -0
- package/dist/server/src/validators/repositories/index.d.ts +2 -0
- package/dist/server/src/validators/repositories/reports.validator.d.ts +1045 -0
- package/dist/server/src/validators/repositories/utils.d.ts +20 -0
- package/dist/server/src/validators/utils.d.ts +776 -0
- package/dist/style.css +84 -0
- package/package.json +81 -18
- package/admin/src/components/ActionButton/styles.d.ts +0 -2
- package/admin/src/components/ActionButton/styles.js +0 -15
- package/admin/src/components/AdminAvatar/index.d.ts +0 -4
- package/admin/src/components/AdminAvatar/index.js +0 -17
- package/admin/src/components/AdminAvatar/styles.d.ts +0 -3
- package/admin/src/components/AdminAvatar/styles.js +0 -25
- package/admin/src/components/Avatar/index.d.ts +0 -10
- package/admin/src/components/Avatar/index.js +0 -22
- package/admin/src/components/CommentReviewModal/index.d.ts +0 -10
- package/admin/src/components/CommentReviewModal/index.js +0 -19
- package/admin/src/components/ConfirmationDialog/index.d.ts +0 -27
- package/admin/src/components/ConfirmationDialog/index.js +0 -37
- package/admin/src/components/DiscussionStatus/index.d.ts +0 -9
- package/admin/src/components/DiscussionStatus/index.js +0 -24
- package/admin/src/components/DiscussionThread/index.d.ts +0 -21
- package/admin/src/components/DiscussionThread/index.js +0 -45
- package/admin/src/components/DiscussionThreadItem/index.d.ts +0 -3
- package/admin/src/components/DiscussionThreadItem/index.js +0 -51
- package/admin/src/components/DiscussionThreadItem/styles.d.ts +0 -5
- package/admin/src/components/DiscussionThreadItem/styles.js +0 -31
- package/admin/src/components/DiscussionThreadItemActions/index.d.ts +0 -22
- package/admin/src/components/DiscussionThreadItemActions/index.js +0 -222
- package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +0 -2
- package/admin/src/components/DiscussionThreadItemActions/styles.js +0 -13
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +0 -19
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +0 -67
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +0 -2
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +0 -12
- package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +0 -23
- package/admin/src/components/DiscussionThreadItemFooter/index.js +0 -40
- package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +0 -3
- package/admin/src/components/DiscussionThreadItemFooter/styles.js +0 -18
- package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +0 -25
- package/admin/src/components/DiscussionThreadItemReviewAction/index.js +0 -174
- package/admin/src/components/FormSwitch/index.d.ts +0 -7
- package/admin/src/components/FormSwitch/index.js +0 -15
- package/admin/src/components/FormSwitch/styles.d.ts +0 -2
- package/admin/src/components/FormSwitch/styles.js +0 -14
- package/admin/src/components/Hint/index.d.ts +0 -14
- package/admin/src/components/Hint/index.js +0 -22
- package/admin/src/components/IconButton/styles.d.ts +0 -2
- package/admin/src/components/IconButton/styles.js +0 -21
- package/admin/src/components/Initializer/index.d.ts +0 -5
- package/admin/src/components/Initializer/index.js +0 -14
- package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +0 -3
- package/admin/src/components/LoadingIndicatorOverlay/index.js +0 -12
- package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +0 -3
- package/admin/src/components/LoadingIndicatorOverlay/styles.js +0 -25
- package/admin/src/components/ModeratorResponse/index.d.ts +0 -8
- package/admin/src/components/ModeratorResponse/index.js +0 -106
- package/admin/src/components/ModeratorResponse/styles.d.ts +0 -2
- package/admin/src/components/ModeratorResponse/styles.js +0 -12
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.d.ts +0 -11
- package/admin/src/components/ModeratorResponseModal/ModeratorResponseModal.js +0 -95
- package/admin/src/components/Nav/index.d.ts +0 -7
- package/admin/src/components/Nav/index.js +0 -23
- package/admin/src/components/PluginIcon/index.d.ts +0 -3
- package/admin/src/components/PluginIcon/index.js +0 -6
- package/admin/src/components/PreviewWysiwyg/Wrapper.d.ts +0 -3
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +0 -162
- package/admin/src/components/PreviewWysiwyg/index.d.ts +0 -7
- package/admin/src/components/PreviewWysiwyg/index.js +0 -39
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.d.ts +0 -3
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.js +0 -88
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.d.ts +0 -20
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +0 -18
- package/admin/src/components/ReportsActions/components/BlockMenu/index.d.ts +0 -15
- package/admin/src/components/ReportsActions/components/BlockMenu/index.js +0 -51
- package/admin/src/components/ReportsActions/index.d.ts +0 -11
- package/admin/src/components/ReportsActions/index.js +0 -31
- package/admin/src/components/ReportsReviewModal/index.d.ts +0 -26
- package/admin/src/components/ReportsReviewModal/index.js +0 -33
- package/admin/src/components/ReportsReviewTable/index.d.ts +0 -15
- package/admin/src/components/ReportsReviewTable/index.js +0 -141
- package/admin/src/components/StatusBadge/index.d.ts +0 -7
- package/admin/src/components/StatusBadge/index.js +0 -12
- package/admin/src/components/StatusBadge/styles.d.ts +0 -2
- package/admin/src/components/StatusBadge/styles.js +0 -23
- package/admin/src/components/TableFilters/index.d.ts +0 -19
- package/admin/src/components/TableFilters/index.js +0 -56
- package/admin/src/components/TablePagination/index.d.ts +0 -23
- package/admin/src/components/TablePagination/index.js +0 -33
- package/admin/src/components/Wysiwyg/Editor.js +0 -439
- package/admin/src/components/Wysiwyg/EditorLayout.d.ts +0 -13
- package/admin/src/components/Wysiwyg/EditorLayout.js +0 -85
- package/admin/src/components/Wysiwyg/Field.d.ts +0 -15
- package/admin/src/components/Wysiwyg/Field.js +0 -135
- package/admin/src/components/Wysiwyg/PreviewWysiwyg.js +0 -191
- package/admin/src/components/Wysiwyg/WysiwygFooter.d.ts +0 -8
- package/admin/src/components/Wysiwyg/WysiwygFooter.js +0 -44
- package/admin/src/components/Wysiwyg/WysiwygNav.js +0 -114
- package/admin/src/components/Wysiwyg/WysiwygStyles.d.ts +0 -7
- package/admin/src/components/Wysiwyg/WysiwygStyles.js +0 -54
- package/admin/src/components/Wysiwyg/utils/continueList.js +0 -83
- package/admin/src/components/Wysiwyg/utils/mdRenderer.js +0 -63
- package/admin/src/components/Wysiwyg/utils/utils.js +0 -250
- package/admin/src/components/icons/comments.js +0 -12
- package/admin/src/components/icons/index.d.ts +0 -3
- package/admin/src/components/icons/index.js +0 -29
- package/admin/src/components/icons/lock.d.ts +0 -7
- package/admin/src/components/icons/lock.js +0 -12
- package/admin/src/components/icons/review.d.ts +0 -7
- package/admin/src/components/icons/review.js +0 -12
- package/admin/src/components/icons/strapiIcons.d.ts +0 -26
- package/admin/src/components/icons/strapiIcons.js +0 -38
- package/admin/src/components/icons/unlock.d.ts +0 -7
- package/admin/src/components/icons/unlock.js +0 -12
- package/admin/src/custom-fields/comments/components/icon.d.ts +0 -2
- package/admin/src/custom-fields/comments/components/icon.js +0 -14
- package/admin/src/custom-fields/comments/components/index.d.ts +0 -3
- package/admin/src/custom-fields/comments/components/index.js +0 -19
- package/admin/src/custom-fields/comments/components/input/consts.d.ts +0 -3
- package/admin/src/custom-fields/comments/components/input/consts.js +0 -9
- package/admin/src/custom-fields/comments/components/input/index.d.ts +0 -3
- package/admin/src/custom-fields/comments/components/input/index.js +0 -5
- package/admin/src/custom-fields/comments/components/input/input.d.ts +0 -4
- package/admin/src/custom-fields/comments/components/input/input.js +0 -98
- package/admin/src/custom-fields/comments/components/input/types.d.ts +0 -10
- package/admin/src/custom-fields/comments/components/input/types.js +0 -3
- package/admin/src/custom-fields/comments/components/input/utils.d.ts +0 -26
- package/admin/src/custom-fields/comments/components/input/utils.js +0 -141
- package/admin/src/custom-fields/comments/index.d.ts +0 -3
- package/admin/src/custom-fields/comments/index.js +0 -53
- package/admin/src/custom-fields/index.d.ts +0 -3
- package/admin/src/custom-fields/index.js +0 -13
- package/admin/src/hooks/useConfig.d.ts +0 -8
- package/admin/src/hooks/useConfig.js +0 -41
- package/admin/src/hooks/useReportsActionsHandlers.d.ts +0 -19
- package/admin/src/hooks/useReportsActionsHandlers.js +0 -70
- package/admin/src/index.d.ts +0 -15
- package/admin/src/index.js +0 -97
- package/admin/src/pages/App/index.d.ts +0 -15
- package/admin/src/pages/App/index.js +0 -47
- package/admin/src/pages/App/reducer/actions.d.ts +0 -8
- package/admin/src/pages/App/reducer/actions.js +0 -12
- package/admin/src/pages/App/reducer/constants.d.ts +0 -4
- package/admin/src/pages/App/reducer/constants.js +0 -7
- package/admin/src/pages/App/reducer/index.d.ts +0 -9
- package/admin/src/pages/App/reducer/index.js +0 -28
- package/admin/src/pages/App/reducer/init.d.ts +0 -3
- package/admin/src/pages/App/reducer/init.js +0 -9
- package/admin/src/pages/App/reducer/selectors.d.ts +0 -10
- package/admin/src/pages/App/reducer/selectors.js +0 -18
- package/admin/src/pages/App/utils/api.d.ts +0 -2
- package/admin/src/pages/App/utils/api.js +0 -15
- package/admin/src/pages/ComingSoonPage/index.d.ts +0 -4
- package/admin/src/pages/ComingSoonPage/index.js +0 -43
- package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +0 -19
- package/admin/src/pages/Details/components/DetailsEntity/index.js +0 -56
- package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +0 -13
- package/admin/src/pages/Details/components/DetailsFilters/index.js +0 -28
- package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +0 -2
- package/admin/src/pages/Details/components/DetailsFilters/styles.js +0 -14
- package/admin/src/pages/Details/index.d.ts +0 -11
- package/admin/src/pages/Details/index.js +0 -100
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +0 -25
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +0 -125
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +0 -2
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +0 -14
- package/admin/src/pages/Discover/index.d.ts +0 -11
- package/admin/src/pages/Discover/index.js +0 -132
- package/admin/src/pages/Discover/utils/api.d.ts +0 -2
- package/admin/src/pages/Discover/utils/api.js +0 -16
- package/admin/src/pages/Discover/utils/filtersSchema.d.ts +0 -26
- package/admin/src/pages/Discover/utils/filtersSchema.js +0 -39
- package/admin/src/pages/NoAccessPage/index.d.ts +0 -3
- package/admin/src/pages/NoAccessPage/index.js +0 -31
- package/admin/src/pages/Reports/components/ReportsTableRow/index.d.ts +0 -15
- package/admin/src/pages/Reports/components/ReportsTableRow/index.js +0 -91
- package/admin/src/pages/Reports/components/ReportsTableRow/styles.d.ts +0 -2
- package/admin/src/pages/Reports/components/ReportsTableRow/styles.js +0 -14
- package/admin/src/pages/Reports/index.d.ts +0 -11
- package/admin/src/pages/Reports/index.js +0 -196
- package/admin/src/pages/Reports/utils/api.d.ts +0 -2
- package/admin/src/pages/Reports/utils/api.js +0 -16
- package/admin/src/pages/Reports/utils/filtersSchema.d.ts +0 -26
- package/admin/src/pages/Reports/utils/filtersSchema.js +0 -32
- package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +0 -2
- package/admin/src/pages/Settings/components/RestartAlert/styles.js +0 -14
- package/admin/src/pages/Settings/index.d.ts +0 -3
- package/admin/src/pages/Settings/index.js +0 -244
- package/admin/src/pages/Settings/utils/api.d.ts +0 -7
- package/admin/src/pages/Settings/utils/api.js +0 -65
- package/admin/src/pages/utils/api.d.ts +0 -23
- package/admin/src/pages/utils/api.js +0 -85
- package/admin/src/permissions.js +0 -32
- package/admin/src/pluginId.js +0 -29
- package/admin/src/reducers.d.ts +0 -7
- package/admin/src/reducers.js +0 -12
- package/admin/src/translations/index.d.ts +0 -8
- package/admin/src/translations/index.js +0 -23
- package/admin/src/utils/axiosInstance.d.ts +0 -3
- package/admin/src/utils/axiosInstance.js +0 -29
- package/admin/src/utils/constants.d.ts +0 -29
- package/admin/src/utils/constants.js +0 -28
- package/admin/src/utils/errors.js +0 -10
- package/admin/src/utils/functions.js +0 -10
- package/admin/src/utils/getApiUrl.js +0 -6
- package/admin/src/utils/getMessage.d.ts +0 -4
- package/admin/src/utils/getMessage.js +0 -20
- package/admin/src/utils/getRelatedGroups.js +0 -5
- package/admin/src/utils/getUrl.js +0 -6
- package/admin/src/utils/handleAPIError.d.ts +0 -4
- package/admin/src/utils/handleAPIError.js +0 -17
- package/admin/src/utils/index.js +0 -40
- package/admin/src/utils/parseRegExp.js +0 -11
- package/admin/src/utils/renderEntryTitle.d.ts +0 -4
- package/admin/src/utils/renderEntryTitle.js +0 -13
- package/admin/src/utils/renderInitials.js +0 -11
- package/admin/src/utils/resolveCommentStatus.d.ts +0 -10
- package/admin/src/utils/resolveCommentStatus.js +0 -26
- package/admin/src/utils/resolveCommentStatusColor.d.ts +0 -4
- package/admin/src/utils/resolveCommentStatusColor.js +0 -22
- package/admin/src/utils/resolveReportStatus.d.ts +0 -4
- package/admin/src/utils/resolveReportStatus.js +0 -23
- package/admin/src/utils/resolveReportStatusColor.d.ts +0 -4
- package/admin/src/utils/resolveReportStatusColor.js +0 -17
- package/content-types/comment.js +0 -96
- package/content-types/index.js +0 -23
- package/content-types/report.js +0 -49
- package/permissions.js +0 -18
- package/server/bootstrap.d.ts +0 -4
- package/server/bootstrap.js +0 -59
- package/server/config/index.d.ts +0 -4
- package/server/config/index.js +0 -20
- package/server/controllers/admin.d.ts +0 -4
- package/server/controllers/admin.js +0 -212
- package/server/controllers/client.d.ts +0 -4
- package/server/controllers/client.js +0 -143
- package/server/controllers/index.d.ts +0 -6
- package/server/controllers/index.js +0 -13
- package/server/controllers/utils/functions.d.ts +0 -7
- package/server/controllers/utils/functions.js +0 -24
- package/server/controllers/utils/parsers.d.ts +0 -11
- package/server/controllers/utils/parsers.js +0 -72
- package/server/destroy.d.ts +0 -3
- package/server/destroy.js +0 -4
- package/server/graphql/index.d.ts +0 -4
- package/server/graphql/index.js +0 -27
- package/server/graphql/mutations/createAbuseReport.d.ts +0 -11
- package/server/graphql/mutations/createAbuseReport.js +0 -23
- package/server/graphql/mutations/createComment.d.ts +0 -14
- package/server/graphql/mutations/createComment.js +0 -23
- package/server/graphql/mutations/index.d.ts +0 -4
- package/server/graphql/mutations/index.js +0 -26
- package/server/graphql/mutations/removeComment.d.ts +0 -11
- package/server/graphql/mutations/removeComment.js +0 -23
- package/server/graphql/mutations/updateComment.d.ts +0 -11
- package/server/graphql/mutations/updateComment.js +0 -23
- package/server/graphql/queries/findAllFlat.d.ts +0 -19
- package/server/graphql/queries/findAllFlat.js +0 -37
- package/server/graphql/queries/findAllInHierarchy.d.ts +0 -18
- package/server/graphql/queries/findAllInHierarchy.js +0 -33
- package/server/graphql/queries/findAllPerAuthor.d.ts +0 -21
- package/server/graphql/queries/findAllPerAuthor.js +0 -40
- package/server/graphql/queries/index.d.ts +0 -4
- package/server/graphql/queries/index.js +0 -24
- package/server/graphql/resolvers-config.d.ts +0 -23
- package/server/graphql/resolvers-config.js +0 -13
- package/server/graphql/types/comment-author-type.d.ts +0 -4
- package/server/graphql/types/comment-author-type.js +0 -8
- package/server/graphql/types/comment-author.d.ts +0 -4
- package/server/graphql/types/comment-author.js +0 -11
- package/server/graphql/types/comment-nested.d.ts +0 -4
- package/server/graphql/types/comment-nested.js +0 -18
- package/server/graphql/types/comment.d.ts +0 -4
- package/server/graphql/types/comment.js +0 -17
- package/server/graphql/types/create-comment-author.d.ts +0 -4
- package/server/graphql/types/create-comment-author.js +0 -11
- package/server/graphql/types/create-comment.d.ts +0 -4
- package/server/graphql/types/create-comment.js +0 -11
- package/server/graphql/types/create-report.d.ts +0 -4
- package/server/graphql/types/create-report.js +0 -11
- package/server/graphql/types/id.d.ts +0 -4
- package/server/graphql/types/id.js +0 -25
- package/server/graphql/types/identify-comment-author.d.ts +0 -4
- package/server/graphql/types/identify-comment-author.js +0 -8
- package/server/graphql/types/index.d.ts +0 -4
- package/server/graphql/types/index.js +0 -42
- package/server/graphql/types/remove-comment.d.ts +0 -4
- package/server/graphql/types/remove-comment.js +0 -10
- package/server/graphql/types/report-reason.d.ts +0 -4
- package/server/graphql/types/report-reason.js +0 -12
- package/server/graphql/types/report.d.ts +0 -4
- package/server/graphql/types/report.js +0 -13
- package/server/graphql/types/response-find-all-per-author.d.ts +0 -4
- package/server/graphql/types/response-find-all-per-author.js +0 -9
- package/server/graphql/types/response-find-all.d.ts +0 -4
- package/server/graphql/types/response-find-all.js +0 -9
- package/server/graphql/types/response-meta.d.ts +0 -4
- package/server/graphql/types/response-meta.js +0 -8
- package/server/graphql/types/response-pagination.d.ts +0 -4
- package/server/graphql/types/response-pagination.js +0 -13
- package/server/graphql/types/update-comment.d.ts +0 -4
- package/server/graphql/types/update-comment.js +0 -11
- package/server/index.d.ts +0 -26
- package/server/index.js +0 -25
- package/server/register/custom-fields/comments.js +0 -9
- package/server/register/custom-fields/index.d.ts +0 -3
- package/server/register/custom-fields/index.js +0 -14
- package/server/register/index.js +0 -8
- package/server/routes/admin.d.ts +0 -4
- package/server/routes/admin.js +0 -182
- package/server/routes/client.d.ts +0 -4
- package/server/routes/client.js +0 -118
- package/server/routes/index.d.ts +0 -11
- package/server/routes/index.js +0 -19
- package/server/services/admin.d.ts +0 -5
- package/server/services/admin.js +0 -506
- package/server/services/client.d.ts +0 -5
- package/server/services/client.js +0 -321
- package/server/services/common.d.ts +0 -5
- package/server/services/common.js +0 -296
- package/server/services/graphql.d.ts +0 -5
- package/server/services/graphql.js +0 -150
- package/server/services/index.d.ts +0 -8
- package/server/services/index.js +0 -16
- package/server/services/utils/functions.d.ts +0 -14
- package/server/services/utils/functions.js +0 -118
- package/server/services/utils/parsers.d.ts +0 -6
- package/server/services/utils/parsers.js +0 -63
- package/server/utils/constants.d.ts +0 -15
- package/server/utils/constants.js +0 -47
- package/server/utils/error.js +0 -29
- package/server/utils/functions.d.ts +0 -10
- package/server/utils/functions.js +0 -53
- package/server/utils/types.js +0 -3
- package/strapi-admin.d.ts +0 -3
- package/strapi-admin.js +0 -8
- package/strapi-server.d.ts +0 -186
- package/strapi-server.js +0 -46
- package/tsconfig.tsbuildinfo +0 -1
- package/types/contentTypes.js +0 -3
- package/types/utils.d.ts +0 -5
- package/types/utils.js +0 -9
package/content-types/comment.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
isAdminComment: {
|
|
66
|
-
type: "boolean",
|
|
67
|
-
configurable: false,
|
|
68
|
-
},
|
|
69
|
-
removed: {
|
|
70
|
-
type: "boolean",
|
|
71
|
-
configurable: false,
|
|
72
|
-
},
|
|
73
|
-
approvalStatus: {
|
|
74
|
-
type: "string",
|
|
75
|
-
configurable: false,
|
|
76
|
-
},
|
|
77
|
-
related: {
|
|
78
|
-
type: "string",
|
|
79
|
-
configurable: false,
|
|
80
|
-
},
|
|
81
|
-
reports: {
|
|
82
|
-
type: "relation",
|
|
83
|
-
relation: "oneToMany",
|
|
84
|
-
target: "plugin::comments.comment-report",
|
|
85
|
-
mappedBy: "related",
|
|
86
|
-
configurable: false,
|
|
87
|
-
},
|
|
88
|
-
threadOf: {
|
|
89
|
-
type: "relation",
|
|
90
|
-
relation: "oneToOne",
|
|
91
|
-
target: "plugin::comments.comment",
|
|
92
|
-
configurable: false,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=comment.js.map
|
package/content-types/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const functions_1 = require("../server/utils/functions");
|
|
7
|
-
const comment_1 = __importDefault(require("./comment"));
|
|
8
|
-
const report_1 = __importDefault(require("./report"));
|
|
9
|
-
exports.default = {
|
|
10
|
-
comment: {
|
|
11
|
-
schema: comment_1.default,
|
|
12
|
-
lifecycles: (0, functions_1.buildAllHookListeners)("comment", {
|
|
13
|
-
strapi,
|
|
14
|
-
}),
|
|
15
|
-
},
|
|
16
|
-
"comment-report": {
|
|
17
|
-
schema: report_1.default,
|
|
18
|
-
lifecycles: (0, functions_1.buildAllHookListeners)("comment-report", {
|
|
19
|
-
strapi,
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/content-types/report.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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",
|
|
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
|
-
},
|
|
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
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=report.js.map
|
package/permissions.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
render: (uid) => `plugin::comments.${uid}`,
|
|
5
|
-
comments: {
|
|
6
|
-
read: "read",
|
|
7
|
-
moderate: "moderate",
|
|
8
|
-
},
|
|
9
|
-
reports: {
|
|
10
|
-
read: "reports.read",
|
|
11
|
-
action: "reports.action",
|
|
12
|
-
},
|
|
13
|
-
settings: {
|
|
14
|
-
read: "settings.read",
|
|
15
|
-
change: "settings.change",
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=permissions.js.map
|
package/server/bootstrap.d.ts
DELETED
package/server/bootstrap.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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");
|
|
8
|
-
module.exports = async ({ strapi }) => {
|
|
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");
|
|
18
|
-
}
|
|
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);
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=bootstrap.js.map
|
package/server/config/index.d.ts
DELETED
package/server/config/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
},
|
|
16
|
-
blockedAuthorProps: [],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
exports.default = config;
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const functions_1 = require("./../utils/functions");
|
|
4
|
-
const functions_2 = require("./utils/functions");
|
|
5
|
-
const controllers = {
|
|
6
|
-
getService(name = "admin") {
|
|
7
|
-
return (0, functions_1.getPluginService)(name);
|
|
8
|
-
},
|
|
9
|
-
async config(ctx) {
|
|
10
|
-
try {
|
|
11
|
-
return await this.getService().config();
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
async settingsConfig(ctx) {
|
|
18
|
-
try {
|
|
19
|
-
return this.getService().config(true);
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
async settingsUpdateConfig(ctx) {
|
|
26
|
-
try {
|
|
27
|
-
const { request: { body }, } = ctx;
|
|
28
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
29
|
-
return this.getService().updateConfig(body);
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
async settingsRestoreConfig(ctx) {
|
|
36
|
-
try {
|
|
37
|
-
return this.getService().restoreConfig();
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
async settingsRestart(ctx) {
|
|
44
|
-
try {
|
|
45
|
-
await this.getService().restart();
|
|
46
|
-
return ctx.send({ status: 200 });
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
async findAll(ctx) {
|
|
53
|
-
return this.getService().findAll(ctx.query);
|
|
54
|
-
},
|
|
55
|
-
async findReports(ctx) {
|
|
56
|
-
return this.getService().findReports(ctx.query);
|
|
57
|
-
},
|
|
58
|
-
async findOne(ctx) {
|
|
59
|
-
const { params = {}, query } = ctx;
|
|
60
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
61
|
-
try {
|
|
62
|
-
return await this.getService().findOneAndThread(id, query);
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
async blockComment(ctx) {
|
|
69
|
-
const { params = {} } = ctx;
|
|
70
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
71
|
-
try {
|
|
72
|
-
return await this.getService().blockComment(id, true);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
async unblockComment(ctx) {
|
|
79
|
-
const { params = {} } = ctx;
|
|
80
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
81
|
-
try {
|
|
82
|
-
return await this.getService().blockComment(id, false);
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
async deleteComment(ctx) {
|
|
89
|
-
const { params = {} } = ctx;
|
|
90
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
91
|
-
try {
|
|
92
|
-
return await this.getService().deleteComment(id);
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
async blockCommentThread(ctx) {
|
|
99
|
-
const { params = {} } = ctx;
|
|
100
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
101
|
-
try {
|
|
102
|
-
return await this.getService().blockCommentThread(id, true);
|
|
103
|
-
}
|
|
104
|
-
catch (e) {
|
|
105
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
async unblockCommentThread(ctx) {
|
|
109
|
-
const { params = {} } = ctx;
|
|
110
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
111
|
-
try {
|
|
112
|
-
return await this.getService().blockCommentThread(id, false);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
async resolveAbuseReport(ctx) {
|
|
119
|
-
const { params = {} } = ctx;
|
|
120
|
-
const { id: commentId, reportId } = (0, functions_2.parseParams)(params);
|
|
121
|
-
try {
|
|
122
|
-
return await this.getService().resolveAbuseReport(reportId, commentId);
|
|
123
|
-
}
|
|
124
|
-
catch (e) {
|
|
125
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
async resolveCommentMultipleAbuseReports(ctx) {
|
|
129
|
-
const { params = {}, request } = ctx;
|
|
130
|
-
const { body } = request;
|
|
131
|
-
const { id: commentId } = (0, functions_2.parseParams)(params);
|
|
132
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
133
|
-
try {
|
|
134
|
-
return await this.getService().resolveCommentMultipleAbuseReports(body, commentId);
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
async resolveAllAbuseReportsForComment(ctx) {
|
|
141
|
-
const { params } = ctx;
|
|
142
|
-
const { id: commentId } = (0, functions_2.parseParams)(params);
|
|
143
|
-
try {
|
|
144
|
-
return await this.getService().resolveAllAbuseReportsForComment(commentId);
|
|
145
|
-
}
|
|
146
|
-
catch (e) {
|
|
147
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
async resolveAllAbuseReportsForThread(ctx) {
|
|
151
|
-
const { params } = ctx;
|
|
152
|
-
const { id: commentId } = (0, functions_2.parseParams)(params);
|
|
153
|
-
try {
|
|
154
|
-
return await this.getService().resolveAllAbuseReportsForThread(commentId);
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
async resolveMultipleAbuseReports(ctx) {
|
|
161
|
-
const { request: { body }, } = ctx;
|
|
162
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
163
|
-
try {
|
|
164
|
-
return await this.getService().resolveMultipleAbuseReports(body);
|
|
165
|
-
}
|
|
166
|
-
catch (e) {
|
|
167
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
async postComment(ctx) {
|
|
171
|
-
const { params = {}, request } = ctx;
|
|
172
|
-
const { body } = request;
|
|
173
|
-
const { id: threadId } = (0, functions_2.parseParams)(params);
|
|
174
|
-
try {
|
|
175
|
-
return await this.getService().postComment(threadId, body.content, body.author);
|
|
176
|
-
}
|
|
177
|
-
catch (e) {
|
|
178
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
async updateComment(ctx) {
|
|
182
|
-
const { params = {}, request } = ctx;
|
|
183
|
-
const { body } = request;
|
|
184
|
-
const { id } = (0, functions_2.parseParams)(params);
|
|
185
|
-
try {
|
|
186
|
-
return await this.getService().updateComment(id, body.content);
|
|
187
|
-
}
|
|
188
|
-
catch (e) {
|
|
189
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
async approveComment(ctx) {
|
|
193
|
-
const { id } = (0, functions_2.parseParams)(ctx.params || {});
|
|
194
|
-
try {
|
|
195
|
-
return await this.getService().approveComment(id);
|
|
196
|
-
}
|
|
197
|
-
catch (e) {
|
|
198
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
async rejectComment(ctx) {
|
|
202
|
-
const { id } = (0, functions_2.parseParams)(ctx.params || {});
|
|
203
|
-
try {
|
|
204
|
-
return await this.getService().rejectComment(id);
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
exports.default = controllers;
|
|
212
|
-
//# sourceMappingURL=admin.js.map
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const functions_1 = require("./../utils/functions");
|
|
7
|
-
const functions_2 = require("./utils/functions");
|
|
8
|
-
const parsers_1 = require("./utils/parsers");
|
|
9
|
-
const error_1 = __importDefault(require("../utils/error"));
|
|
10
|
-
const constants_1 = require("../utils/constants");
|
|
11
|
-
const controllers = {
|
|
12
|
-
getService(name = "client") {
|
|
13
|
-
return (0, functions_1.getPluginService)(name);
|
|
14
|
-
},
|
|
15
|
-
async findAllFlat(ctx) {
|
|
16
|
-
const { params = {}, query, sort, pagination } = ctx;
|
|
17
|
-
const { relation } = (0, functions_2.parseParams)(params);
|
|
18
|
-
const { sort: querySort, pagination: queryPagination, fields, omit = [], ...filterQuery } = query || {};
|
|
19
|
-
try {
|
|
20
|
-
(0, functions_1.assertParamsPresent)(params, ["relation"]);
|
|
21
|
-
return this.getService("common").findAllFlat((0, parsers_1.flatInput)({
|
|
22
|
-
relation,
|
|
23
|
-
query: filterQuery,
|
|
24
|
-
sort: sort || querySort,
|
|
25
|
-
pagination: pagination || queryPagination,
|
|
26
|
-
fields,
|
|
27
|
-
omit,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
async findAllInHierarchy(ctx) {
|
|
35
|
-
const { params, query, sort } = ctx;
|
|
36
|
-
const { relation } = (0, functions_2.parseParams)(params);
|
|
37
|
-
const { sort: querySort, fields, omit, ...filterQuery } = query || {};
|
|
38
|
-
try {
|
|
39
|
-
(0, functions_1.assertParamsPresent)(params, ["relation"]);
|
|
40
|
-
return await this.getService("common").findAllInHierarchy({
|
|
41
|
-
...(0, parsers_1.flatInput)({
|
|
42
|
-
relation,
|
|
43
|
-
query: filterQuery,
|
|
44
|
-
sort: sort || querySort,
|
|
45
|
-
fields,
|
|
46
|
-
omit,
|
|
47
|
-
}),
|
|
48
|
-
dropBlockedThreads: true,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async findAllPerAuthor(ctx) {
|
|
56
|
-
const { params = {}, query, sort, pagination } = ctx;
|
|
57
|
-
const { id, type } = (0, functions_2.parseParams)(params);
|
|
58
|
-
const { sort: querySort, pagination: queryPagination, fields, omit = [], ...filterQuery } = query || {};
|
|
59
|
-
try {
|
|
60
|
-
(0, functions_1.assertParamsPresent)(params, ["id"]);
|
|
61
|
-
return this.getService("common").findAllPerAuthor((0, parsers_1.flatInput)({
|
|
62
|
-
query: filterQuery,
|
|
63
|
-
sort: sort || querySort,
|
|
64
|
-
pagination: pagination || queryPagination,
|
|
65
|
-
fields,
|
|
66
|
-
omit,
|
|
67
|
-
}), id, ![constants_1.AUTHOR_TYPE.GENERIC.toLowerCase(), constants_1.AUTHOR_TYPE.GENERIC].includes(type));
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
async post(ctx) {
|
|
74
|
-
const { request, params, state = {} } = ctx;
|
|
75
|
-
const { relation } = (0, functions_2.parseParams)(params);
|
|
76
|
-
const { user } = state;
|
|
77
|
-
const { body } = request;
|
|
78
|
-
try {
|
|
79
|
-
(0, functions_1.assertParamsPresent)(params, ["relation"]);
|
|
80
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
81
|
-
const entity = await this.getService().create(relation, body, user);
|
|
82
|
-
if (entity) {
|
|
83
|
-
return entity;
|
|
84
|
-
}
|
|
85
|
-
throw new error_1.default(400, "Comment hasn't been created");
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
async put(ctx) {
|
|
92
|
-
const { request, state, params = {} } = ctx;
|
|
93
|
-
const { body } = request;
|
|
94
|
-
const { user } = state;
|
|
95
|
-
const { commentId, relation } = (0, functions_2.parseParams)(params);
|
|
96
|
-
try {
|
|
97
|
-
(0, functions_1.assertParamsPresent)(params, ["commentId", "relation"]);
|
|
98
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
99
|
-
return await this.getService().update(commentId, relation, body, user);
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
async reportAbuse(ctx) {
|
|
106
|
-
const { request, state, params = {} } = ctx;
|
|
107
|
-
const { body } = request;
|
|
108
|
-
const { user } = state;
|
|
109
|
-
const { relation, commentId } = (0, functions_2.parseParams)(params);
|
|
110
|
-
try {
|
|
111
|
-
(0, functions_1.assertParamsPresent)(params, ["commentId", "relation"]);
|
|
112
|
-
(0, functions_1.assertNotEmpty)(body);
|
|
113
|
-
if (!body.content) {
|
|
114
|
-
throw new error_1.default(400, "Content field is required");
|
|
115
|
-
}
|
|
116
|
-
return await this.getService().reportAbuse(commentId, relation, body, user);
|
|
117
|
-
}
|
|
118
|
-
catch (e) {
|
|
119
|
-
throw (0, functions_2.throwError)(ctx, e);
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
async removeComment(ctx) {
|
|
123
|
-
const { params, query, state: { user }, } = ctx;
|
|
124
|
-
const { relation, commentId } = (0, functions_2.parseParams)(params);
|
|
125
|
-
const { authorId } = (0, functions_2.parseParams)(query);
|
|
126
|
-
try {
|
|
127
|
-
(0, functions_1.assertParamsPresent)(params, ["commentId", "relation"]);
|
|
128
|
-
(0, functions_1.assertParamsPresent)(query, ["authorId"]);
|
|
129
|
-
if (authorId || user?.id) {
|
|
130
|
-
return await this.getService().markAsRemoved(commentId, relation, authorId, user);
|
|
131
|
-
}
|
|
132
|
-
return new error_1.default(400, "Not provided authorId");
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
if (!e.isBoom) {
|
|
136
|
-
(0, functions_2.throwError)(ctx, e);
|
|
137
|
-
}
|
|
138
|
-
throw e;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
exports.default = controllers;
|
|
143
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const admin_1 = __importDefault(require("./admin"));
|
|
7
|
-
const client_1 = __importDefault(require("./client"));
|
|
8
|
-
const controllers = {
|
|
9
|
-
admin: admin_1.default,
|
|
10
|
-
client: client_1.default,
|
|
11
|
-
};
|
|
12
|
-
exports.default = controllers;
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Id, StringMap, StrapiRequestContext } from "strapi-typed";
|
|
2
|
-
import PluginError from "../../utils/error";
|
|
3
|
-
type ParseResponse = StringMap<string | number | Id>;
|
|
4
|
-
export declare const parseParams: <T extends ParseResponse>(params: StringMap<string | number>) => T;
|
|
5
|
-
export declare const throwError: <T extends {} = never>(ctx: StrapiRequestContext<T>, e: PluginError | Error | unknown) => PluginError | Error | unknown | never;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=functions.d.ts.map
|