strapi-plugin-populate-all 1.2.3 → 1.3.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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # Strapi Plugin Populate All
2
2
 
3
+ [![Static Badge](https://img.shields.io/badge/strapi-market-4945FF?logo=strapi)](https://market.strapi.io/plugins/strapi-plugin-populate-all) [![NPM Version](https://img.shields.io/npm/v/strapi-plugin-populate-all?logo=npm&color=%23cb3837)](https://www.npmjs.com/package/strapi-plugin-populate-all) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/faessler/strapi-plugin-populate-all/test.yml?branch=main&logo=github&label=tests)](https://github.com/faessler/strapi-plugin-populate-all/actions/workflows/test.yml)
4
+
3
5
  A lightweight Strapi plugin that enables you to **recursively populate** all nested components, dynamic zones and relations in your REST API responses using a simple query parameter: `?populate=all`.
4
6
 
5
7
  ## Features
@@ -28,7 +30,7 @@ Add the following to your Strapi project's `config/plugins.js` (or `config/plugi
28
30
 
29
31
  ```js
30
32
  module.exports = {
31
- 'populate-all': {
33
+ "populate-all": {
32
34
  enabled: true,
33
35
  config: {
34
36
  // Populate all relations recursively (default)
@@ -38,7 +40,7 @@ module.exports = {
38
40
  relations: false,
39
41
 
40
42
  // OR: Only populate specific collection types by UID
41
- relations: ['api::article.article', 'api::category.category'],
43
+ relations: ["api::article.article", "api::category.category"],
42
44
  },
43
45
  },
44
46
  };
@@ -4,7 +4,7 @@ const getPopulateQuery = (modelUid, parentsModelUids = []) => {
4
4
  try {
5
5
  if (queryCache[modelUid]) {
6
6
  strapi.log.debug(`[populate-all] query cache hit: ${modelUid}`);
7
- return queryCache[modelUid];
7
+ return structuredClone(queryCache[modelUid]);
8
8
  }
9
9
  if (parentsModelUids.includes(modelUid)) {
10
10
  strapi.log.debug(
@@ -71,7 +71,7 @@ const getPopulateQuery = (modelUid, parentsModelUids = []) => {
71
71
  }
72
72
  strapi.log.debug(`[populate-all] new query cached: ${modelUid}`);
73
73
  queryCache[modelUid] = query;
74
- return query;
74
+ return structuredClone(query);
75
75
  } catch (error) {
76
76
  console.error(
77
77
  `[populate-all] getPopulateQuery(${modelUid}) failed: ${error}`
@@ -3,7 +3,7 @@ const getPopulateQuery = (modelUid, parentsModelUids = []) => {
3
3
  try {
4
4
  if (queryCache[modelUid]) {
5
5
  strapi.log.debug(`[populate-all] query cache hit: ${modelUid}`);
6
- return queryCache[modelUid];
6
+ return structuredClone(queryCache[modelUid]);
7
7
  }
8
8
  if (parentsModelUids.includes(modelUid)) {
9
9
  strapi.log.debug(
@@ -70,7 +70,7 @@ const getPopulateQuery = (modelUid, parentsModelUids = []) => {
70
70
  }
71
71
  strapi.log.debug(`[populate-all] new query cached: ${modelUid}`);
72
72
  queryCache[modelUid] = query;
73
- return query;
73
+ return structuredClone(query);
74
74
  } catch (error) {
75
75
  console.error(
76
76
  `[populate-all] getPopulateQuery(${modelUid}) failed: ${error}`
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.3",
2
+ "version": "1.3.0",
3
3
  "name": "strapi-plugin-populate-all",
4
4
  "description": "A lightweight plugin to recursively populate nested data in RESTful API requests",
5
5
  "keywords": [],
@@ -44,12 +44,13 @@
44
44
  "release": "semantic-release"
45
45
  },
46
46
  "devDependencies": {
47
- "@biomejs/biome": "2.0.6",
47
+ "@biomejs/biome": "2.3.2",
48
48
  "@strapi/sdk-plugin": "^5",
49
49
  "@strapi/strapi": "^5",
50
50
  "@strapi/typescript-utils": "^5",
51
- "semantic-release": "^24.2.5",
52
- "typescript": "^5.8.3"
51
+ "semantic-release": "^25.0.1",
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^4.0.6"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "@strapi/sdk-plugin": "^5",