strapi-plugin-comments 2.3.2 → 3.0.0-beta.1
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 +27 -24
- 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-BBcsmSTs.mjs +51116 -0
- package/dist/_chunks/index-BFPteXuP.js +375 -0
- package/dist/_chunks/index-BXEk5PWx.js +51669 -0
- package/dist/_chunks/index-Bcck91A8.js +8351 -0
- package/dist/_chunks/index-CY_AVWS-.js +51131 -0
- package/dist/_chunks/index-D3iNqWZT.mjs +373 -0
- package/dist/_chunks/index-D9MOkoQ2.mjs +51647 -0
- package/dist/_chunks/index-DJ32APz-.mjs +8335 -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 +414 -0
- package/dist/admin/src/api/index.d.ts +1 -0
- package/dist/admin/src/api/schemas.d.ts +3477 -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 +431 -0
- package/dist/admin/src/hooks/useCommentMutations.d.ts +72 -0
- package/dist/admin/src/hooks/useCommentsAll.d.ts +60 -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 +14907 -0
- package/dist/server/index.mjs +14908 -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 +123 -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 +966 -0
- package/dist/server/src/controllers/client.controller.d.ts +873 -0
- package/dist/server/src/controllers/index.d.ts +2739 -0
- package/dist/server/src/controllers/settings.controller.d.ts +147 -0
- package/dist/server/src/controllers/utils/parsers.d.ts +4 -0
- package/dist/server/src/graphql/getResolversConfig.d.ts +21 -0
- package/dist/server/src/graphql/index.d.ts +2 -0
- package/dist/server/src/graphql/mutations/getCreateAbuseReport.d.ts +89 -0
- package/dist/server/src/graphql/mutations/getCreateComment.d.ts +78 -0
- package/dist/server/src/graphql/mutations/getRemoveComment.d.ts +78 -0
- package/dist/server/src/graphql/mutations/getUpdateComment.d.ts +78 -0
- package/dist/server/src/graphql/mutations/index.d.ts +3 -0
- package/dist/server/src/graphql/queries/findAllFlat.d.ts +165 -0
- package/dist/server/src/graphql/queries/findAllInHierarchy.d.ts +81 -0
- package/dist/server/src/graphql/queries/findAllPerAuthor.d.ts +164 -0
- package/dist/server/src/graphql/queries/index.d.ts +3 -0
- package/dist/server/src/graphql/types/getComment.d.ts +2 -0
- package/dist/server/src/graphql/types/getCommentAuthor.d.ts +2 -0
- package/dist/server/src/graphql/types/getCommentAuthorType.d.ts +2 -0
- package/dist/server/src/graphql/types/getCommentNested.d.ts +2 -0
- package/dist/server/src/graphql/types/getCreateComment.d.ts +2 -0
- package/dist/server/src/graphql/types/getCreateCommentAuthor.d.ts +2 -0
- package/dist/server/src/graphql/types/getCreateReport.d.ts +2 -0
- package/dist/server/src/graphql/types/getId.d.ts +2 -0
- package/dist/server/src/graphql/types/getIdentityAuthor.d.ts +2 -0
- package/dist/server/src/graphql/types/getRemoveComment.d.ts +2 -0
- package/dist/server/src/graphql/types/getReport.d.ts +2 -0
- package/dist/server/src/graphql/types/getReportReason.d.ts +3 -0
- package/dist/server/src/graphql/types/getResponseFindAll.d.ts +2 -0
- package/dist/server/src/graphql/types/getResponseFindAllPerAuthor.d.ts +2 -0
- package/dist/server/src/graphql/types/getResponseMeta.d.ts +2 -0
- package/dist/server/src/graphql/types/getResponsePagination.d.ts +2 -0
- package/dist/server/src/graphql/types/getUpdateComment.d.ts +2 -0
- package/dist/server/src/graphql/types/index.d.ts +3 -0
- package/dist/server/src/index.d.ts +9748 -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 +121 -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 +2627 -0
- package/dist/server/src/services/admin/utils.d.ts +72 -0
- package/dist/server/src/services/client.service.d.ts +2111 -0
- package/dist/server/src/services/common.service.d.ts +526 -0
- package/dist/server/src/services/gql.service.d.ts +7 -0
- package/dist/server/src/services/index.d.ts +6799 -0
- package/dist/server/src/services/settings.service.d.ts +111 -0
- package/dist/server/src/services/utils/functions.d.ts +18 -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 +621 -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 +2960 -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 +82 -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
|
@@ -1,24 +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
|
-
exports.throwError = exports.parseParams = void 0;
|
|
7
|
-
const error_1 = __importDefault(require("../../utils/error"));
|
|
8
|
-
const parseParams = (params) => Object.keys(params).reduce((prev, curr) => {
|
|
9
|
-
const value = params[curr];
|
|
10
|
-
const parsedValue = Number(value);
|
|
11
|
-
return {
|
|
12
|
-
...prev,
|
|
13
|
-
[curr]: isNaN(parsedValue) ? value : parsedValue,
|
|
14
|
-
};
|
|
15
|
-
}, {});
|
|
16
|
-
exports.parseParams = parseParams;
|
|
17
|
-
const throwError = (ctx, e) => {
|
|
18
|
-
if (e instanceof error_1.default) {
|
|
19
|
-
return ctx.throw(e.status, JSON.stringify(e));
|
|
20
|
-
}
|
|
21
|
-
return e;
|
|
22
|
-
};
|
|
23
|
-
exports.throwError = throwError;
|
|
24
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OnlyStrings } from "strapi-typed";
|
|
2
|
-
import { FlatInput } from "../../../types";
|
|
3
|
-
export declare const flatInput: <T, TKeys = keyof T>(payload: FlatInput<OnlyStrings<TKeys>>) => {
|
|
4
|
-
query: any;
|
|
5
|
-
populate: any;
|
|
6
|
-
pagination: any;
|
|
7
|
-
sort: any;
|
|
8
|
-
fields: import("strapi-typed").StrapiRequestQueryFieldsClause<OnlyStrings<TKeys>> | undefined;
|
|
9
|
-
omit: string[] | undefined;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -1,72 +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
|
-
exports.flatInput = void 0;
|
|
7
|
-
const error_1 = __importDefault(require("../../utils/error"));
|
|
8
|
-
const functions_1 = require("../../utils/functions");
|
|
9
|
-
const flatInput = (payload) => {
|
|
10
|
-
const { relation, query, sort, pagination, fields, omit } = payload;
|
|
11
|
-
const { populate = {}, filterBy, filterByValue, ...restQuery } = query;
|
|
12
|
-
const filters = restQuery?.filters || restQuery;
|
|
13
|
-
const orOperator = (filters?.$or || []).filter((_) => !Object.keys(_).includes("removed"));
|
|
14
|
-
let basePopulate = {
|
|
15
|
-
...populate,
|
|
16
|
-
};
|
|
17
|
-
let threadOfPopulate = {
|
|
18
|
-
threadOf: {
|
|
19
|
-
populate: {
|
|
20
|
-
authorUser: true,
|
|
21
|
-
...populate,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
if (populate.author) {
|
|
26
|
-
const { author, ...restPopulate } = populate;
|
|
27
|
-
basePopulate = {
|
|
28
|
-
...restPopulate,
|
|
29
|
-
authorUser: author,
|
|
30
|
-
};
|
|
31
|
-
threadOfPopulate = {
|
|
32
|
-
threadOf: {
|
|
33
|
-
populate: {
|
|
34
|
-
authorUser: author,
|
|
35
|
-
...restPopulate,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (filterBy === "DATE_CREATED") {
|
|
41
|
-
const date = new Date(filterByValue);
|
|
42
|
-
if (!filterByValue || Number.isNaN(+date)) {
|
|
43
|
-
throw new error_1.default(400, 'Invalid date specified in "filterByValue"');
|
|
44
|
-
}
|
|
45
|
-
const start = date.setHours(0, 0, 0, 0);
|
|
46
|
-
const end = date.setHours(23, 59, 59, 999);
|
|
47
|
-
filters.createdAt = {
|
|
48
|
-
$between: [start, end],
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (filterBy === "APPROVAL_STATUS") {
|
|
52
|
-
(0, functions_1.assertNotEmpty)(filterByValue, new error_1.default(400, 'Empty "filterByValue" parameter'));
|
|
53
|
-
filters.approvalStatus = filterByValue;
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
query: {
|
|
57
|
-
...filters,
|
|
58
|
-
$or: [...orOperator, { removed: { $null: true } }, { removed: false }],
|
|
59
|
-
related: relation,
|
|
60
|
-
},
|
|
61
|
-
populate: {
|
|
62
|
-
...basePopulate,
|
|
63
|
-
...threadOfPopulate,
|
|
64
|
-
},
|
|
65
|
-
pagination,
|
|
66
|
-
sort,
|
|
67
|
-
fields,
|
|
68
|
-
omit,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
exports.flatInput = flatInput;
|
|
72
|
-
//# sourceMappingURL=parsers.js.map
|
package/server/destroy.d.ts
DELETED
package/server/destroy.js
DELETED
package/server/graphql/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const types_1 = __importDefault(require("./types"));
|
|
6
|
-
const queries_1 = __importDefault(require("./queries"));
|
|
7
|
-
const mutations_1 = __importDefault(require("./mutations"));
|
|
8
|
-
const resolvers_config_1 = __importDefault(require("./resolvers-config"));
|
|
9
|
-
const functions_1 = require("../services/utils/functions");
|
|
10
|
-
module.exports = async ({ strapi, config }) => {
|
|
11
|
-
const extensionService = strapi.plugin("graphql").service("extension");
|
|
12
|
-
extensionService.shadowCRUD((0, functions_1.getModelUid)("comment")).disableQueries();
|
|
13
|
-
extensionService.shadowCRUD((0, functions_1.getModelUid)("comment")).disableMutations();
|
|
14
|
-
extensionService.shadowCRUD((0, functions_1.getModelUid)("comment-report")).disableQueries();
|
|
15
|
-
extensionService.shadowCRUD((0, functions_1.getModelUid)("comment-report")).disableMutations();
|
|
16
|
-
extensionService.use(({ strapi, nexus }) => {
|
|
17
|
-
const types = (0, types_1.default)({ strapi, nexus, config });
|
|
18
|
-
const queries = (0, queries_1.default)({ strapi, nexus, config });
|
|
19
|
-
const mutations = (0, mutations_1.default)({ strapi, nexus, config });
|
|
20
|
-
const resolversConfig = (0, resolvers_config_1.default)({ strapi, config });
|
|
21
|
-
return {
|
|
22
|
-
types: [types, queries, mutations],
|
|
23
|
-
resolversConfig,
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StrapiRequestContext } from "strapi-typed";
|
|
2
|
-
import { NexusRequestProps, StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
3
|
-
declare const _default: ({ nexus }: StrapiGraphQLContext) => {
|
|
4
|
-
type: any;
|
|
5
|
-
args: {
|
|
6
|
-
input: any;
|
|
7
|
-
};
|
|
8
|
-
resolve(_: Object, args: NexusRequestProps, ctx: StrapiRequestContext<never> & ToBeFixed): Promise<import("../../../types").CommentReport>;
|
|
9
|
-
};
|
|
10
|
-
export = _default;
|
|
11
|
-
//# sourceMappingURL=createAbuseReport.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const functions_1 = require("../../utils/functions");
|
|
3
|
-
module.exports = ({ nexus }) => {
|
|
4
|
-
const { nonNull } = nexus;
|
|
5
|
-
return {
|
|
6
|
-
type: nonNull("Report"),
|
|
7
|
-
args: {
|
|
8
|
-
input: nonNull("CreateReport"),
|
|
9
|
-
},
|
|
10
|
-
async resolve(_, args, ctx) {
|
|
11
|
-
const { input } = args;
|
|
12
|
-
const { state: { user = undefined } = {} } = ctx;
|
|
13
|
-
const { commentId, relation, ...body } = input;
|
|
14
|
-
try {
|
|
15
|
-
return await (0, functions_1.getPluginService)("client").reportAbuse(commentId, relation, body, user);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new Error(e);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=createAbuseReport.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { StrapiRequestContext } from "strapi-typed";
|
|
2
|
-
import { StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
3
|
-
type CreateCommentProps = {
|
|
4
|
-
input: ToBeFixed;
|
|
5
|
-
};
|
|
6
|
-
declare const _default: ({ nexus }: StrapiGraphQLContext) => {
|
|
7
|
-
type: any;
|
|
8
|
-
args: {
|
|
9
|
-
input: any;
|
|
10
|
-
};
|
|
11
|
-
resolve(_: Object, args: CreateCommentProps, ctx: StrapiRequestContext<never> & ToBeFixed): Promise<import("../../../types").Comment>;
|
|
12
|
-
};
|
|
13
|
-
export = _default;
|
|
14
|
-
//# sourceMappingURL=createComment.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const functions_1 = require("../../utils/functions");
|
|
3
|
-
module.exports = ({ nexus }) => {
|
|
4
|
-
const { nonNull } = nexus;
|
|
5
|
-
return {
|
|
6
|
-
type: nonNull("CommentSingle"),
|
|
7
|
-
args: {
|
|
8
|
-
input: nonNull("CreateComment"),
|
|
9
|
-
},
|
|
10
|
-
async resolve(_, args, ctx) {
|
|
11
|
-
const { input } = args;
|
|
12
|
-
const { state: { user = undefined } = {} } = ctx;
|
|
13
|
-
const { relation, ...body } = input;
|
|
14
|
-
try {
|
|
15
|
-
return await (0, functions_1.getPluginService)("client").create(relation, body, user);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new Error(e);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=createComment.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const createComment_1 = __importDefault(require("./createComment"));
|
|
6
|
-
const updateComment_1 = __importDefault(require("./updateComment"));
|
|
7
|
-
const removeComment_1 = __importDefault(require("./removeComment"));
|
|
8
|
-
const createAbuseReport_1 = __importDefault(require("./createAbuseReport"));
|
|
9
|
-
module.exports = (context) => {
|
|
10
|
-
const mutations = {
|
|
11
|
-
createComment: createComment_1.default,
|
|
12
|
-
updateComment: updateComment_1.default,
|
|
13
|
-
removeComment: removeComment_1.default,
|
|
14
|
-
createAbuseReport: createAbuseReport_1.default,
|
|
15
|
-
};
|
|
16
|
-
return context.nexus.extendType({
|
|
17
|
-
type: "Mutation",
|
|
18
|
-
definition(t) {
|
|
19
|
-
for (const [name, configFactory] of Object.entries(mutations)) {
|
|
20
|
-
const config = configFactory(context);
|
|
21
|
-
t.field(name, config);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StrapiRequestContext } from "strapi-typed";
|
|
2
|
-
import { NexusRequestProps, StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
3
|
-
declare const _default: ({ nexus }: StrapiGraphQLContext) => {
|
|
4
|
-
type: any;
|
|
5
|
-
args: {
|
|
6
|
-
input: any;
|
|
7
|
-
};
|
|
8
|
-
resolve(_: Object, args: NexusRequestProps, ctx: StrapiRequestContext<never> & ToBeFixed): Promise<import("../../../types").Comment>;
|
|
9
|
-
};
|
|
10
|
-
export = _default;
|
|
11
|
-
//# sourceMappingURL=removeComment.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const functions_1 = require("../../utils/functions");
|
|
3
|
-
module.exports = ({ nexus }) => {
|
|
4
|
-
const { nonNull } = nexus;
|
|
5
|
-
return {
|
|
6
|
-
type: nonNull("CommentSingle"),
|
|
7
|
-
args: {
|
|
8
|
-
input: nonNull("RemoveComment"),
|
|
9
|
-
},
|
|
10
|
-
async resolve(_, args, ctx) {
|
|
11
|
-
const { input } = args;
|
|
12
|
-
const { state: { user = undefined } = {} } = ctx;
|
|
13
|
-
const { id, relation, author } = input;
|
|
14
|
-
try {
|
|
15
|
-
return await (0, functions_1.getPluginService)("client").markAsRemoved(id, relation, author?.id, user);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new Error(e);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=removeComment.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StrapiRequestContext } from "strapi-typed";
|
|
2
|
-
import { NexusRequestProps, StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
3
|
-
declare const _default: ({ nexus }: StrapiGraphQLContext) => {
|
|
4
|
-
type: any;
|
|
5
|
-
args: {
|
|
6
|
-
input: any;
|
|
7
|
-
};
|
|
8
|
-
resolve(_: Object, args: NexusRequestProps, ctx: StrapiRequestContext<never> & ToBeFixed): Promise<import("../../../types").Comment>;
|
|
9
|
-
};
|
|
10
|
-
export = _default;
|
|
11
|
-
//# sourceMappingURL=updateComment.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const functions_1 = require("../../utils/functions");
|
|
3
|
-
module.exports = ({ nexus }) => {
|
|
4
|
-
const { nonNull } = nexus;
|
|
5
|
-
return {
|
|
6
|
-
type: nonNull("CommentSingle"),
|
|
7
|
-
args: {
|
|
8
|
-
input: nonNull("UpdateComment"),
|
|
9
|
-
},
|
|
10
|
-
async resolve(_, args, ctx) {
|
|
11
|
-
const { input } = args;
|
|
12
|
-
const { state: { user = undefined } = {} } = ctx;
|
|
13
|
-
const { id, relation, ...body } = input;
|
|
14
|
-
try {
|
|
15
|
-
return await (0, functions_1.getPluginService)("client").update(id, relation, body, user);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new Error(e);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=updateComment.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Id, StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
2
|
-
type ResponseFindAllResolverProps = {
|
|
3
|
-
relation: Id;
|
|
4
|
-
filters: ToBeFixed;
|
|
5
|
-
sort: ToBeFixed;
|
|
6
|
-
pagination: ToBeFixed;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ strapi, nexus }: StrapiGraphQLContext) => {
|
|
9
|
-
type: string;
|
|
10
|
-
args: {
|
|
11
|
-
relation: any;
|
|
12
|
-
filters: any;
|
|
13
|
-
pagination: any;
|
|
14
|
-
sort: any;
|
|
15
|
-
};
|
|
16
|
-
resolve(obj: Object, args: ResponseFindAllResolverProps): Promise<import("strapi-typed").StrapiPaginatedResponse<import("../../../types").Comment>>;
|
|
17
|
-
};
|
|
18
|
-
export = _default;
|
|
19
|
-
//# sourceMappingURL=findAllFlat.d.ts.map
|
|
@@ -1,37 +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 comment_1 = __importDefault(require("../../../content-types/comment"));
|
|
7
|
-
const parsers_1 = require("../../controllers/utils/parsers");
|
|
8
|
-
const functions_1 = require("../../utils/functions");
|
|
9
|
-
module.exports = ({ strapi, nexus }) => {
|
|
10
|
-
const { nonNull, stringArg } = nexus;
|
|
11
|
-
const { service: getService } = strapi.plugin("graphql");
|
|
12
|
-
const { args } = getService("internals");
|
|
13
|
-
return {
|
|
14
|
-
type: "ResponseFindAll",
|
|
15
|
-
args: {
|
|
16
|
-
relation: nonNull(stringArg()),
|
|
17
|
-
filters: (0, functions_1.getPluginService)("gql").buildContentTypeFilters(comment_1.default),
|
|
18
|
-
pagination: args.PaginationArg,
|
|
19
|
-
sort: args.SortArg,
|
|
20
|
-
},
|
|
21
|
-
async resolve(obj, args) {
|
|
22
|
-
const { relation, filters, sort, pagination } = args;
|
|
23
|
-
return await (0, functions_1.getPluginService)("common").findAllFlat((0, parsers_1.flatInput)({
|
|
24
|
-
relation,
|
|
25
|
-
query: (0, functions_1.getPluginService)("gql").graphQLFiltersToStrapiQuery(filters, comment_1.default),
|
|
26
|
-
sort,
|
|
27
|
-
pagination: pagination
|
|
28
|
-
? {
|
|
29
|
-
...pagination,
|
|
30
|
-
withCount: !(0, lodash_1.isEmpty)(pagination),
|
|
31
|
-
}
|
|
32
|
-
: undefined,
|
|
33
|
-
}), undefined);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=findAllFlat.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Id } from "strapi-typed";
|
|
2
|
-
import { StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
3
|
-
type findAllInHierarchyProps = {
|
|
4
|
-
relation: Id;
|
|
5
|
-
filters: ToBeFixed;
|
|
6
|
-
sort: ToBeFixed;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ strapi, nexus }: StrapiGraphQLContext) => {
|
|
9
|
-
type: any;
|
|
10
|
-
args: {
|
|
11
|
-
relation: any;
|
|
12
|
-
sort: any;
|
|
13
|
-
filters: any;
|
|
14
|
-
};
|
|
15
|
-
resolve(obj: Object, args: findAllInHierarchyProps): Promise<import("../../../types").Comment[]>;
|
|
16
|
-
};
|
|
17
|
-
export = _default;
|
|
18
|
-
//# sourceMappingURL=findAllInHierarchy.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const comment_1 = __importDefault(require("../../../content-types/comment"));
|
|
6
|
-
const parsers_1 = require("../../controllers/utils/parsers");
|
|
7
|
-
const functions_1 = require("../../utils/functions");
|
|
8
|
-
module.exports = ({ strapi, nexus }) => {
|
|
9
|
-
const { nonNull, list, stringArg } = nexus;
|
|
10
|
-
const { service: getService } = strapi.plugin("graphql");
|
|
11
|
-
const { args } = getService("internals");
|
|
12
|
-
const { naming: { getFiltersInputTypeName }, } = getService("utils");
|
|
13
|
-
return {
|
|
14
|
-
type: nonNull(list("CommentNested")),
|
|
15
|
-
args: {
|
|
16
|
-
relation: nonNull(stringArg()),
|
|
17
|
-
sort: args.SortArg,
|
|
18
|
-
filters: getFiltersInputTypeName(comment_1.default),
|
|
19
|
-
},
|
|
20
|
-
async resolve(obj, args) {
|
|
21
|
-
const { relation, filters, sort } = args;
|
|
22
|
-
return await (0, functions_1.getPluginService)("common").findAllInHierarchy({
|
|
23
|
-
...(0, parsers_1.flatInput)({
|
|
24
|
-
relation,
|
|
25
|
-
query: (0, functions_1.getPluginService)("gql").graphQLFiltersToStrapiQuery(filters, comment_1.default),
|
|
26
|
-
sort,
|
|
27
|
-
}),
|
|
28
|
-
dropBlockedThreads: true,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=findAllInHierarchy.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Id, StrapiGraphQLContext, ToBeFixed } from "../../../types";
|
|
2
|
-
type ResponseFindAllPerAuthorResolverProps = {
|
|
3
|
-
authorId: Id;
|
|
4
|
-
authorType: 'STRAPI' | 'GENERIC' | undefined;
|
|
5
|
-
filters: ToBeFixed;
|
|
6
|
-
sort: ToBeFixed;
|
|
7
|
-
pagination: ToBeFixed;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: ({ strapi, nexus }: StrapiGraphQLContext) => {
|
|
10
|
-
type: string;
|
|
11
|
-
args: {
|
|
12
|
-
authorId: any;
|
|
13
|
-
authorType: any;
|
|
14
|
-
filters: any;
|
|
15
|
-
pagination: any;
|
|
16
|
-
sort: any;
|
|
17
|
-
};
|
|
18
|
-
resolve(obj: Object, args: ResponseFindAllPerAuthorResolverProps): Promise<import("strapi-typed").StrapiPaginatedResponse<import("../../../types").Comment>>;
|
|
19
|
-
};
|
|
20
|
-
export = _default;
|
|
21
|
-
//# sourceMappingURL=findAllPerAuthor.d.ts.map
|
|
@@ -1,40 +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 comment_1 = __importDefault(require("../../../content-types/comment"));
|
|
7
|
-
const parsers_1 = require("../../controllers/utils/parsers");
|
|
8
|
-
const functions_1 = require("../../utils/functions");
|
|
9
|
-
const constants_1 = require("../../utils/constants");
|
|
10
|
-
module.exports = ({ strapi, nexus }) => {
|
|
11
|
-
const { nonNull, intArg, arg } = nexus;
|
|
12
|
-
const { service: getService } = strapi.plugin("graphql");
|
|
13
|
-
const { args } = getService("internals");
|
|
14
|
-
const { naming: { getFiltersInputTypeName }, } = getService("utils");
|
|
15
|
-
return {
|
|
16
|
-
type: "ResponseFindAllPerAuthor",
|
|
17
|
-
args: {
|
|
18
|
-
authorId: nonNull(intArg()),
|
|
19
|
-
authorType: arg({ type: 'AuthorType' }),
|
|
20
|
-
filters: getFiltersInputTypeName(comment_1.default),
|
|
21
|
-
pagination: args.PaginationArg,
|
|
22
|
-
sort: args.SortArg,
|
|
23
|
-
},
|
|
24
|
-
async resolve(obj, args) {
|
|
25
|
-
const { authorId, authorType, filters, sort, pagination } = args;
|
|
26
|
-
const isStrapiUser = authorType !== constants_1.AUTHOR_TYPE.GENERIC;
|
|
27
|
-
return await (0, functions_1.getPluginService)("common").findAllPerAuthor((0, parsers_1.flatInput)({
|
|
28
|
-
query: (0, functions_1.getPluginService)("gql").graphQLFiltersToStrapiQuery(filters, comment_1.default),
|
|
29
|
-
sort,
|
|
30
|
-
pagination: pagination
|
|
31
|
-
? {
|
|
32
|
-
...pagination,
|
|
33
|
-
withCount: !(0, lodash_1.isEmpty)(pagination),
|
|
34
|
-
}
|
|
35
|
-
: undefined,
|
|
36
|
-
}), authorId, isStrapiUser);
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=findAllPerAuthor.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const findAllFlat_1 = __importDefault(require("./findAllFlat"));
|
|
6
|
-
const findAllInHierarchy_1 = __importDefault(require("./findAllInHierarchy"));
|
|
7
|
-
const findAllPerAuthor_1 = __importDefault(require("./findAllPerAuthor"));
|
|
8
|
-
module.exports = (context) => {
|
|
9
|
-
const queries = {
|
|
10
|
-
findAllFlat: findAllFlat_1.default,
|
|
11
|
-
findAllInHierarchy: findAllInHierarchy_1.default,
|
|
12
|
-
findAllPerAuthor: findAllPerAuthor_1.default,
|
|
13
|
-
};
|
|
14
|
-
return context.nexus.extendType({
|
|
15
|
-
type: "Query",
|
|
16
|
-
definition(t) {
|
|
17
|
-
for (const [name, configFactory] of Object.entries(queries)) {
|
|
18
|
-
const config = configFactory(context);
|
|
19
|
-
t.field(name, config);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { StrapiGraphQLContext } from "../../types";
|
|
2
|
-
declare const _default: ({ config }: StrapiGraphQLContext) => {
|
|
3
|
-
"Query.findAllFlat": {
|
|
4
|
-
auth: any;
|
|
5
|
-
};
|
|
6
|
-
"Query.findAllInHierarchy": {
|
|
7
|
-
auth: any;
|
|
8
|
-
};
|
|
9
|
-
"Mutation.createComment": {
|
|
10
|
-
auth: any;
|
|
11
|
-
};
|
|
12
|
-
"Mutation.updateComment": {
|
|
13
|
-
auth: any;
|
|
14
|
-
};
|
|
15
|
-
"Mutation.removeComment": {
|
|
16
|
-
auth: any;
|
|
17
|
-
};
|
|
18
|
-
"Mutation.createAbuseReport": {
|
|
19
|
-
auth: any;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export = _default;
|
|
23
|
-
//# sourceMappingURL=resolvers-config.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = ({ config }) => {
|
|
3
|
-
const { gql: { auth = false } = {} } = config;
|
|
4
|
-
return {
|
|
5
|
-
"Query.findAllFlat": { auth },
|
|
6
|
-
"Query.findAllInHierarchy": { auth },
|
|
7
|
-
"Mutation.createComment": { auth },
|
|
8
|
-
"Mutation.updateComment": { auth },
|
|
9
|
-
"Mutation.removeComment": { auth },
|
|
10
|
-
"Mutation.createAbuseReport": { auth },
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=resolvers-config.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const constants_1 = require("../../utils/constants");
|
|
3
|
-
module.exports = ({ nexus }) => nexus.enumType({
|
|
4
|
-
name: 'AuthorType',
|
|
5
|
-
description: "User type which was the author of comment - Strapi built-in or generic",
|
|
6
|
-
members: Object.values(constants_1.AUTHOR_TYPE),
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=comment-author-type.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = ({ nexus }) => nexus.objectType({
|
|
3
|
-
name: "CommentNested",
|
|
4
|
-
definition(t) {
|
|
5
|
-
t.id("id");
|
|
6
|
-
t.nonNull.string("content");
|
|
7
|
-
t.boolean("blocked");
|
|
8
|
-
t.boolean("blockedThread");
|
|
9
|
-
t.string("approvalStatus");
|
|
10
|
-
t.boolean("removed");
|
|
11
|
-
t.field("threadOf", { type: "CommentSingle" });
|
|
12
|
-
t.list.field("children", { type: "CommentNested" });
|
|
13
|
-
t.field("author", { type: "CommentAuthor" });
|
|
14
|
-
t.string("createdAt");
|
|
15
|
-
t.string("updatedAt");
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=comment-nested.js.map
|