strapi-plugin-comments 3.1.0-beta.1 → 3.1.1-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.
Files changed (28) hide show
  1. package/README.md +25 -26
  2. package/dist/_chunks/{index-DHR2DyLT.mjs → index-Bd1INOJR.mjs} +709 -691
  3. package/dist/_chunks/{index-B0lrjuBy.mjs → index-BvE3I2WB.mjs} +2 -2
  4. package/dist/_chunks/{index-DXa9DOUZ.js → index-BzZk45CE.js} +1 -1
  5. package/dist/_chunks/index-C5ADhjCF.js +18 -0
  6. package/dist/_chunks/{index-DZblWcIe.mjs → index-C9YD28U_.mjs} +2 -2
  7. package/dist/_chunks/{index-1vQEiMRT.js → index-CtUXr7rK.js} +1 -1
  8. package/dist/_chunks/{index-DmX06xc2.js → index-DHYGkXW6.js} +1 -1
  9. package/dist/_chunks/{index-B6PLZq_Z.mjs → index-DcdRh9F7.mjs} +2 -2
  10. package/dist/admin/index.js +1 -1
  11. package/dist/admin/index.mjs +1 -1
  12. package/dist/server/index.js +43 -43
  13. package/dist/server/index.mjs +1457 -1384
  14. package/dist/server/src/controllers/admin.controller.d.ts +1 -134
  15. package/dist/server/src/controllers/client.controller.d.ts +1 -134
  16. package/dist/server/src/controllers/index.d.ts +461 -389
  17. package/dist/server/src/graphql/queries/findAllInHierarchy.d.ts +1 -134
  18. package/dist/server/src/index.d.ts +13244 -7473
  19. package/dist/server/src/services/admin/admin.service.d.ts +2057 -246
  20. package/dist/server/src/services/client.service.d.ts +2086 -142
  21. package/dist/server/src/services/common.service.d.ts +2 -134
  22. package/dist/server/src/services/index.d.ts +12757 -7058
  23. package/dist/server/src/services/utils/functions.d.ts +1 -2
  24. package/dist/server/src/validators/api/controllers/admin.controller.validator.d.ts +40 -40
  25. package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +446 -108
  26. package/dist/server/src/validators/utils.d.ts +50 -50
  27. package/package.json +1 -1
  28. package/dist/_chunks/index-BU_C5-jz.js +0 -18
package/README.md CHANGED
@@ -110,7 +110,8 @@ In our minimum support we're following [official Node.js releases timelines](htt
110
110
  > This plugin is designed for **Strapi v5**. To get support for other Strapi versions, please follow the [versions](#-versions) section.
111
111
 
112
112
  **Plugin dependencies**
113
- - `@strapi/plugin-graphql` - required to run GraphQL handled by this plugin
113
+
114
+ - `@strapi/plugin-graphql` - required to run GraphQL handled by this plugin
114
115
 
115
116
  **We recommend always using the latest version of Strapi to start your new projects**.
116
117
 
@@ -134,7 +135,7 @@ On the dedicated page, you will be able to set up all crucial properties which d
134
135
  To setup amend default plugin configuration we recommend to put following snippet as part of `config/plugins.{js|ts}` or `config/<env>/plugins.{js|ts}` file. If the file does not exist yet, you have to create it manually. If you've got already configurations for other plugins stores by this way, use just the `comments` part within exising `plugins` item.
135
136
 
136
137
  ```ts
137
- module.exports = ({ env }) => ({
138
+ module.exports = ({ env }) => ({
138
139
  //...
139
140
  comments: {
140
141
  enabled: true,
@@ -289,6 +290,7 @@ Return a hierarchical tree structure of comments for specified instance of Conte
289
290
 
290
291
  - [field selection](https://docs.strapi.io/dev-docs/api/rest/populate-select#field-selection)
291
292
  - [sorting](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#sorting)
293
+ - [pagination](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#pagination)
292
294
 
293
295
  ### Get Comments (flat structure)
294
296
 
@@ -666,7 +668,7 @@ query {
666
668
  "id": "123456",
667
669
  "name": "Joe Doe"
668
670
  }
669
- },
671
+ }
670
672
  // ...
671
673
  ]
672
674
  }
@@ -937,34 +939,32 @@ Lifecycle hooks can be register either in `register()` or `bootstrap()` methods
937
939
 
938
940
  Listeners can by sync and `async`.
939
941
 
940
- >Be aware that lifecycle hooks registered in `register()` may be fired by plugin's bootstrapping. If you want listen to events triggered after server's startup use `bootstrap()`.
942
+ > Be aware that lifecycle hooks registered in `register()` may be fired by plugin's bootstrapping. If you want listen to events triggered after server's startup use `bootstrap()`.
941
943
 
942
944
  Example:
943
945
 
944
946
  ```ts
945
- const commentsCommonService = strapi
946
- .plugin("comments")
947
- .service("common");
947
+ const commentsCommonService = strapi.plugin("comments").service("common");
948
948
 
949
- commentsCommonService.registerLifecycleHook({
950
- callback: async ({ action, result }) => {
951
- const saveResult = await logIntoSystem(action, result);
949
+ commentsCommonService.registerLifecycleHook({
950
+ callback: async ({ action, result }) => {
951
+ const saveResult = await logIntoSystem(action, result);
952
952
 
953
- console.log(saveResult);
954
- },
955
- contentTypeName: "comment",
956
- hookName: "afterCreate",
957
- });
953
+ console.log(saveResult);
954
+ },
955
+ contentTypeName: "comment",
956
+ hookName: "afterCreate",
957
+ });
958
958
 
959
- commentsCommonService.registerLifecycleHook({
960
- callback: async ({ action, result }) => {
961
- const saveResult = await logIntoSystem(action, result);
959
+ commentsCommonService.registerLifecycleHook({
960
+ callback: async ({ action, result }) => {
961
+ const saveResult = await logIntoSystem(action, result);
962
962
 
963
- console.log(saveResult);
964
- },
965
- contentTypeName: "report",
966
- hookName: "afterCreate",
967
- });
963
+ console.log(saveResult);
964
+ },
965
+ contentTypeName: "report",
966
+ hookName: "afterCreate",
967
+ });
968
968
  ```
969
969
 
970
970
  ## 💬 FAQ
@@ -977,14 +977,13 @@ Example:
977
977
 
978
978
  ```ts
979
979
  module.exports = {
980
- 'comments': { enabled: true },
981
- 'graphql': { enabled: true },
980
+ comments: { enabled: true },
981
+ graphql: { enabled: true },
982
982
  };
983
983
  ```
984
984
 
985
985
  If you already got it, make sure that `comments` plugin is inserted before `graphql`. That should do the job.
986
986
 
987
-
988
987
  ## 🤝 Contributing to the plugin
989
988
 
990
989
  Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!