strapi-plugin-comments 3.0.0-beta.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +83 -123
  2. package/dist/_chunks/{index-fAgatqD0.js → index-B-ygLKrb.js} +6080 -5662
  3. package/dist/_chunks/{index-fSb-gYwg.mjs → index-BgN4aUMA.mjs} +5 -5
  4. package/dist/_chunks/{index-h-TB6Qu2.mjs → index-Bx2boY6h.mjs} +6072 -5654
  5. package/dist/_chunks/{index-BQERo8pN.mjs → index-CIqMAf50.mjs} +1261 -1141
  6. package/dist/_chunks/{index-B6Q4U8YQ.js → index-CWfr5ejx.js} +27 -29
  7. package/dist/_chunks/{index-CTjupB9v.js → index-D8uskGzQ.js} +5 -5
  8. package/dist/_chunks/{index-BVj8EXjI.js → index-DFAPx7Bl.js} +1293 -1152
  9. package/dist/_chunks/{index-Bpbf7RON.mjs → index-Db2zwbpe.mjs} +27 -29
  10. package/dist/admin/index.js +1 -1
  11. package/dist/admin/index.mjs +1 -1
  12. package/dist/admin/src/api/client.d.ts +33 -52
  13. package/dist/admin/src/api/schemas.d.ts +454 -764
  14. package/dist/admin/src/components/UserAvatar/index.d.ts +1 -1
  15. package/dist/admin/src/contexts/UserContext.d.ts +1 -1
  16. package/dist/admin/src/hooks/useAPI.d.ts +34 -53
  17. package/dist/admin/src/hooks/useCommentMutations.d.ts +1 -1
  18. package/dist/admin/src/hooks/useCommentsAll.d.ts +7 -10
  19. package/dist/admin/src/hooks/useReports.d.ts +6 -10
  20. package/dist/admin/src/hooks/useUserContext.d.ts +1 -1
  21. package/dist/admin/src/pages/Settings/hooks/useSettingsAPI.d.ts +1 -1
  22. package/dist/server/index.js +9307 -2467
  23. package/dist/server/index.mjs +9307 -2467
  24. package/dist/server/src/{@types-v5 → @types}/utils.d.ts +4 -0
  25. package/dist/server/src/bootstrap.d.ts +1 -1
  26. package/dist/server/src/config/index.d.ts +52 -0
  27. package/dist/server/src/content-types/index.d.ts +1 -1
  28. package/dist/server/src/controllers/admin.controller.d.ts +110 -29
  29. package/dist/server/src/controllers/client.controller.d.ts +151 -23
  30. package/dist/server/src/controllers/index.d.ts +504 -197
  31. package/dist/server/src/controllers/settings.controller.d.ts +58 -2
  32. package/dist/server/src/controllers/utils/parsers.d.ts +4 -1
  33. package/dist/server/src/graphql/getResolversConfig.d.ts +21 -0
  34. package/dist/server/src/graphql/index.d.ts +2 -0
  35. package/dist/server/src/graphql/mutations/getCreateAbuseReport.d.ts +95 -0
  36. package/dist/server/src/graphql/mutations/getCreateComment.d.ts +84 -0
  37. package/dist/server/src/graphql/mutations/getRemoveComment.d.ts +84 -0
  38. package/dist/server/src/graphql/mutations/getUpdateComment.d.ts +84 -0
  39. package/dist/server/src/graphql/mutations/index.d.ts +3 -0
  40. package/dist/server/src/graphql/queries/findAllFlat.d.ts +177 -0
  41. package/dist/server/src/graphql/queries/findAllInHierarchy.d.ts +87 -0
  42. package/dist/server/src/graphql/queries/findAllPerAuthor.d.ts +176 -0
  43. package/dist/server/src/graphql/queries/index.d.ts +3 -0
  44. package/dist/server/src/graphql/types/getComment.d.ts +2 -0
  45. package/dist/server/src/graphql/types/getCommentAuthor.d.ts +2 -0
  46. package/dist/server/src/graphql/types/getCommentAuthorType.d.ts +2 -0
  47. package/dist/server/src/graphql/types/getCommentNested.d.ts +2 -0
  48. package/dist/server/src/graphql/types/getCreateComment.d.ts +2 -0
  49. package/dist/server/src/graphql/types/getCreateCommentAuthor.d.ts +2 -0
  50. package/dist/server/src/graphql/types/getCreateReport.d.ts +2 -0
  51. package/dist/server/src/graphql/types/getId.d.ts +2 -0
  52. package/dist/server/src/graphql/types/getIdentityAuthor.d.ts +2 -0
  53. package/dist/server/src/graphql/types/getRemoveComment.d.ts +2 -0
  54. package/dist/server/src/graphql/types/getReport.d.ts +2 -0
  55. package/dist/server/src/graphql/types/getReportReason.d.ts +3 -0
  56. package/dist/server/src/graphql/types/getResponseFindAll.d.ts +2 -0
  57. package/dist/server/src/graphql/types/getResponseFindAllPerAuthor.d.ts +2 -0
  58. package/dist/server/src/graphql/types/getResponseMeta.d.ts +2 -0
  59. package/dist/server/src/graphql/types/getResponsePagination.d.ts +2 -0
  60. package/dist/server/src/graphql/types/getUpdateComment.d.ts +2 -0
  61. package/dist/server/src/graphql/types/index.d.ts +3 -0
  62. package/dist/server/src/index.d.ts +1686 -779
  63. package/dist/server/src/register/custom-fields/index.d.ts +1 -1
  64. package/dist/server/src/register/index.d.ts +1 -1
  65. package/dist/server/src/repositories/comment.repository.d.ts +10 -1
  66. package/dist/server/src/repositories/index.d.ts +0 -2
  67. package/dist/server/src/repositories/report.comment.repository.d.ts +38 -1
  68. package/dist/server/src/repositories/store.repository.d.ts +175 -4
  69. package/dist/server/src/repositories/utils.d.ts +1 -3
  70. package/dist/server/src/routes/admin.routes.d.ts +1 -1
  71. package/dist/server/src/routes/client.routes.d.ts +1 -1
  72. package/dist/server/src/routes/index.d.ts +2 -2
  73. package/dist/server/src/services/admin/admin.service.d.ts +399 -188
  74. package/dist/server/src/services/admin/utils.d.ts +1 -1
  75. package/dist/server/src/services/client.service.d.ts +343 -177
  76. package/dist/server/src/services/common.service.d.ts +66 -22
  77. package/dist/server/src/services/gql.service.d.ts +7 -0
  78. package/dist/server/src/services/index.d.ts +1131 -552
  79. package/dist/server/src/services/settings.service.d.ts +44 -2
  80. package/dist/server/src/services/utils/functions.d.ts +10 -6
  81. package/dist/server/src/test/utils.d.ts +1 -0
  82. package/dist/server/src/utils/constants.d.ts +1 -1
  83. package/dist/server/src/utils/getConfig.d.ts +2 -2
  84. package/dist/server/src/utils/getPluginService.d.ts +2 -2
  85. package/dist/server/src/utils/throwError.d.ts +1 -1
  86. package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +116 -80
  87. package/dist/server/src/validators/api/controllers/settings.controller.validator.d.ts +7 -3
  88. package/dist/server/src/validators/repositories/comment.schema.d.ts +18 -3
  89. package/dist/server/src/validators/repositories/comment.validator.d.ts +400 -72
  90. package/dist/server/src/validators/repositories/reports.validator.d.ts +60 -18
  91. package/dist/server/src/validators/utils.d.ts +1 -1
  92. package/package.json +18 -11
  93. /package/dist/server/src/{@types-v5 → @types}/controllers.d.ts +0 -0
  94. /package/dist/server/src/{@types-v5 → @types}/index.d.ts +0 -0
  95. /package/dist/server/src/{@types-v5 → @types}/repositories.d.ts +0 -0
  96. /package/dist/server/src/{@types-v5 → @types}/routes.d.ts +0 -0
