@nkhang1902/strapi-plugin-export-import-clsx 1.4.8 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkhang1902/strapi-plugin-export-import-clsx",
3
- "version": "1.4.8",
3
+ "version": "1.5.0",
4
4
  "description": "A powerful Strapi plugin for exporting and importing data with Excel support and advanced filtering",
5
5
  "main": "./strapi-server.js",
6
6
  "scripts": {
@@ -32,6 +32,7 @@ module.exports = ({ strapi }) => ({
32
32
  timestamp: new Date().toISOString(),
33
33
  data: {},
34
34
  };
35
+ let entries = [];
35
36
 
36
37
  for (const ct of contentTypes) {
37
38
  try {
@@ -46,8 +47,6 @@ module.exports = ({ strapi }) => ({
46
47
  `Exporting ${ct} with raw filters: ${JSON.stringify(rawFilters)}`
47
48
  );
48
49
  strapi.log.info(`Parsed filters: ${JSON.stringify(parsedFilters)}`);
49
-
50
- let entries = [];
51
50
  let filters = parsedFilters.filters;
52
51
 
53
52
  // Export all entries with filters
@@ -92,10 +91,29 @@ module.exports = ({ strapi }) => ({
92
91
  strapi.log.info(`Parsed query filters: ${JSON.stringify(filters)}`);
93
92
 
94
93
  try {
95
- entries = await strapi.documents(ct).findMany({
96
- filters: { ...filters },
97
- populate: "*",
98
- });
94
+ if (mode === 'participant') {
95
+ entries = await strapi.documents(ct).findMany({
96
+ filters: { ...filters },
97
+ populate: {
98
+ corporates: true,
99
+ investors: {
100
+ populate: {
101
+ companyInformation: true,
102
+ },
103
+ },
104
+ vipGuests: {
105
+ populate: {
106
+ companyInformation: true,
107
+ },
108
+ },
109
+ },
110
+ });
111
+ } else {
112
+ entries = await strapi.documents(ct).findMany({
113
+ filters: { ...filters },
114
+ populate: "*",
115
+ });
116
+ }
99
117
  strapi.log.info(
100
118
  `EntityService found ${entries?.length || 0} entries`
101
119
  );
@@ -408,14 +426,12 @@ module.exports = ({ strapi }) => ({
408
426
 
409
427
  const data = participants.map((p) => ({
410
428
  type: p.type,
411
- corporateName: p.corporateName ?? '',
429
+ corporateName: p.corporateName ?? p.companyInformation?.companyName ?? '',
412
430
  tickerCode: p.tickerCode ?? '',
413
431
  fullName:
414
432
  p.fullName ??
415
433
  [p.firstName, p.lastName].filter(Boolean).join(' ') ??
416
434
  '',
417
- firstName: p.firstName ?? '',
418
- lastName: p.lastName ?? '',
419
435
  businessEmail: p.businessEmail ?? '',
420
436
  mobile: p.mobile ?? '',
421
437
  }));