strapi-plugin-comments 2.0.10 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +204 -124
- package/admin/src/components/ActionButton/styles.d.ts +2 -0
- package/admin/src/components/ActionButton/styles.js +13 -8
- package/admin/src/components/Avatar/index.d.ts +12 -0
- package/admin/src/components/Avatar/index.js +26 -0
- package/admin/src/components/ConfirmationDialog/index.d.ts +26 -0
- package/admin/src/components/ConfirmationDialog/index.js +36 -55
- package/admin/src/components/DiscussionStatus/index.d.ts +9 -0
- package/admin/src/components/DiscussionStatus/index.js +22 -31
- package/admin/src/components/DiscussionThread/index.d.ts +16 -0
- package/admin/src/components/DiscussionThread/index.js +39 -56
- package/admin/src/components/DiscussionThreadItem/index.d.ts +9 -0
- package/admin/src/components/DiscussionThreadItem/index.js +28 -52
- package/admin/src/components/DiscussionThreadItem/styles.d.ts +4 -0
- package/admin/src/components/DiscussionThreadItem/styles.js +16 -11
- package/admin/src/components/DiscussionThreadItemActions/index.d.ts +19 -0
- package/admin/src/components/DiscussionThreadItemActions/index.js +121 -158
- package/admin/src/components/DiscussionThreadItemActions/styles.d.ts +2 -0
- package/admin/src/components/DiscussionThreadItemActions/styles.js +13 -7
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.d.ts +17 -0
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/index.js +38 -48
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.d.ts +2 -0
- package/admin/src/components/DiscussionThreadItemApprovalFlowActions/styles.js +12 -6
- package/admin/src/components/DiscussionThreadItemFooter/index.d.ts +16 -0
- package/admin/src/components/DiscussionThreadItemFooter/index.js +34 -42
- package/admin/src/components/DiscussionThreadItemFooter/styles.d.ts +3 -0
- package/admin/src/components/DiscussionThreadItemFooter/styles.js +17 -12
- package/admin/src/components/DiscussionThreadItemReviewAction/index.d.ts +30 -0
- package/admin/src/components/DiscussionThreadItemReviewAction/index.js +77 -91
- package/admin/src/components/FormSwitch/index.d.ts +7 -0
- package/admin/src/components/FormSwitch/index.js +15 -18
- package/admin/src/components/FormSwitch/styles.d.ts +2 -0
- package/admin/src/components/FormSwitch/styles.js +14 -8
- package/admin/src/components/IconButton/styles.d.ts +2 -0
- package/admin/src/components/IconButton/styles.js +16 -9
- package/admin/src/components/Initializer/index.d.ts +5 -0
- package/admin/src/components/Initializer/index.js +12 -24
- package/admin/src/components/LoadingIndicatorOverlay/index.d.ts +3 -0
- package/admin/src/components/LoadingIndicatorOverlay/index.js +12 -15
- package/admin/src/components/LoadingIndicatorOverlay/styles.d.ts +3 -0
- package/admin/src/components/LoadingIndicatorOverlay/styles.js +22 -17
- package/admin/src/components/Nav/index.d.ts +7 -0
- package/admin/src/components/Nav/index.js +25 -48
- package/admin/src/components/PluginIcon/index.d.ts +3 -0
- package/admin/src/components/PluginIcon/index.js +10 -12
- package/admin/src/components/ReportsReviewModal/index.d.ts +21 -0
- package/admin/src/components/ReportsReviewModal/index.js +31 -46
- package/admin/src/components/ReportsReviewTable/index.d.ts +21 -0
- package/admin/src/components/ReportsReviewTable/index.js +120 -140
- package/admin/src/components/StatusBadge/index.d.ts +7 -0
- package/admin/src/components/StatusBadge/index.js +12 -17
- package/admin/src/components/StatusBadge/styles.d.ts +2 -0
- package/admin/src/components/StatusBadge/styles.js +19 -13
- package/admin/src/components/TableFilters/index.d.ts +10 -0
- package/admin/src/components/TableFilters/index.js +52 -49
- package/admin/src/components/TablePagination/index.d.ts +17 -0
- package/admin/src/components/TablePagination/index.js +27 -29
- package/admin/src/components/icons/comments.d.ts +6 -0
- package/admin/src/components/icons/comments.js +11 -8
- package/admin/src/components/icons/index.d.ts +6 -0
- package/admin/src/components/icons/index.js +15 -6
- package/admin/src/components/icons/lock.d.ts +7 -0
- package/admin/src/components/icons/lock.js +11 -21
- package/admin/src/components/icons/review.d.ts +7 -0
- package/admin/src/components/icons/review.js +11 -17
- package/admin/src/components/icons/unlock.d.ts +7 -0
- package/admin/src/components/icons/unlock.js +11 -19
- package/admin/src/hooks/useConfig.d.ts +8 -0
- package/admin/src/hooks/useConfig.js +40 -45
- package/admin/src/index.d.ts +7 -0
- package/admin/src/index.js +98 -92
- package/admin/src/pages/App/index.d.ts +4 -0
- package/admin/src/pages/App/index.js +43 -67
- package/admin/src/pages/App/reducer/actions.d.ts +8 -0
- package/admin/src/pages/App/reducer/actions.js +11 -7
- package/admin/src/pages/App/reducer/constants.d.ts +4 -0
- package/admin/src/pages/App/reducer/constants.js +7 -4
- package/admin/src/pages/App/reducer/index.d.ts +9 -0
- package/admin/src/pages/App/reducer/index.js +24 -22
- package/admin/src/pages/App/reducer/init.d.ts +3 -0
- package/admin/src/pages/App/reducer/init.js +6 -4
- package/admin/src/pages/App/reducer/selectors.d.ts +6 -0
- package/admin/src/pages/App/reducer/selectors.js +17 -34
- package/admin/src/pages/App/utils/api.d.ts +2 -0
- package/admin/src/pages/App/utils/api.js +14 -11
- package/admin/src/pages/ComingSoonPage/index.d.ts +3 -0
- package/admin/src/pages/ComingSoonPage/index.js +42 -24
- package/admin/src/pages/Details/components/DetailsEntity/index.d.ts +18 -0
- package/admin/src/pages/Details/components/DetailsEntity/index.js +49 -77
- package/admin/src/pages/Details/components/DetailsFilters/index.d.ts +12 -0
- package/admin/src/pages/Details/components/DetailsFilters/index.js +19 -26
- package/admin/src/pages/Details/components/DetailsFilters/styles.d.ts +2 -0
- package/admin/src/pages/Details/components/DetailsFilters/styles.js +14 -8
- package/admin/src/pages/Details/index.d.ts +4 -0
- package/admin/src/pages/Details/index.js +94 -133
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.d.ts +20 -0
- package/admin/src/pages/Discover/components/DiscoverTableRow/index.js +128 -139
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.d.ts +2 -0
- package/admin/src/pages/Discover/components/DiscoverTableRow/styles.js +14 -8
- package/admin/src/pages/Discover/index.d.ts +4 -0
- package/admin/src/pages/Discover/index.js +129 -170
- package/admin/src/pages/Discover/utils/api.d.ts +2 -0
- package/admin/src/pages/Discover/utils/api.js +15 -13
- package/admin/src/pages/Discover/utils/filtersSchema.d.ts +11 -0
- package/admin/src/pages/Discover/utils/filtersSchema.js +8 -6
- package/admin/src/pages/Settings/components/RestartAlert/styles.d.ts +2 -0
- package/admin/src/pages/Settings/components/RestartAlert/styles.js +14 -8
- package/admin/src/pages/Settings/index.d.ts +3 -0
- package/admin/src/pages/Settings/index.js +225 -391
- package/admin/src/pages/Settings/utils/api.d.ts +7 -0
- package/admin/src/pages/Settings/utils/api.js +60 -55
- package/admin/src/pages/utils/api.d.ts +12 -0
- package/admin/src/pages/utils/api.js +58 -53
- package/admin/src/permissions.d.ts +28 -0
- package/admin/src/permissions.js +31 -17
- package/admin/src/pluginId.d.ts +2 -0
- package/admin/src/pluginId.js +29 -5
- package/admin/src/reducers.d.ts +7 -0
- package/admin/src/reducers.js +10 -6
- package/admin/src/translations/en.json +131 -131
- package/admin/src/translations/fr.json +132 -1
- package/admin/src/translations/pt-BR.json +130 -130
- package/admin/src/utils/axiosInstance.d.ts +3 -0
- package/admin/src/utils/axiosInstance.js +21 -27
- package/admin/src/utils/constants.d.ts +25 -0
- package/admin/src/utils/constants.js +23 -22
- package/admin/src/utils/getApiUrl.d.ts +3 -0
- package/admin/src/utils/getApiUrl.js +6 -5
- package/admin/src/utils/getMessage.d.ts +4 -0
- package/admin/src/utils/getMessage.js +15 -15
- package/admin/src/utils/getRelatedGroups.d.ts +4 -0
- package/admin/src/utils/getRelatedGroups.js +5 -3
- package/admin/src/utils/getUrl.d.ts +3 -0
- package/admin/src/utils/getUrl.js +6 -5
- package/admin/src/utils/handleAPIError.d.ts +4 -0
- package/admin/src/utils/handleAPIError.js +12 -11
- package/admin/src/utils/index.d.ts +12 -0
- package/admin/src/utils/index.js +29 -11
- package/admin/src/utils/parseRegExp.d.ts +6 -0
- package/admin/src/utils/parseRegExp.js +6 -5
- package/admin/src/utils/renderEntryTitle.d.ts +4 -0
- package/admin/src/utils/renderEntryTitle.js +11 -12
- package/admin/src/utils/renderInitials.d.ts +3 -0
- package/admin/src/utils/renderInitials.js +10 -5
- package/admin/src/utils/resolveCommentStatus.d.ts +4 -0
- package/admin/src/utils/resolveCommentStatus.js +17 -21
- package/admin/src/utils/resolveCommentStatusColor.d.ts +4 -0
- package/admin/src/utils/resolveCommentStatusColor.js +19 -19
- package/content-types/comment.d.ts +91 -0
- package/content-types/comment.js +87 -88
- package/content-types/index.d.ts +143 -0
- package/content-types/index.js +15 -10
- package/content-types/report.d.ts +48 -0
- package/content-types/report.js +44 -49
- package/package.json +24 -19
- package/permissions.d.ts +18 -0
- package/permissions.js +12 -13
- package/server/bootstrap.d.ts +4 -0
- package/server/bootstrap.js +56 -62
- package/server/config/index.d.ts +4 -0
- package/server/config/index.js +17 -15
- package/server/controllers/admin.d.ts +4 -0
- package/server/controllers/admin.js +134 -167
- package/server/controllers/client.d.ts +4 -0
- package/server/controllers/client.js +120 -112
- package/server/controllers/index.d.ts +6 -0
- package/server/controllers/index.js +12 -8
- package/server/controllers/utils/functions.d.ts +7 -0
- package/server/controllers/utils/functions.js +22 -17
- package/server/controllers/utils/parsers.d.ts +10 -0
- package/server/controllers/utils/parsers.js +47 -19
- package/server/destroy.d.ts +3 -0
- package/server/destroy.js +3 -4
- package/server/graphql/index.d.ts +4 -0
- package/server/graphql/index.js +27 -25
- package/server/graphql/mutations/createAbuseReport.d.ts +11 -0
- package/server/graphql/mutations/createAbuseReport.js +22 -24
- package/server/graphql/mutations/createComment.d.ts +14 -0
- package/server/graphql/mutations/createComment.js +22 -24
- package/server/graphql/mutations/index.d.ts +4 -0
- package/server/graphql/mutations/index.js +24 -19
- package/server/graphql/mutations/removeComment.d.ts +11 -0
- package/server/graphql/mutations/removeComment.js +22 -24
- package/server/graphql/mutations/updateComment.d.ts +11 -0
- package/server/graphql/mutations/updateComment.js +22 -24
- package/server/graphql/queries/findAllFlat.d.ts +19 -0
- package/server/graphql/queries/findAllFlat.js +36 -34
- package/server/graphql/queries/findAllInHierarchy.d.ts +17 -0
- package/server/graphql/queries/findAllInHierarchy.js +30 -30
- package/server/graphql/queries/index.d.ts +4 -0
- package/server/graphql/queries/index.js +20 -17
- package/server/graphql/resolvers-config.d.ts +23 -0
- package/server/graphql/resolvers-config.js +11 -11
- package/server/graphql/types/comment-author.d.ts +4 -0
- package/server/graphql/types/comment-author.js +10 -8
- package/server/graphql/types/comment-nested.d.ts +4 -0
- package/server/graphql/types/comment-nested.js +17 -15
- package/server/graphql/types/comment.d.ts +4 -0
- package/server/graphql/types/comment.js +16 -14
- package/server/graphql/types/create-comment-author.d.ts +4 -0
- package/server/graphql/types/create-comment-author.js +10 -8
- package/server/graphql/types/create-comment.d.ts +4 -0
- package/server/graphql/types/create-comment.js +10 -8
- package/server/graphql/types/create-report.d.ts +4 -0
- package/server/graphql/types/create-report.js +10 -8
- package/server/graphql/types/id.d.ts +4 -0
- package/server/graphql/types/id.js +24 -23
- package/server/graphql/types/identify-comment-author.d.ts +4 -0
- package/server/graphql/types/identify-comment-author.js +7 -5
- package/server/graphql/types/index.d.ts +4 -0
- package/server/graphql/types/index.js +36 -17
- package/server/graphql/types/remove-comment.d.ts +4 -0
- package/server/graphql/types/remove-comment.js +9 -7
- package/server/graphql/types/report-reason.d.ts +4 -0
- package/server/graphql/types/report-reason.js +10 -8
- package/server/graphql/types/report.d.ts +4 -0
- package/server/graphql/types/report.js +12 -10
- package/server/graphql/types/response-find-all.d.ts +4 -0
- package/server/graphql/types/response-find-all.js +8 -6
- package/server/graphql/types/response-meta.d.ts +4 -0
- package/server/graphql/types/response-meta.js +7 -5
- package/server/graphql/types/response-pagination.d.ts +4 -0
- package/server/graphql/types/response-pagination.js +12 -10
- package/server/graphql/types/update-comment.d.ts +4 -0
- package/server/graphql/types/update-comment.js +10 -8
- package/server/index.d.ts +26 -0
- package/server/index.js +24 -21
- package/server/register.d.ts +3 -0
- package/server/register.js +3 -4
- package/server/routes/admin.d.ts +4 -0
- package/server/routes/admin.js +103 -109
- package/server/routes/client.d.ts +4 -0
- package/server/routes/client.js +84 -46
- package/server/routes/index.d.ts +11 -0
- package/server/routes/index.js +18 -14
- package/server/services/admin.d.ts +5 -0
- package/server/services/admin.js +134 -161
- package/server/services/client.d.ts +5 -0
- package/server/services/client.js +164 -168
- package/server/services/common.d.ts +5 -0
- package/server/services/common.js +192 -202
- package/server/services/graphql.d.ts +5 -0
- package/server/services/graphql.js +117 -182
- package/server/services/index.d.ts +8 -0
- package/server/services/index.js +15 -12
- package/server/services/utils/functions.d.ts +13 -0
- package/server/services/utils/functions.js +105 -109
- package/server/utils/constants.d.ts +9 -0
- package/server/utils/constants.js +19 -23
- package/server/utils/error.d.ts +19 -0
- package/server/utils/error.js +23 -18
- package/server/utils/functions.d.ts +6 -0
- package/server/utils/functions.js +35 -18
- package/strapi-admin.d.ts +3 -0
- package/strapi-admin.js +8 -3
- package/strapi-server.d.ts +177 -0
- package/strapi-server.js +43 -46
- package/tsconfig.tsbuildinfo +1 -0
- package/types/contentTypes.d.ts +48 -0
- package/types/contentTypes.js +3 -0
- package/.husky/pre-commit +0 -4
- package/LICENSE.md +0 -7
- package/__mocks__/initSetup.js +0 -108
- package/jest.config.js +0 -7
- package/server/controllers/utils/__tests__/functions.test.js +0 -43
- package/server/controllers/utils/__tests__/parsers.test.js +0 -94
- package/server/services/__tests__/common.test.js +0 -399
- package/server/services/utils/__tests__/functions.test.js +0 -53
- package/server/utils/__tests__/functions.test.js +0 -17
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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"));
|
|
3
7
|
module.exports = (context) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
});
|
|
8
|
+
const queries = {
|
|
9
|
+
findAllFlat: findAllFlat_1.default,
|
|
10
|
+
findAllInHierarchy: findAllInHierarchy_1.default,
|
|
11
|
+
};
|
|
12
|
+
return context.nexus.extendType({
|
|
13
|
+
type: "Query",
|
|
14
|
+
definition(t) {
|
|
15
|
+
for (const [name, configFactory] of Object.entries(queries)) {
|
|
16
|
+
const config = configFactory(context);
|
|
17
|
+
t.field(name, config);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
});
|
|
19
21
|
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
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 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
3
2
|
module.exports = ({ config }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
};
|
|
13
12
|
};
|
|
13
|
+
//# sourceMappingURL=resolvers-config.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
3
|
+
name: "CommentAuthor",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("id");
|
|
6
|
+
t.nonNull.string("name");
|
|
7
|
+
t.string("email");
|
|
8
|
+
t.string("avatar");
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=comment-author.js.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
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
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
3
|
+
name: "CommentSingle",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("id");
|
|
6
|
+
t.nonNull.string("content");
|
|
7
|
+
t.boolean("blocked");
|
|
8
|
+
t.boolean("blockedThread");
|
|
9
|
+
t.boolean("removed");
|
|
10
|
+
t.string("approvalStatus");
|
|
11
|
+
t.field("threadOf", { type: "CommentSingle" });
|
|
12
|
+
t.field("author", { type: "CommentAuthor" });
|
|
13
|
+
t.string("createdAt");
|
|
14
|
+
t.string("updatedAt");
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
3
|
+
name: "CreateCommentAuthor",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.nonNull.id("id");
|
|
6
|
+
t.nonNull.string("name");
|
|
7
|
+
t.string("email");
|
|
8
|
+
t.string("avatar");
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=create-comment-author.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
3
|
+
name: "CreateComment",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.nonNull.string("content");
|
|
6
|
+
t.nonNull.string("relation");
|
|
7
|
+
t.id("threadOf");
|
|
8
|
+
t.field("author", { type: "CreateCommentAuthor" });
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=create-comment.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
3
|
+
name: "CreateReport",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("commentId");
|
|
6
|
+
t.nonNull.string("relation");
|
|
7
|
+
t.nonNull.string("content");
|
|
8
|
+
t.field("reason", { type: "ReportReason" });
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=create-report.js.map
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
const {
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
const { isNumber, parseInt } = require("lodash");
|
|
3
|
+
const { Kind } = require("graphql");
|
|
4
4
|
module.exports = ({ nexus }) => nexus.scalarType({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
5
|
+
name: "Id",
|
|
6
|
+
asNexusMethod: "id",
|
|
7
|
+
description: "Id as string or int",
|
|
8
|
+
parseValue(value) {
|
|
9
|
+
const parsedValue = parseInt(value);
|
|
10
|
+
if (isNumber(parsedValue)) {
|
|
11
|
+
return parsedValue;
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
},
|
|
15
|
+
serialize(value) {
|
|
16
|
+
return value;
|
|
17
|
+
},
|
|
18
|
+
parseLiteral(ast) {
|
|
19
|
+
if ([Kind.INT, Kind.STRING].includes(ast.kind)) {
|
|
20
|
+
return ast.value;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
3
|
+
name: "IdentifyCommentAuthor",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.nonNull.id("id");
|
|
6
|
+
},
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=identify-comment-author.js.map
|
|
@@ -1,19 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const id_1 = __importDefault(require("./id"));
|
|
6
|
+
const comment_1 = __importDefault(require("./comment"));
|
|
7
|
+
const comment_nested_1 = __importDefault(require("./comment-nested"));
|
|
8
|
+
const comment_author_1 = __importDefault(require("./comment-author"));
|
|
9
|
+
const create_comment_1 = __importDefault(require("./create-comment"));
|
|
10
|
+
const create_comment_author_1 = __importDefault(require("./create-comment-author"));
|
|
11
|
+
const update_comment_1 = __importDefault(require("./update-comment"));
|
|
12
|
+
const remove_comment_1 = __importDefault(require("./remove-comment"));
|
|
13
|
+
const identify_comment_author_1 = __importDefault(require("./identify-comment-author"));
|
|
14
|
+
const report_1 = __importDefault(require("./report"));
|
|
15
|
+
const report_reason_1 = __importDefault(require("./report-reason"));
|
|
16
|
+
const create_report_1 = __importDefault(require("./create-report"));
|
|
17
|
+
const response_pagination_1 = __importDefault(require("./response-pagination"));
|
|
18
|
+
const response_meta_1 = __importDefault(require("./response-meta"));
|
|
19
|
+
const response_find_all_1 = __importDefault(require("./response-find-all"));
|
|
1
20
|
const typesFactories = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
id_1.default,
|
|
22
|
+
comment_1.default,
|
|
23
|
+
comment_nested_1.default,
|
|
24
|
+
comment_author_1.default,
|
|
25
|
+
create_comment_1.default,
|
|
26
|
+
create_comment_author_1.default,
|
|
27
|
+
update_comment_1.default,
|
|
28
|
+
remove_comment_1.default,
|
|
29
|
+
identify_comment_author_1.default,
|
|
30
|
+
report_1.default,
|
|
31
|
+
report_reason_1.default,
|
|
32
|
+
create_report_1.default,
|
|
33
|
+
response_pagination_1.default,
|
|
34
|
+
response_meta_1.default,
|
|
35
|
+
response_find_all_1.default,
|
|
17
36
|
];
|
|
18
|
-
|
|
19
|
-
|
|
37
|
+
module.exports = (context) => typesFactories.map((factory) => factory(context));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
3
|
+
name: "RemoveComment",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("id");
|
|
6
|
+
t.nonNull.string("relation");
|
|
7
|
+
t.field("author", { type: "IdentifyCommentAuthor" });
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=remove-comment.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus, config }) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const { reportReasons } = config;
|
|
4
|
+
return nexus.enumType({
|
|
5
|
+
name: "ReportReason",
|
|
6
|
+
description: "Reason of abuse report",
|
|
7
|
+
members: {
|
|
8
|
+
...reportReasons,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
10
11
|
};
|
|
12
|
+
//# sourceMappingURL=report-reason.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
3
|
+
name: "Report",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("id");
|
|
6
|
+
t.nonNull.string("content");
|
|
7
|
+
t.field("reason", { type: "ReportReason" });
|
|
8
|
+
t.field("related", { type: "CommentSingle" });
|
|
9
|
+
t.string("createdAt");
|
|
10
|
+
t.string("updatedAt");
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})
|
|
3
|
+
name: "ResponseFindAll",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.list.field("data", { type: "CommentSingle" });
|
|
6
|
+
t.field("meta", { type: "ResponseMeta" });
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=response-find-all.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
3
|
+
name: "ResponseMeta",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.field("pagination", { type: "ResponsePagination" });
|
|
6
|
+
},
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=response-meta.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.objectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
3
|
+
name: "ResponsePagination",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.int("page");
|
|
6
|
+
t.int("pageSize");
|
|
7
|
+
t.int("pageCount");
|
|
8
|
+
t.int("total");
|
|
9
|
+
t.int("start");
|
|
10
|
+
t.int("limit");
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=response-pagination.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
module.exports = ({ nexus }) => nexus.inputObjectType({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
3
|
+
name: "UpdateComment",
|
|
4
|
+
definition(t) {
|
|
5
|
+
t.id("id");
|
|
6
|
+
t.nonNull.string("content");
|
|
7
|
+
t.nonNull.string("relation");
|
|
8
|
+
t.field("author", { type: "IdentifyCommentAuthor" });
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=update-comment.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: () => void;
|
|
3
|
+
bootstrap: ({ strapi }: import("strapi-typed").StrapiContext) => Promise<void>;
|
|
4
|
+
destroy: () => void;
|
|
5
|
+
config: import("../types").StrapiConfig;
|
|
6
|
+
controllers: {
|
|
7
|
+
[key: string]: Object | Function;
|
|
8
|
+
};
|
|
9
|
+
routes: {
|
|
10
|
+
[key: string]: {
|
|
11
|
+
type: string;
|
|
12
|
+
routes: import("strapi-typed").StrapiRoute[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
services: {
|
|
16
|
+
admin: ({ strapi }: import("strapi-typed").StrapiContext) => import("../types").IServiceAdmin;
|
|
17
|
+
client: ({ strapi }: import("strapi-typed").StrapiContext) => import("../types").IServiceClient;
|
|
18
|
+
common: ({ strapi }: import("strapi-typed").StrapiContext) => import("../types").IServiceCommon;
|
|
19
|
+
gql: ({ strapi }: import("strapi-typed").StrapiContext) => import("../types").IServiceGraphQL;
|
|
20
|
+
};
|
|
21
|
+
contentTypes: {};
|
|
22
|
+
policies: {};
|
|
23
|
+
middlewares: {};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|