strapi-plugin-comments 3.0.0-beta.0 → 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/README.md +6 -5
- package/dist/_chunks/{index-h-TB6Qu2.mjs → index-BBcsmSTs.mjs} +6976 -6733
- package/dist/_chunks/{index-CTjupB9v.js → index-BFPteXuP.js} +2 -2
- package/dist/_chunks/{index-B6Q4U8YQ.js → index-BXEk5PWx.js} +9 -5
- package/dist/_chunks/{index-BVj8EXjI.js → index-Bcck91A8.js} +5 -10
- package/dist/_chunks/{index-fAgatqD0.js → index-CY_AVWS-.js} +6987 -6744
- package/dist/_chunks/{index-fSb-gYwg.mjs → index-D3iNqWZT.mjs} +2 -2
- package/dist/_chunks/{index-Bpbf7RON.mjs → index-D9MOkoQ2.mjs} +9 -5
- package/dist/_chunks/{index-BQERo8pN.mjs → index-DJ32APz-.mjs} +5 -10
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/api/client.d.ts +3 -2
- package/dist/admin/src/api/schemas.d.ts +22 -8
- package/dist/admin/src/contexts/UserContext.d.ts +1 -1
- package/dist/admin/src/hooks/useAPI.d.ts +4 -3
- package/dist/admin/src/hooks/useCommentMutations.d.ts +1 -1
- package/dist/admin/src/hooks/useCommentsAll.d.ts +1 -0
- package/dist/admin/src/hooks/useUserContext.d.ts +1 -1
- package/dist/admin/src/pages/Settings/hooks/useSettingsAPI.d.ts +1 -1
- package/dist/server/index.js +9245 -2459
- package/dist/server/index.mjs +9245 -2459
- package/dist/server/src/config/index.d.ts +22 -0
- package/dist/server/src/controllers/admin.controller.d.ts +3 -1
- package/dist/server/src/controllers/client.controller.d.ts +36 -2
- package/dist/server/src/controllers/index.d.ts +213 -115
- package/dist/server/src/controllers/settings.controller.d.ts +25 -1
- package/dist/server/src/controllers/utils/parsers.d.ts +4 -1
- 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 +771 -471
- package/dist/server/src/repositories/store.repository.d.ts +17 -2
- package/dist/server/src/services/admin/admin.service.d.ts +174 -117
- package/dist/server/src/services/client.service.d.ts +173 -118
- package/dist/server/src/services/common.service.d.ts +8 -5
- package/dist/server/src/services/gql.service.d.ts +7 -0
- package/dist/server/src/services/index.d.ts +549 -356
- package/dist/server/src/services/settings.service.d.ts +19 -1
- package/dist/server/src/services/utils/functions.d.ts +9 -3
- package/dist/server/src/utils/getConfig.d.ts +1 -1
- package/dist/server/src/utils/getPluginService.d.ts +1 -1
- package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +112 -77
- package/dist/server/src/validators/api/controllers/settings.controller.validator.d.ts +3 -3
- package/dist/server/src/validators/repositories/comment.validator.d.ts +16 -0
- package/dist/server/src/validators/utils.d.ts +1 -1
- package/package.json +7 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StrapiContext } from '../@types-v5';
|
|
2
|
-
import { CommentsPluginConfig } from '../
|
|
2
|
+
import { CommentsPluginConfig } from '../config';
|
|
3
3
|
declare const _default: ({ strapi }: StrapiContext) => {
|
|
4
4
|
getConfig: (viaSettingsPage?: boolean) => Promise<{
|
|
5
5
|
enabledCollections?: string[];
|
|
@@ -15,6 +15,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
15
15
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
16
16
|
};
|
|
17
17
|
isGQLPluginEnabled?: boolean;
|
|
18
|
+
gql?: {
|
|
19
|
+
auth?: boolean;
|
|
20
|
+
};
|
|
18
21
|
} | Omit<{
|
|
19
22
|
enabledCollections?: string[];
|
|
20
23
|
approvalFlow?: string[];
|
|
@@ -29,6 +32,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
29
32
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
30
33
|
};
|
|
31
34
|
isGQLPluginEnabled?: boolean;
|
|
35
|
+
gql?: {
|
|
36
|
+
auth?: boolean;
|
|
37
|
+
};
|
|
32
38
|
}, "enabledCollections" | "moderatorRoles" | "isGQLPluginEnabled">>;
|
|
33
39
|
update: (config: CommentsPluginConfig) => Promise<{
|
|
34
40
|
enabledCollections?: string[];
|
|
@@ -44,6 +50,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
44
50
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
45
51
|
};
|
|
46
52
|
isGQLPluginEnabled?: boolean;
|
|
53
|
+
gql?: {
|
|
54
|
+
auth?: boolean;
|
|
55
|
+
};
|
|
47
56
|
} | Omit<{
|
|
48
57
|
enabledCollections?: string[];
|
|
49
58
|
approvalFlow?: string[];
|
|
@@ -58,6 +67,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
58
67
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
59
68
|
};
|
|
60
69
|
isGQLPluginEnabled?: boolean;
|
|
70
|
+
gql?: {
|
|
71
|
+
auth?: boolean;
|
|
72
|
+
};
|
|
61
73
|
}, "enabledCollections" | "moderatorRoles" | "isGQLPluginEnabled">>;
|
|
62
74
|
restore: () => Promise<{
|
|
63
75
|
enabledCollections?: string[];
|
|
@@ -73,6 +85,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
73
85
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
74
86
|
};
|
|
75
87
|
isGQLPluginEnabled?: boolean;
|
|
88
|
+
gql?: {
|
|
89
|
+
auth?: boolean;
|
|
90
|
+
};
|
|
76
91
|
} | Omit<{
|
|
77
92
|
enabledCollections?: string[];
|
|
78
93
|
approvalFlow?: string[];
|
|
@@ -87,6 +102,9 @@ declare const _default: ({ strapi }: StrapiContext) => {
|
|
|
87
102
|
OTHER?: import("../const").REPORT_REASON.OTHER;
|
|
88
103
|
};
|
|
89
104
|
isGQLPluginEnabled?: boolean;
|
|
105
|
+
gql?: {
|
|
106
|
+
auth?: boolean;
|
|
107
|
+
};
|
|
90
108
|
}, "enabledCollections" | "moderatorRoles" | "isGQLPluginEnabled">>;
|
|
91
109
|
restart: () => void;
|
|
92
110
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StrapiUser } from '@sensinum/strapi-utils';
|
|
2
2
|
import { AdminUser, Id } from '../../@types-v5';
|
|
3
3
|
import PluginError from '../../utils/error';
|
|
4
4
|
import { Comment, CommentWithRelated } from '../../validators/repositories';
|
|
@@ -6,7 +6,13 @@ export declare const buildNestedStructure: (entities: Array<Comment | CommentWit
|
|
|
6
6
|
export declare const getRelatedGroups: (related: string) => Array<string>;
|
|
7
7
|
export declare const getModelUid: (name: string) => string;
|
|
8
8
|
export declare const filterOurResolvedReports: (item: Comment) => Comment;
|
|
9
|
-
export declare const buildAuthorModel: (item:
|
|
9
|
+
export declare const buildAuthorModel: (item: Comment | CommentWithRelated, blockedAuthorProps: Array<string>, fieldsToPopulate?: Array<string>) => Comment;
|
|
10
10
|
export declare const buildConfigQueryProp: (prop?: undefined | string | Array<string>) => string;
|
|
11
11
|
export declare const resolveUserContextError: (user?: AdminUser | StrapiUser) => PluginError;
|
|
12
|
-
|
|
12
|
+
type AuthorNameProps = {
|
|
13
|
+
lastname?: string;
|
|
14
|
+
firstname?: string;
|
|
15
|
+
username?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const getAuthorName: (author: AuthorNameProps) => string;
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StrapiContext } from '../@types-v5';
|
|
2
2
|
import { CommentsPluginConfig } from '../config';
|
|
3
|
-
export declare const getConfig: <T extends "enabledCollections" | "approvalFlow" | "entryLabel" | "moderatorRoles" | "badWords" | "blockedAuthorProps" | "isValidationEnabled" | "reportReasons" | "isGQLPluginEnabled">(strapi: StrapiContext['strapi'], path: T, defaultValue: CommentsPluginConfig[T]) => Promise<CommentsPluginConfig[T]>;
|
|
3
|
+
export declare const getConfig: <T extends "enabledCollections" | "approvalFlow" | "entryLabel" | "moderatorRoles" | "badWords" | "blockedAuthorProps" | "isValidationEnabled" | "reportReasons" | "isGQLPluginEnabled" | "gql">(strapi: StrapiContext['strapi'], path: T, defaultValue: CommentsPluginConfig[T]) => Promise<CommentsPluginConfig[T]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CoreStrapi } from '../@types-v5';
|
|
2
2
|
import { PluginServices } from '../services';
|
|
3
|
-
export declare const getPluginService: <T extends "admin" | "client" | "common" | "settings">(strapi: CoreStrapi, serviceName: T) => PluginServices[T];
|
|
3
|
+
export declare const getPluginService: <T extends "gql" | "admin" | "client" | "common" | "settings">(strapi: CoreStrapi, serviceName: T) => PluginServices[T];
|
|
@@ -3,6 +3,7 @@ import { ExtractRightEither } from '../../../utils/Either';
|
|
|
3
3
|
export declare const newCommentValidator: (enabledCollections: string[], relation: string, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
4
4
|
content?: string;
|
|
5
5
|
approvalStatus?: APPROVAL_STATUS;
|
|
6
|
+
locale?: string;
|
|
6
7
|
author?: {
|
|
7
8
|
name?: string;
|
|
8
9
|
id?: number;
|
|
@@ -10,18 +11,29 @@ export declare const newCommentValidator: (enabledCollections: string[], relatio
|
|
|
10
11
|
avatar?: string;
|
|
11
12
|
};
|
|
12
13
|
threadOf?: number;
|
|
13
|
-
relation?: `{${string}::${string}.${
|
|
14
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
14
15
|
}>;
|
|
15
16
|
export type NewCommentValidatorSchema = ExtractRightEither<ReturnType<typeof newCommentValidator>>;
|
|
16
17
|
export declare const updateCommentValidator: (enabledCollections: string[], payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
17
18
|
content?: string;
|
|
18
|
-
relation?: `{${string}::${string}.${
|
|
19
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
19
20
|
commentId?: number;
|
|
20
21
|
}>;
|
|
21
22
|
export type UpdateCommentValidatorSchema = ExtractRightEither<ReturnType<typeof updateCommentValidator>>;
|
|
22
23
|
export declare const findAllFlatValidator: (enabledCollections: string[], relation: string, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
sort?: string;
|
|
25
|
+
locale?: string;
|
|
26
|
+
pagination?: {
|
|
27
|
+
page?: number;
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
withCount?: boolean;
|
|
30
|
+
};
|
|
31
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
32
|
+
populate?: Record<string, boolean | {
|
|
33
|
+
populate?: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
filters?: {
|
|
36
|
+
id?: string | number | {
|
|
25
37
|
$eq?: string;
|
|
26
38
|
} | {
|
|
27
39
|
$eqi?: string;
|
|
@@ -55,8 +67,8 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
55
67
|
$notContainsi?: string;
|
|
56
68
|
} | {
|
|
57
69
|
$notNull?: boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
70
|
+
};
|
|
71
|
+
content?: string | number | {
|
|
60
72
|
$eq?: string;
|
|
61
73
|
} | {
|
|
62
74
|
$eqi?: string;
|
|
@@ -90,11 +102,8 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
90
102
|
$notContainsi?: string;
|
|
91
103
|
} | {
|
|
92
104
|
$notNull?: boolean;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
sort?: string;
|
|
96
|
-
filter?: {
|
|
97
|
-
content?: string | number | {
|
|
105
|
+
};
|
|
106
|
+
createdAt?: string | number | {
|
|
98
107
|
$eq?: string;
|
|
99
108
|
} | {
|
|
100
109
|
$eqi?: string;
|
|
@@ -129,7 +138,7 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
129
138
|
} | {
|
|
130
139
|
$notNull?: boolean;
|
|
131
140
|
};
|
|
132
|
-
|
|
141
|
+
updatedAt?: string | number | {
|
|
133
142
|
$eq?: string;
|
|
134
143
|
} | {
|
|
135
144
|
$eqi?: string;
|
|
@@ -164,7 +173,7 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
164
173
|
} | {
|
|
165
174
|
$notNull?: boolean;
|
|
166
175
|
};
|
|
167
|
-
|
|
176
|
+
authorName?: string | number | {
|
|
168
177
|
$eq?: string;
|
|
169
178
|
} | {
|
|
170
179
|
$eqi?: string;
|
|
@@ -199,7 +208,23 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
199
208
|
} | {
|
|
200
209
|
$notNull?: boolean;
|
|
201
210
|
};
|
|
202
|
-
|
|
211
|
+
};
|
|
212
|
+
limit?: number;
|
|
213
|
+
fields?: string[];
|
|
214
|
+
omit?: string[];
|
|
215
|
+
isAdmin?: boolean;
|
|
216
|
+
skip?: number;
|
|
217
|
+
}>;
|
|
218
|
+
export type FindAllFlatSchema = ExtractRightEither<ReturnType<typeof findAllFlatValidator>>;
|
|
219
|
+
export declare const findAllInHierarchyValidator: (enabledCollections: string[], relation: string, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
220
|
+
sort?: string;
|
|
221
|
+
locale?: string;
|
|
222
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
223
|
+
populate?: Record<string, boolean | {
|
|
224
|
+
populate?: boolean;
|
|
225
|
+
}>;
|
|
226
|
+
filters?: {
|
|
227
|
+
id?: string | number | {
|
|
203
228
|
$eq?: string;
|
|
204
229
|
} | {
|
|
205
230
|
$eqi?: string;
|
|
@@ -234,26 +259,7 @@ export declare const findAllFlatValidator: (enabledCollections: string[], relati
|
|
|
234
259
|
} | {
|
|
235
260
|
$notNull?: boolean;
|
|
236
261
|
};
|
|
237
|
-
|
|
238
|
-
pagination?: {
|
|
239
|
-
page?: number;
|
|
240
|
-
pageSize?: number;
|
|
241
|
-
withCount?: boolean;
|
|
242
|
-
};
|
|
243
|
-
relation?: `{${string}::${string}.${number}}`;
|
|
244
|
-
populate?: Record<string, boolean | {
|
|
245
|
-
populate?: boolean;
|
|
246
|
-
}>;
|
|
247
|
-
limit?: number;
|
|
248
|
-
fields?: string[];
|
|
249
|
-
omit?: string[];
|
|
250
|
-
isAdmin?: boolean;
|
|
251
|
-
skip?: number;
|
|
252
|
-
}>;
|
|
253
|
-
export type FindAllFlatSchema = ExtractRightEither<ReturnType<typeof findAllFlatValidator>>;
|
|
254
|
-
export declare const findAllInHierarchyValidator: (enabledCollections: string[], relation: string, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
255
|
-
query?: {
|
|
256
|
-
$and?: Record<string, string | number | {
|
|
262
|
+
content?: string | number | {
|
|
257
263
|
$eq?: string;
|
|
258
264
|
} | {
|
|
259
265
|
$eqi?: string;
|
|
@@ -287,8 +293,8 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
287
293
|
$notContainsi?: string;
|
|
288
294
|
} | {
|
|
289
295
|
$notNull?: boolean;
|
|
290
|
-
}
|
|
291
|
-
|
|
296
|
+
};
|
|
297
|
+
createdAt?: string | number | {
|
|
292
298
|
$eq?: string;
|
|
293
299
|
} | {
|
|
294
300
|
$eqi?: string;
|
|
@@ -322,11 +328,8 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
322
328
|
$notContainsi?: string;
|
|
323
329
|
} | {
|
|
324
330
|
$notNull?: boolean;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
sort?: string;
|
|
328
|
-
filter?: {
|
|
329
|
-
content?: string | number | {
|
|
331
|
+
};
|
|
332
|
+
updatedAt?: string | number | {
|
|
330
333
|
$eq?: string;
|
|
331
334
|
} | {
|
|
332
335
|
$eqi?: string;
|
|
@@ -361,7 +364,7 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
361
364
|
} | {
|
|
362
365
|
$notNull?: boolean;
|
|
363
366
|
};
|
|
364
|
-
|
|
367
|
+
authorName?: string | number | {
|
|
365
368
|
$eq?: string;
|
|
366
369
|
} | {
|
|
367
370
|
$eqi?: string;
|
|
@@ -396,7 +399,31 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
396
399
|
} | {
|
|
397
400
|
$notNull?: boolean;
|
|
398
401
|
};
|
|
399
|
-
|
|
402
|
+
};
|
|
403
|
+
limit?: number;
|
|
404
|
+
fields?: string[];
|
|
405
|
+
omit?: string[];
|
|
406
|
+
isAdmin?: boolean;
|
|
407
|
+
skip?: number;
|
|
408
|
+
startingFromId?: number;
|
|
409
|
+
dropBlockedThreads?: boolean;
|
|
410
|
+
}>;
|
|
411
|
+
export type FindAllInHierarchyValidatorSchema = ExtractRightEither<ReturnType<typeof findAllInHierarchyValidator>>;
|
|
412
|
+
export declare const findAllPerAuthorValidator: (params: object, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
413
|
+
type?: string;
|
|
414
|
+
sort?: string;
|
|
415
|
+
authorId?: string | number;
|
|
416
|
+
locale?: string;
|
|
417
|
+
pagination?: {
|
|
418
|
+
page?: number;
|
|
419
|
+
pageSize?: number;
|
|
420
|
+
withCount?: boolean;
|
|
421
|
+
};
|
|
422
|
+
populate?: Record<string, boolean | {
|
|
423
|
+
populate?: boolean;
|
|
424
|
+
}>;
|
|
425
|
+
filters?: {
|
|
426
|
+
id?: string | number | {
|
|
400
427
|
$eq?: string;
|
|
401
428
|
} | {
|
|
402
429
|
$eqi?: string;
|
|
@@ -431,7 +458,7 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
431
458
|
} | {
|
|
432
459
|
$notNull?: boolean;
|
|
433
460
|
};
|
|
434
|
-
|
|
461
|
+
content?: string | number | {
|
|
435
462
|
$eq?: string;
|
|
436
463
|
} | {
|
|
437
464
|
$eqi?: string;
|
|
@@ -466,23 +493,7 @@ export declare const findAllInHierarchyValidator: (enabledCollections: string[],
|
|
|
466
493
|
} | {
|
|
467
494
|
$notNull?: boolean;
|
|
468
495
|
};
|
|
469
|
-
|
|
470
|
-
relation?: `{${string}::${string}.${number}}`;
|
|
471
|
-
populate?: Record<string, boolean | {
|
|
472
|
-
populate?: boolean;
|
|
473
|
-
}>;
|
|
474
|
-
limit?: number;
|
|
475
|
-
fields?: string[];
|
|
476
|
-
omit?: string[];
|
|
477
|
-
isAdmin?: boolean;
|
|
478
|
-
skip?: number;
|
|
479
|
-
startingFromId?: number;
|
|
480
|
-
dropBlockedThreads?: boolean;
|
|
481
|
-
}>;
|
|
482
|
-
export type FindAllInHierarchyValidatorSchema = ExtractRightEither<ReturnType<typeof findAllInHierarchyValidator>>;
|
|
483
|
-
export declare const findAllPerAuthorValidator: (params: object, payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
484
|
-
query?: {
|
|
485
|
-
$and?: Record<string, string | number | {
|
|
496
|
+
createdAt?: string | number | {
|
|
486
497
|
$eq?: string;
|
|
487
498
|
} | {
|
|
488
499
|
$eqi?: string;
|
|
@@ -516,8 +527,8 @@ export declare const findAllPerAuthorValidator: (params: object, payload: object
|
|
|
516
527
|
$notContainsi?: string;
|
|
517
528
|
} | {
|
|
518
529
|
$notNull?: boolean;
|
|
519
|
-
}
|
|
520
|
-
|
|
530
|
+
};
|
|
531
|
+
updatedAt?: string | number | {
|
|
521
532
|
$eq?: string;
|
|
522
533
|
} | {
|
|
523
534
|
$eqi?: string;
|
|
@@ -551,19 +562,43 @@ export declare const findAllPerAuthorValidator: (params: object, payload: object
|
|
|
551
562
|
$notContainsi?: string;
|
|
552
563
|
} | {
|
|
553
564
|
$notNull?: boolean;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
565
|
+
};
|
|
566
|
+
authorName?: string | number | {
|
|
567
|
+
$eq?: string;
|
|
568
|
+
} | {
|
|
569
|
+
$eqi?: string;
|
|
570
|
+
} | {
|
|
571
|
+
$ne?: string;
|
|
572
|
+
} | {
|
|
573
|
+
$nei?: string;
|
|
574
|
+
} | {
|
|
575
|
+
$gt?: string;
|
|
576
|
+
} | {
|
|
577
|
+
$gte?: string;
|
|
578
|
+
} | {
|
|
579
|
+
$lt?: string;
|
|
580
|
+
} | {
|
|
581
|
+
$lte?: string;
|
|
582
|
+
} | {
|
|
583
|
+
$startsWith?: string;
|
|
584
|
+
} | {
|
|
585
|
+
$startsWithi?: string;
|
|
586
|
+
} | {
|
|
587
|
+
$endsWith?: string;
|
|
588
|
+
} | {
|
|
589
|
+
$endsWithi?: string;
|
|
590
|
+
} | {
|
|
591
|
+
$contains?: string;
|
|
592
|
+
} | {
|
|
593
|
+
$containsi?: string;
|
|
594
|
+
} | {
|
|
595
|
+
$notContains?: string;
|
|
596
|
+
} | {
|
|
597
|
+
$notContainsi?: string;
|
|
598
|
+
} | {
|
|
599
|
+
$notNull?: boolean;
|
|
600
|
+
};
|
|
563
601
|
};
|
|
564
|
-
populate?: Record<string, boolean | {
|
|
565
|
-
populate?: boolean;
|
|
566
|
-
}>;
|
|
567
602
|
limit?: number;
|
|
568
603
|
fields?: string[];
|
|
569
604
|
omit?: string[];
|
|
@@ -574,13 +609,13 @@ export type FindAllPerAuthorValidatorSchema = ExtractRightEither<ReturnType<type
|
|
|
574
609
|
export declare const reportAbuseValidator: (enabledCollections: string[], payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
575
610
|
content?: string;
|
|
576
611
|
reason?: string;
|
|
577
|
-
relation?: `{${string}::${string}.${
|
|
612
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
578
613
|
commentId?: number;
|
|
579
614
|
}>;
|
|
580
615
|
export type ReportAbuseValidatorSchema = ExtractRightEither<ReturnType<typeof reportAbuseValidator>>;
|
|
581
616
|
export declare const removeCommentValidator: (enabledCollections: string[], payload: object) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
582
617
|
authorId?: string | number;
|
|
583
|
-
relation?: `{${string}::${string}.${
|
|
618
|
+
relation?: `{${string}::${string}.${string}}`;
|
|
584
619
|
commentId?: number;
|
|
585
620
|
}>;
|
|
586
621
|
export type RemoveCommentValidatorSchema = ExtractRightEither<ReturnType<typeof removeCommentValidator>>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { schemaConfig } from "../../../config";
|
|
3
1
|
export declare const validateConfig: (config: unknown) => import("../../../utils/Either").Left<import("../../../utils/PluginError").default> | import("../../../utils/Either").Right<{
|
|
4
2
|
enabledCollections?: string[];
|
|
5
3
|
approvalFlow?: string[];
|
|
@@ -14,5 +12,7 @@ export declare const validateConfig: (config: unknown) => import("../../../utils
|
|
|
14
12
|
OTHER?: import("../../../const").REPORT_REASON.OTHER;
|
|
15
13
|
};
|
|
16
14
|
isGQLPluginEnabled?: boolean;
|
|
15
|
+
gql?: {
|
|
16
|
+
auth?: boolean;
|
|
17
|
+
};
|
|
17
18
|
}>;
|
|
18
|
-
export type CommentsPluginConfig = z.infer<typeof schemaConfig>;
|
|
@@ -321,13 +321,19 @@ declare const commentSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
321
321
|
declare const commentRelatedSchema: z.ZodObject<{
|
|
322
322
|
id: z.ZodNumber;
|
|
323
323
|
uid: z.ZodString;
|
|
324
|
+
documentId: z.ZodString;
|
|
324
325
|
requireCommentsApproval: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
326
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
327
|
}, "strip", z.ZodTypeAny, {
|
|
326
328
|
id?: number;
|
|
329
|
+
documentId?: string;
|
|
330
|
+
locale?: string;
|
|
327
331
|
uid?: string;
|
|
328
332
|
requireCommentsApproval?: boolean;
|
|
329
333
|
}, {
|
|
330
334
|
id?: number;
|
|
335
|
+
documentId?: string;
|
|
336
|
+
locale?: string;
|
|
331
337
|
uid?: string;
|
|
332
338
|
requireCommentsApproval?: boolean;
|
|
333
339
|
}>;
|
|
@@ -516,13 +522,19 @@ declare const commentWithRelatedSchema: z.ZodObject<z.objectUtil.extendShape<Omi
|
|
|
516
522
|
related: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
517
523
|
id: z.ZodNumber;
|
|
518
524
|
uid: z.ZodString;
|
|
525
|
+
documentId: z.ZodString;
|
|
519
526
|
requireCommentsApproval: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
527
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
520
528
|
}, "strip", z.ZodTypeAny, {
|
|
521
529
|
id?: number;
|
|
530
|
+
documentId?: string;
|
|
531
|
+
locale?: string;
|
|
522
532
|
uid?: string;
|
|
523
533
|
requireCommentsApproval?: boolean;
|
|
524
534
|
}, {
|
|
525
535
|
id?: number;
|
|
536
|
+
documentId?: string;
|
|
537
|
+
locale?: string;
|
|
526
538
|
uid?: string;
|
|
527
539
|
requireCommentsApproval?: boolean;
|
|
528
540
|
}>>>;
|
|
@@ -538,6 +550,8 @@ declare const commentWithRelatedSchema: z.ZodObject<z.objectUtil.extendShape<Omi
|
|
|
538
550
|
approvalStatus?: string;
|
|
539
551
|
related?: {
|
|
540
552
|
id?: number;
|
|
553
|
+
documentId?: string;
|
|
554
|
+
locale?: string;
|
|
541
555
|
uid?: string;
|
|
542
556
|
requireCommentsApproval?: boolean;
|
|
543
557
|
};
|
|
@@ -611,6 +625,8 @@ declare const commentWithRelatedSchema: z.ZodObject<z.objectUtil.extendShape<Omi
|
|
|
611
625
|
approvalStatus?: string;
|
|
612
626
|
related?: {
|
|
613
627
|
id?: number;
|
|
628
|
+
documentId?: string;
|
|
629
|
+
locale?: string;
|
|
614
630
|
uid?: string;
|
|
615
631
|
requireCommentsApproval?: boolean;
|
|
616
632
|
};
|
|
@@ -755,7 +755,7 @@ export declare const queryPaginationSchema: z.ZodObject<z.objectUtil.extendShape
|
|
|
755
755
|
orderBy?: string;
|
|
756
756
|
}>;
|
|
757
757
|
export declare const validate: <I, O>(result: z.SafeParseReturnType<I, O>) => import("../utils/Either").Left<PluginError> | import("../utils/Either").Right<O>;
|
|
758
|
-
export declare const getRelationValidator: (enabledCollections: string[]) => z.ZodEffects<z.ZodString, `{${string}::${string}.${
|
|
758
|
+
export declare const getRelationValidator: (enabledCollections: string[]) => z.ZodEffects<z.ZodString, `{${string}::${string}.${string}}`, string>;
|
|
759
759
|
export declare const externalAuthorSchema: z.ZodObject<{
|
|
760
760
|
id: z.ZodNumber;
|
|
761
761
|
name: z.ZodOptional<z.ZodString>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-comments",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"description": "Strapi - Comments plugin",
|
|
5
5
|
"strapi": {
|
|
6
6
|
"name": "comments",
|
|
@@ -67,11 +67,12 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@jest/types": "29.5.x",
|
|
69
69
|
"@sensinum/strapi-utils": "^1.0.2",
|
|
70
|
-
"@strapi/plugin-cloud": "^5.
|
|
71
|
-
"@strapi/plugin-
|
|
70
|
+
"@strapi/plugin-cloud": "^5.4.1",
|
|
71
|
+
"@strapi/plugin-graphql": "5.4.1",
|
|
72
|
+
"@strapi/plugin-users-permissions": "^5.4.1",
|
|
72
73
|
"@strapi/sdk-plugin": "^5.2.6",
|
|
73
|
-
"@strapi/strapi": "^5.
|
|
74
|
-
"@strapi/types": "^5.
|
|
74
|
+
"@strapi/strapi": "^5.4.1",
|
|
75
|
+
"@strapi/types": "^5.4.1",
|
|
75
76
|
"@types/jest": "^29.5.12",
|
|
76
77
|
"@types/koa": "^2.15.0",
|
|
77
78
|
"@types/react": "^18.3.8",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
92
|
"@strapi/sdk-plugin": "^5.2.7",
|
|
92
|
-
"@strapi/strapi": "^5.
|
|
93
|
+
"@strapi/strapi": "^5.4.1",
|
|
93
94
|
"react": "^18.3.1",
|
|
94
95
|
"react-dom": "^18.3.1",
|
|
95
96
|
"react-router-dom": "^6.26.2",
|