@@ -0,0 +1,87 @@
1
+ import { CoreStrapi } from '../../@types';
2
+ import { Nexus } from '../../@types/graphql';
3
+ declare const _default: (strapi: CoreStrapi, nexus: Nexus) => {
4
+ type: import("nexus/dist/core").NexusNonNullDef<any>;
5
+ args: {
6
+ relation: import("nexus/dist/core").NexusNonNullDef<any>;
7
+ sort: any;
8
+ filters: any;
9
+ };
10
+ resolve(_obj: any, args: any): Promise<{
11
+ id?: number;
12
+ documentId?: string;
13
+ content?: string;
14
+ blocked?: boolean;
15
+ blockedThread?: boolean;
16
+ blockReason?: string;
17
+ isAdminComment?: boolean;
18
+ removed?: boolean;
19
+ approvalStatus?: string;
20
+ related?: string;
21
+ createdAt?: string;
22
+ updatedAt?: string;
23
+ publishedAt?: string;
24
+ authorId?: string;
25
+ authorName?: string;
26
+ authorEmail?: string;
27
+ authorAvatar?: string;
28
+ authorUser?: string | {
29
+ id?: number;
30
+ email?: string;
31
+ };
32
+ locale?: string;
33
+ gotThread?: boolean;
34
+ threadFirstItemId?: number;
35
+ reports?: {
36
+ id?: number;
37
+ documentId?: string;
38
+ content?: string;
39
+ createdAt?: string;
40
+ updatedAt?: string;
41
+ publishedAt?: string;
42
+ locale?: string;
43
+ reason?: string;
44
+ resolved?: boolean;
45
+ }[];
46
+ author?: any;
47
+ threadOf?: number | {
48
+ id?: number;
49
+ documentId?: string;
50
+ content?: string;
51
+ blocked?: boolean;
52
+ blockedThread?: boolean;
53
+ blockReason?: string;
54
+ isAdminComment?: boolean;
55
+ removed?: boolean;
56
+ approvalStatus?: string;
57
+ related?: string;
58
+ createdAt?: string;
59
+ updatedAt?: string;
60
+ publishedAt?: string;
61
+ authorId?: string;
62
+ authorName?: string;
63
+ authorEmail?: string;
64
+ authorAvatar?: string;
65
+ authorUser?: string | {
66
+ id?: number;
67
+ email?: string;
68
+ };
69
+ locale?: string;
70
+ gotThread?: boolean;
71
+ threadFirstItemId?: number;
72
+ reports?: {
73
+ id?: number;
74
+ documentId?: string;
75
+ content?: string;
76
+ createdAt?: string;
77
+ updatedAt?: string;
78
+ publishedAt?: string;
79
+ locale?: string;
80
+ reason?: string;
81
+ resolved?: boolean;
82
+ }[];
83
+ author?: any;
84
+ };
85
+ }[]>;
86
+ };
87
+ export default _default;
@@ -0,0 +1,176 @@
1
+ import { CoreStrapi } from '../../@types';
2
+ import { Nexus } from '../../@types/graphql';
3
+ declare const _default: (strapi: CoreStrapi, nexus: Nexus) => {
4
+ type: string;
5
+ args: {
6
+ authorId: import("nexus/dist/core").NexusNonNullDef<any>;
7
+ authorType: import("nexus/dist/core").NexusArgDef<any>;
8
+ filters: any;
9
+ pagination: any;
10
+ sort: any;
11
+ };
12
+ resolve(obj: Object, args: ResponseFindAllPerAuthorResolverProps): Promise<{
13
+ data: ({
14
+ id?: number;
15
+ documentId?: string;
16
+ content?: string;
17
+ blocked?: boolean;
18
+ blockedThread?: boolean;
19
+ blockReason?: string;
20
+ isAdminComment?: boolean;
21
+ removed?: boolean;
22
+ approvalStatus?: string;
23
+ related?: string;
24
+ createdAt?: string;
25
+ updatedAt?: string;
26
+ publishedAt?: string;
27
+ authorId?: string;
28
+ authorName?: string;
29
+ authorEmail?: string;
30
+ authorAvatar?: string;
31
+ authorUser?: string | {
32
+ id?: number;
33
+ email?: string;
34
+ };
35
+ locale?: string;
36
+ gotThread?: boolean;
37
+ threadFirstItemId?: number;
38
+ reports?: {
39
+ id?: number;
40
+ documentId?: string;
41
+ content?: string;
42
+ createdAt?: string;
43
+ updatedAt?: string;
44
+ publishedAt?: string;
45
+ locale?: string;
46
+ reason?: string;
47
+ resolved?: boolean;
48
+ }[];
49
+ threadOf?: number | {
50
+ id?: number;
51
+ documentId?: string;
52
+ content?: string;
53
+ blocked?: boolean;
54
+ blockedThread?: boolean;
55
+ blockReason?: string;
56
+ isAdminComment?: boolean;
57
+ removed?: boolean;
58
+ approvalStatus?: string;
59
+ related?: string;
60
+ createdAt?: string;
61
+ updatedAt?: string;
62
+ publishedAt?: string;
63
+ authorId?: string;
64
+ authorName?: string;
65
+ authorEmail?: string;
66
+ authorAvatar?: string;
67
+ authorUser?: string | {
68
+ id?: number;
69
+ email?: string;
70
+ };
71
+ locale?: string;
72
+ gotThread?: boolean;
73
+ threadFirstItemId?: number;
74
+ reports?: {
75
+ id?: number;
76
+ documentId?: string;
77
+ content?: string;
78
+ createdAt?: string;
79
+ updatedAt?: string;
80
+ publishedAt?: string;
81
+ locale?: string;
82
+ reason?: string;
83
+ resolved?: boolean;
84
+ }[];
85
+ author?: any;
86
+ };
87
+ } | {
88
+ id?: number;
89
+ documentId?: string;
90
+ content?: string;
91
+ blocked?: boolean;
92
+ blockedThread?: boolean;
93
+ blockReason?: string;
94
+ isAdminComment?: boolean;
95
+ removed?: boolean;
96
+ approvalStatus?: string;
97
+ related?: {
98
+ id?: number;
99
+ documentId?: string;
100
+ locale?: string;
101
+ uid?: string;
102
+ requireCommentsApproval?: boolean;
103
+ };
104
+ createdAt?: string;
105
+ updatedAt?: string;
106
+ publishedAt?: string;
107
+ authorId?: string;
108
+ authorName?: string;
109
+ authorEmail?: string;
110
+ authorAvatar?: string;
111
+ authorUser?: string | {
112
+ id?: number;
113
+ email?: string;
114
+ };
115
+ locale?: string;
116
+ gotThread?: boolean;
117
+ threadFirstItemId?: number;
118
+ reports?: {
119
+ id?: number;
120
+ documentId?: string;
121
+ content?: string;
122
+ createdAt?: string;
123
+ updatedAt?: string;
124
+ publishedAt?: string;
125
+ locale?: string;
126
+ reason?: string;
127
+ resolved?: boolean;
128
+ }[];
129
+ threadOf?: number | {
130
+ id?: number;
131
+ documentId?: string;
132
+ content?: string;
133
+ blocked?: boolean;
134
+ blockedThread?: boolean;
135
+ blockReason?: string;
136
+ isAdminComment?: boolean;
137
+ removed?: boolean;
138
+ approvalStatus?: string;
139
+ related?: string;
140
+ createdAt?: string;
141
+ updatedAt?: string;
142
+ publishedAt?: string;
143
+ authorId?: string;
144
+ authorName?: string;
145
+ authorEmail?: string;
146
+ authorAvatar?: string;
147
+ authorUser?: string | {
148
+ id?: number;
149
+ email?: string;
150
+ };
151
+ locale?: string;
152
+ gotThread?: boolean;
153
+ threadFirstItemId?: number;
154
+ reports?: {
155
+ id?: number;
156
+ documentId?: string;
157
+ content?: string;
158
+ createdAt?: string;
159
+ updatedAt?: string;
160
+ publishedAt?: string;
161
+ locale?: string;
162
+ reason?: string;
163
+ resolved?: boolean;
164
+ }[];
165
+ author?: any;
166
+ };
167
+ })[];
168
+ pagination?: {
169
+ page?: number;
170
+ pageSize?: number;
171
+ pageCount?: number;
172
+ total?: number;
173
+ };
174
+ }>;
175
+ };
176
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { CoreStrapi } from '../../@types';
2
+ import { Nexus } from '../../@types/graphql';
3
+ export declare const getQueries: (strapi: CoreStrapi, nexus: Nexus) => import("nexus/dist/core").NexusExtendTypeDef<any>;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getComment: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"CommentSingle">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCommentAuthor: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"CommentAuthor">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCommentAuthorType: (nexus: Nexus) => import("nexus/dist/core").NexusEnumTypeDef<"CommentAuthorType">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCommentNested: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"CommentNested">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCreateComment: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"CreateComment">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCreateCommentAuthor: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"CreateCommentAuthor">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getCreateReport: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"CreateReport">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getIdType: (nexus: Nexus) => import("nexus/dist/core").NexusScalarTypeDef<"ID">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getIdentityAuthor: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"IdentifyCommentAuthor">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getRemoveComment: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"RemoveComment">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getReport: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"Report">;
@@ -0,0 +1,3 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ import { CommentsPluginConfig } from '../../config';
3
+ export declare const getReportReason: (nexus: Nexus, { reportReasons }: CommentsPluginConfig) => import("nexus/dist/core").NexusEnumTypeDef<"ReportReason">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getResponseFindAll: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"ResponseFindAll">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getResponseFindAllPerAuthor: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"ResponseFindAllPerAuthor">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getResponseMeta: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"ResponseMeta">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getResponsePagination: (nexus: Nexus) => import("nexus/dist/core").NexusObjectTypeDef<"ResponsePagination">;
@@ -0,0 +1,2 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ export declare const getUpdateComment: (nexus: Nexus) => import("nexus/dist/core").NexusInputObjectTypeDef<"UpdateComment">;
@@ -0,0 +1,3 @@
1
+ import { Nexus } from '../../@types/graphql';
2
+ import { CommentsPluginConfig } from '../../config';
3
+ export declare const getTypes: (config: CommentsPluginConfig, nexus: Nexus) => (import("nexus/dist/core").NexusEnumTypeDef<"CommentAuthorType"> | import("nexus/dist/core").NexusObjectTypeDef<"CommentSingle"> | import("nexus/dist/core").NexusObjectTypeDef<"CommentAuthor"> | import("nexus/dist/core").NexusObjectTypeDef<"CommentNested"> | import("nexus/dist/core").NexusInputObjectTypeDef<"CreateComment"> | import("nexus/dist/core").NexusInputObjectTypeDef<"CreateCommentAuthor"> | import("nexus/dist/core").NexusInputObjectTypeDef<"CreateReport"> | import("nexus/dist/core").NexusScalarTypeDef<"ID"> | import("nexus/dist/core").NexusInputObjectTypeDef<"IdentifyCommentAuthor"> | import("nexus/dist/core").NexusInputObjectTypeDef<"RemoveComment"> | import("nexus/dist/core").NexusObjectTypeDef<"Report"> | import("nexus/dist/core").NexusEnumTypeDef<"ReportReason"> | import("nexus/dist/core").NexusObjectTypeDef<"ResponseFindAll"> | import("nexus/dist/core").NexusObjectTypeDef<"ResponseFindAllPerAuthor"> | import("nexus/dist/core").NexusObjectTypeDef<"ResponseMeta"> | import("nexus/dist/core").NexusObjectTypeDef<"ResponsePagination"> | import("nexus/dist/core").NexusInputObjectTypeDef<"UpdateComment">)[];